Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improvement to GPU markers reporting of render passes #6096

Merged
merged 2 commits into from
Feb 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/platform/graphics/render-pass.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
/**
Expand Down Expand Up @@ -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);
Expand All @@ -384,8 +382,6 @@ class RenderPass {
this.after();

device.renderPassIndex++;

DebugGraphics.popGpuMarker(device);
}
}

Expand Down
2 changes: 2 additions & 0 deletions src/platform/graphics/webgl/webgl-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) {
Expand Down
6 changes: 6 additions & 0 deletions src/platform/graphics/webgpu/webgpu-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
Expand Down