diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/device/GLRenderDevice.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/device/GLRenderDevice.java index b43e7091..a66b0114 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/device/GLRenderDevice.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/gl/device/GLRenderDevice.java @@ -278,19 +278,12 @@ public ImmediateDrawCommandList() { public void multiDrawElementsBaseVertex(MultiDrawBatch batch, GlIndexType indexType) { GlPrimitiveType primitiveType = GLRenderDevice.this.activeTessellation.getPrimitiveType(); - for (int i = 0; i < batch.size(); i++) { - int elementCount = MemoryUtil.memGetInt(batch.pElementCount + i * Integer.BYTES); - long elementPointer = MemoryUtil.memGetAddress(batch.pElementPointer + i * Long.BYTES); - int baseVertex = MemoryUtil.memGetInt(batch.pBaseVertex + i * Integer.BYTES); - - GL32.glDrawElementsBaseVertex( - primitiveType.getId(), - elementCount, - indexType.getFormatId(), - elementPointer, - baseVertex - ); - } + GL32C.nglMultiDrawElementsBaseVertex(primitiveType.getId(), + batch.pElementCount, + indexType.getFormatId(), + batch.pElementPointer, + batch.size(), + batch.pBaseVertex); } @Override