diff --git a/src/platform/graphics/render-pass.js b/src/platform/graphics/render-pass.js index a221cf6aa1c..144d78dc201 100644 --- a/src/platform/graphics/render-pass.js +++ b/src/platform/graphics/render-pass.js @@ -2,7 +2,6 @@ import { Debug } from '../../core/debug.js'; import { Tracing } from '../../core/tracing.js'; import { Color } from '../../core/math/color.js'; import { TRACEID_RENDER_PASS, TRACEID_RENDER_PASS_DETAIL } from '../../core/constants.js'; -import { DebugGraphics } from '../graphics/debug-graphics.js'; class ColorAttachmentOps { /** @@ -360,7 +359,6 @@ class RenderPass { const device = this.device; const realPass = this.renderTarget !== undefined; - DebugGraphics.pushGpuMarker(device, `Pass:${this.name}`); Debug.call(() => { this.log(device, device.renderPassIndex); @@ -384,8 +382,6 @@ class RenderPass { this.after(); device.renderPassIndex++; - - DebugGraphics.popGpuMarker(device); } } diff --git a/src/platform/graphics/webgl/webgl-graphics-device.js b/src/platform/graphics/webgl/webgl-graphics-device.js index d3a69e5f1c3..6d2f24f9028 100644 --- a/src/platform/graphics/webgl/webgl-graphics-device.js +++ b/src/platform/graphics/webgl/webgl-graphics-device.js @@ -1553,6 +1553,7 @@ class WebglGraphicsDevice extends GraphicsDevice { */ startRenderPass(renderPass) { + DebugGraphics.pushGpuMarker(this, `Pass:${renderPass.name}`); DebugGraphics.pushGpuMarker(this, `START-PASS`); // set up render target @@ -1685,6 +1686,7 @@ class WebglGraphicsDevice extends GraphicsDevice { this.insideRenderPass = false; DebugGraphics.popGpuMarker(this); + DebugGraphics.popGpuMarker(this); // pop the pass-start marker } set defaultFramebuffer(value) { diff --git a/src/platform/graphics/webgpu/webgpu-graphics-device.js b/src/platform/graphics/webgpu/webgpu-graphics-device.js index 0f5461db091..f5b8e80cd9d 100644 --- a/src/platform/graphics/webgpu/webgpu-graphics-device.js +++ b/src/platform/graphics/webgpu/webgpu-graphics-device.js @@ -606,6 +606,9 @@ class WebgpuGraphicsDevice extends GraphicsDevice { this.passEncoder = this.commandEncoder.beginRenderPass(renderPassDesc); DebugHelper.setLabel(this.passEncoder, renderPass.name); + // push marker to the passEncoder + DebugGraphics.pushGpuMarker(this, `Pass:${renderPass.name}`); + this.setupPassEncoderDefaults(); // the pass always clears full target @@ -627,6 +630,9 @@ class WebgpuGraphicsDevice extends GraphicsDevice { */ endRenderPass(renderPass) { + // pop the marker from the passEncoder + DebugGraphics.popGpuMarker(this); + // end the render pass this.passEncoder.end(); this.passEncoder = null;