From 57f6a48969a245de69ec031c3aaa3b66be577d2d Mon Sep 17 00:00:00 2001 From: Jozufozu Date: Sun, 21 Aug 2022 23:02:43 -0700 Subject: [PATCH] One liners - Fix nothing rendering + gl error spam when renderdoc is not attached - Fix fog rendering incorrectly with indirect --- .../flywheel/backend/instancing/indirect/IndirectBuffers.java | 4 ++-- .../backend/instancing/indirect/IndirectCullingGroup.java | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) 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);