You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't seem to figure out how to issue a draw() command with instancing while only using part of the instance buffer.
I have two structs, Vertex and VertexInstance. The vertex buffer is a Arc<ImmutableBuffer<[Vertex]>>, and the instance buffer is a Arc<CpuAccessibleBuffer<[VertexInstance]>>.
I'm trying to figure out what to put for the vertex_buffer parameter in AutoCommandBufferBuilder::draw(). I cannot use a tuple like the instancing example or I get:
expected struct `std::vec::Vec`, found tuple
I can provide both buffers within a vec![] macro, but only the whole buffers. I want to allocate the buffers ahead of time with a fixed size and then reuse said buffers by writing to them. Thus I only want to draw the instances that are "fresh" in the buffer. If I try to use a BufferSlice, it is typed with the vertex struct, so if I try to use them in draw(), I get:
expected struct `Vertex`, found struct `VertexInstance`
Is there something I'm missing? How do I use these together?
The text was updated successfully, but these errors were encountered:
I can't seem to figure out how to issue a draw() command with instancing while only using part of the instance buffer.
I have two structs,
Vertex
andVertexInstance
. The vertex buffer is aArc<ImmutableBuffer<[Vertex]>>
, and the instance buffer is aArc<CpuAccessibleBuffer<[VertexInstance]>>
.I'm trying to figure out what to put for the
vertex_buffer
parameter inAutoCommandBufferBuilder::draw()
. I cannot use a tuple like theinstancing
example or I get:I can provide both buffers within a
vec![]
macro, but only the whole buffers. I want to allocate the buffers ahead of time with a fixed size and then reuse said buffers by writing to them. Thus I only want to draw the instances that are "fresh" in the buffer. If I try to use aBufferSlice
, it is typed with the vertex struct, so if I try to use them indraw()
, I get:Is there something I'm missing? How do I use these together?
The text was updated successfully, but these errors were encountered: