mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-10 20:45:59 +01:00
Fix IndexedModel allocating incorrect amount of bytes
- model.size() returned the byte size relative to the model's VertexType, but the byte size relative to the passed VertexType is needed instead
This commit is contained in:
parent
f5acaeb1d7
commit
d96ad156e1
@ -40,7 +40,7 @@ public class IndexedModel implements BufferedModel {
|
||||
|
||||
vbo.bind();
|
||||
// allocate the buffer on the gpu
|
||||
vbo.ensureCapacity(model.size());
|
||||
vbo.ensureCapacity(type.byteOffset(model.vertexCount()));
|
||||
|
||||
// mirror it in system memory, so we can write to it, and upload our model.
|
||||
try (MappedBuffer buffer = vbo.getBuffer()) {
|
||||
|
Loading…
Reference in New Issue
Block a user