Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Cannot use GraphicsPipelineAbstract in draw_indexed function if using a tuple as VertexSource #1433

Closed
KeyboardDanni opened this issue Nov 7, 2020 · 1 comment

Comments

@KeyboardDanni
Copy link

Related to #1429 and #676.

The response in #676 implies that one can use a Arc<GraphicsPipelineAbstract + Send + Sync> instead of a Arc<GraphicsPipelineAbstract> for a pipeline in a struct in order to issue a call to draw_indexed. However, this only works if sending a Vec<Box<dyn BufferAccess + Send + Sync>> as the VertexSource. Attempting to use a tuple as a VertexSource gives the following:

error[E0277]: the size for values of type `dyn vulkano::pipeline::GraphicsPipelineAbstract + std::marker::Send + std::marker::Sync` cannot be known at compilation time
   --> keeshond/src/renderer/vulkan.rs:295:29
    |
295 |                     builder.draw_indexed::<(BufferSlice<[Vertex], &Arc<ImmutableBuffer<[Vertex]>>>, BufferSlice<[&VertexInstance], &Arc<CpuAccessibleBuffer<[&VertexInstance]>>>), _, _, _, _, _>
    |                             ^^^^^^^^^^^^ doesn't have a size known at compile-time
    |
    = help: the trait `std::marker::Sized` is not implemented for `dyn vulkano::pipeline::GraphicsPipelineAbstract + std::marker::Send + std::marker::Sync`
    = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
    = note: required because of the requirements on the impl of `vulkano::pipeline::vertex::VertexSource<(vulkano::buffer::BufferSlice<[renderer::vulkan::Vertex], &std::sync::Arc<vulkano::buffer::ImmutableBuffer<[renderer::vulkan::Vertex]>>>, vulkano::buffer::BufferSlice<[&renderer::vulkan::VertexInstance], &std::sync::Arc<vulkano::buffer::CpuAccessibleBuffer<[&renderer::vulkan::VertexInstance]>>>)>` for `dyn vulkano::pipeline::GraphicsPipelineAbstract + std::marker::Send + std::marker::Sync`
    = note: required because of the requirements on the impl of `vulkano::pipeline::vertex::VertexSource<(vulkano::buffer::BufferSlice<[renderer::vulkan::Vertex], &std::sync::Arc<vulkano::buffer::ImmutableBuffer<[renderer::vulkan::Vertex]>>>, vulkano::buffer::BufferSlice<[&renderer::vulkan::VertexInstance], &std::sync::Arc<vulkano::buffer::CpuAccessibleBuffer<[&renderer::vulkan::VertexInstance]>>>)>` for `std::sync::Arc<dyn vulkano::pipeline::GraphicsPipelineAbstract + std::marker::Send + std::marker::Sync>`

How do I make the call to draw_indexed in this scenario, where I need to pass a Vertex and Instance buffer, and the pipeline needs to be stored in a struct?

@Rua
Copy link
Contributor

Rua commented Nov 25, 2021

The way that vertex buffers are specified is completely different now, and GraphicsPipelineAbstract doesn't exist anymore either. So this can be closed.

@Rua Rua closed this as completed May 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants