don't render closed VBOs

This commit is contained in:
James Seibel
2026-03-09 09:19:08 -05:00
parent 3498faed59
commit 354b6567d4
2 changed files with 9 additions and 5 deletions
@@ -379,11 +379,14 @@ public class McLodRenderer implements IMcLodRenderer
renderPass.setVertexBuffer(0, bufferWrapper.vboGpuBuffer); // vertex buffer can only be "0" lol
renderPass.drawIndexed(
/*indexStart*/ 0,
/*firstIndex*/0,
/*indexCount*/bufferWrapper.indexCount,
/*instanceCount*/1);
if (!bufferWrapper.vboGpuBuffer.isClosed())
{
renderPass.drawIndexed(
/*indexStart*/ 0,
/*firstIndex*/0,
/*indexCount*/bufferWrapper.indexCount,
/*instanceCount*/1);
}
}
}
@@ -16,6 +16,7 @@ public class UniformHandler
if (vboGpuBuffer == null
|| vboGpuBuffer.size() < size)
{
// TODO
// GpuBuffer.USAGE_UNIFORM = 128
int usage = 8 | 32 | 128; // is this just using OpenGL VBO flags?, if so I can't find it, supposedly GlDevice on Mojang's side
vboGpuBuffer = gpuDevice.createBuffer(() -> uniformName, usage, size);