Skip to content

Commit 37e7ef1

Browse files
committed
Fix index buffer allocation bug
1 parent 374ddfc commit 37e7ef1

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/main/java/net/vulkanmod/render/vertex/TerrainBuilder.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ public class TerrainBuilder {
3333
private final TerrainBufferBuilder[] bufferBuilders;
3434

3535
public TerrainBuilder(int size, VertexBuilder vertexBuilder) {
36-
this.indexBufferCapacity = size * IndexBuffer.IndexType.UINT32.size;
37-
this.indexBufferPtr = ALLOCATOR.malloc(size);
36+
// FIXME: same size is used for both index and vertex buffers
37+
this.indexBufferCapacity = size;
38+
this.indexBufferPtr = ALLOCATOR.malloc(this.indexBufferCapacity);
3839

3940
this.format = PipelineManager.terrainVertexFormat;
4041
this.vertexBuilder = vertexBuilder;

0 commit comments

Comments
 (0)