Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

How to use GraphicsPipelineAbstract in the draw_indexed function #676

Closed
SiebenCorgie opened this issue Jul 22, 2017 · 2 comments
Closed

Comments

@SiebenCorgie
Copy link

Hi

I tried to store a GraphicsPipeline in a struct. As suggested here I tried to use the GraphicsPipelineAbstract in a struct like

pub struct pipe_def{
    name: String,
    pipeline: Arc<pipeline::GraphicsPipelineAbstract>,
}

However if I pass this to the function draw_indexed I get the following error:

error[E0277]: the trait bound `vulkano::pipeline::GraphicsPipelineAbstract: std::marker::Send` is not satisfied
   --> src/main.rs:254:22
    |
254 |                     .draw_indexed(
    |                      ^^^^^^^^^^^^ `vulkano::pipeline::GraphicsPipelineAbstract` cannot be sent between threads safely
    |
    = help: the trait `std::marker::Send` is not implemented for `vulkano::pipeline::GraphicsPipelineAbstract`
    = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<vulkano::pipeline::GraphicsPipelineAbstract>`

error[E0277]: the trait bound `vulkano::pipeline::GraphicsPipelineAbstract: std::marker::Sync` is not satisfied
   --> src/main.rs:254:22
    |
254 |                     .draw_indexed(
    |                      ^^^^^^^^^^^^ `vulkano::pipeline::GraphicsPipelineAbstract` cannot be shared between threads safely
    |
    = help: the trait `std::marker::Sync` is not implemented for `vulkano::pipeline::GraphicsPipelineAbstract`
    = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<vulkano::pipeline::GraphicsPipelineAbstract>`

Any way to fix this?

thanks in advance,

-siebencorgie

@tomaka
Copy link
Member

tomaka commented Jul 22, 2017

Hi,

Try Arc<GraphicsPipelineAbstract + Send + Sync> instead of simply Arc<GraphicsPipelineAbstract>.

@SiebenCorgie
Copy link
Author

Works like a charm,
thank you very much!

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

2 participants