Skip to content

Commit

Permalink
Added couple of additional GPU markers to forward renderer (#5111)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Valigursky <mvaligursky@snapchat.com>
  • Loading branch information
mvaligursky and Martin Valigursky committed Feb 27, 2023
1 parent 232ab77 commit 8f95e2d
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/scene/renderer/forward-renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@ class ForwardRenderer extends Renderer {
if (!drawCall._shader[pass] || drawCall._shaderDefs !== objDefs || drawCall._lightHash !== lightHash) {

// marker to allow us to see the source node for shader alloc
DebugGraphics.pushGpuMarker(device, drawCall.node.name);
DebugGraphics.pushGpuMarker(device, `Node: ${drawCall.node.name}`);

// draw calls not using static lights use variants cache on material to quickly find the shader, as they are all
// the same for the same pass, using all lights of the scene
Expand Down Expand Up @@ -575,6 +575,8 @@ class ForwardRenderer extends Renderer {
if (skipMaterial)
break;

DebugGraphics.pushGpuMarker(device, `Material: ${material.name}`);

// Uniforms I: material
material.setParameters(device);

Expand Down Expand Up @@ -605,8 +607,12 @@ class ForwardRenderer extends Renderer {
} else {
device.setDepthBias(false);
}

DebugGraphics.popGpuMarker(device);
}

DebugGraphics.pushGpuMarker(device, `Node: ${drawCall.node.name}`);

this.setCullMode(camera._cullFaces, flipFaces, drawCall);

const stencilFront = drawCall.stencilFront || material.stencilFront;
Expand Down Expand Up @@ -694,6 +700,8 @@ class ForwardRenderer extends Renderer {
if (i < preparedCallsCount - 1 && !preparedCalls.isNewMaterial[i + 1]) {
material.setParameters(device, drawCall.parameters);
}

DebugGraphics.popGpuMarker(device);
}
}
}
Expand Down

0 comments on commit 8f95e2d

Please sign in to comment.