diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java index dae12ac7b..f99a6d799 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectBuffers.java @@ -1,5 +1,6 @@ package com.jozufozu.flywheel.backend.instancing.indirect; +import static org.lwjgl.opengl.GL45.glCreateBuffers; import static org.lwjgl.opengl.GL46.GL_DRAW_INDIRECT_BUFFER; import static org.lwjgl.opengl.GL46.GL_DYNAMIC_STORAGE_BIT; import static org.lwjgl.opengl.GL46.GL_MAP_FLUSH_EXPLICIT_BIT; @@ -10,7 +11,6 @@ import static org.lwjgl.opengl.GL46.glBindBuffer; import static org.lwjgl.opengl.GL46.glCopyNamedBufferSubData; import static org.lwjgl.opengl.GL46.glDeleteBuffers; import static org.lwjgl.opengl.GL46.glFlushMappedNamedBufferRange; -import static org.lwjgl.opengl.GL46.glGenBuffers; import static org.lwjgl.opengl.GL46.glNamedBufferStorage; import static org.lwjgl.opengl.GL46.nglBindBuffersRange; import static org.lwjgl.opengl.GL46.nglCreateBuffers; @@ -154,7 +154,7 @@ public class IndirectBuffers { var drawSize = DRAW_COMMAND_STRIDE * drawCount; if (maxDrawCount > 0) { - int drawNew = glGenBuffers(); + int drawNew = glCreateBuffers(); glNamedBufferStorage(drawNew, drawSize, SUB_DATA_BITS); diff --git a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java b/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java index 05794682f..4b74170cf 100644 --- a/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java +++ b/src/main/java/com/jozufozu/flywheel/backend/instancing/indirect/IndirectCullingGroup.java @@ -137,6 +137,9 @@ public class IndirectCullingGroup { buffers.bindObjectAndTarget(); buffers.bindIndirectBuffer(); + UniformBuffer.getInstance() + .sync(); + memoryBarrier(); drawSet.submit(stage);