mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-12-27 07:26:48 +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
23c0ef6f33
commit
83a5723420
1 changed files with 1 additions and 1 deletions
|
@ -40,7 +40,7 @@ public class IndexedModel implements BufferedModel {
|
||||||
|
|
||||||
vbo.bind();
|
vbo.bind();
|
||||||
// allocate the buffer on the gpu
|
// 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.
|
// mirror it in system memory, so we can write to it, and upload our model.
|
||||||
try (MappedBuffer buffer = vbo.getBuffer()) {
|
try (MappedBuffer buffer = vbo.getBuffer()) {
|
||||||
|
|
Loading…
Reference in a new issue