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
So in my project, I have a mesh file that has the data already ready to be sent to the GPU. I create bindings dynamically, and call VertexBuffer::new_raw. Then, when VertexAttribPointer in vertex_array_object.rs is called, the stride parameter is incorrect.
I had a further look at the source to VertexBuffer
#[inline]pubunsafefnnew_raw<F: ?Sized>(facade:&F,data:&[T],bindings:VertexFormat,elements_size:usize)
-> Result<VertexBuffer<T>,CreationError>whereF:Facade{// FIXME: check that the format is supportedOk(VertexBuffer{buffer:Buffer::new(facade, data,BufferType::ArrayBuffer,BufferMode::Default)?,
bindings,})}
It appears the elements_size param is actually ignored
So in my project, I have a mesh file that has the data already ready to be sent to the GPU. I create bindings dynamically, and call
VertexBuffer::new_raw
. Then, when VertexAttribPointer in vertex_array_object.rs is called, the stride parameter is incorrect.Example:
Vertex attributes (Generated)
So here we see the vertex consists of 3x F16 for position, and 2x F16 for texture location. This means that each vertex is 5x2 bytes long (10 bytes).
So I call
VertexBuffer::new_raw
like so:Note that
vertex_buffer
is simply a array of u8 bytes from the file being read into the GPU directly.but then, when rendering, the vertex size is ignored and set to 1 instead!
Call (vertex_array_object.rs)
Note how the 4th parameter here is 1 in the call withint glium? This should be 10 as it is what I set in my vertex stride size.
The text was updated successfully, but these errors were encountered: