From b86310b1c5c064196fe17bc030d77cd0be071cd0 Mon Sep 17 00:00:00 2001 From: Trass3r Date: Fri, 27 Oct 2023 19:29:50 +0200 Subject: [PATCH] add debug groups for shadow draw calls (#2126) --- .../src/main/java/com/jme3/renderer/RenderManager.java | 8 -------- .../main/java/com/jme3/renderer/queue/RenderQueue.java | 4 ++++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java index 5969a1d5bd..bdaf1d3c92 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java +++ b/jme3-core/src/main/java/com/jme3/renderer/RenderManager.java @@ -967,9 +967,7 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) { if (prof != null) { prof.vpStep(VpStep.RenderBucket, vp, Bucket.Opaque); } - this.renderer.pushDebugGroup(Bucket.Opaque.name()); rq.renderQueue(Bucket.Opaque, this, cam, flush); - this.renderer.popDebugGroup(); // render the sky, with depth range set to the farthest if (!rq.isQueueEmpty(Bucket.Sky)) { @@ -977,9 +975,7 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) { prof.vpStep(VpStep.RenderBucket, vp, Bucket.Sky); } renderer.setDepthRange(1, 1); - this.renderer.pushDebugGroup(Bucket.Sky.name()); rq.renderQueue(Bucket.Sky, this, cam, flush); - this.renderer.popDebugGroup(); depthRangeChanged = true; } @@ -995,9 +991,7 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) { renderer.setDepthRange(0, 1); depthRangeChanged = false; } - this.renderer.pushDebugGroup(Bucket.Transparent.name()); rq.renderQueue(Bucket.Transparent, this, cam, flush); - this.renderer.popDebugGroup(); } if (!rq.isQueueEmpty(Bucket.Gui)) { @@ -1006,9 +1000,7 @@ public void renderViewPortQueues(ViewPort vp, boolean flush) { } renderer.setDepthRange(0, 0); setCamera(cam, true); - this.renderer.pushDebugGroup(Bucket.Gui.name()); rq.renderQueue(Bucket.Gui, this, cam, flush); - this.renderer.popDebugGroup(); setCamera(cam, false); depthRangeChanged = true; } diff --git a/jme3-core/src/main/java/com/jme3/renderer/queue/RenderQueue.java b/jme3-core/src/main/java/com/jme3/renderer/queue/RenderQueue.java index e95463f14e..86c5bc5280 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/queue/RenderQueue.java +++ b/jme3-core/src/main/java/com/jme3/renderer/queue/RenderQueue.java @@ -279,7 +279,9 @@ private void renderGeometryList(GeometryList list, RenderManager rm, Camera cam, } public void renderShadowQueue(GeometryList list, RenderManager rm, Camera cam, boolean clear) { + rm.getRenderer().pushDebugGroup("ShadowQueue"); renderGeometryList(list, rm, cam, clear); + rm.getRenderer().popDebugGroup(); } public boolean isQueueEmpty(Bucket bucket) { @@ -304,6 +306,7 @@ public void renderQueue(Bucket bucket, RenderManager rm, Camera cam) { } public void renderQueue(Bucket bucket, RenderManager rm, Camera cam, boolean clear) { + rm.getRenderer().pushDebugGroup(bucket.name()); switch (bucket) { case Gui: renderGeometryList(guiList, rm, cam, clear); @@ -324,6 +327,7 @@ public void renderQueue(Bucket bucket, RenderManager rm, Camera cam, boolean cle default: throw new UnsupportedOperationException("Unsupported bucket type: " + bucket); } + rm.getRenderer().popDebugGroup(); } public void clear() {