Skip to content

Commit

Permalink
[Fix] Small fix to just introduced issue with MRT (#6947)
Browse files Browse the repository at this point in the history
* [Fix] Small fix to just introduced issue with MRT

* logging

---------

Co-authored-by: Martin Valigursky <[email protected]>
  • Loading branch information
mvaligursky and Martin Valigursky authored Sep 11, 2024
1 parent af325c8 commit 09901d1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/platform/graphics/render-target.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class RenderTarget {
this.id = id++;

// device, from one of the buffers
const device = options.colorBuffer?.device || options.depthBuffer?.device || options.graphicsDevice;
const device = options.colorBuffer?.device ?? options.colorBuffers?.[0].device ?? options.depthBuffer?.device ?? options.graphicsDevice;
Debug.assert(device, 'Failed to obtain the device, colorBuffer nor depthBuffer store it.');
this._device = device;

Expand Down
6 changes: 3 additions & 3 deletions src/platform/graphics/webgl/webgl-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,14 +1149,14 @@ class WebglGraphicsDevice extends GraphicsDevice {
*/
startRenderPass(renderPass) {

DebugGraphics.pushGpuMarker(this, `Pass:${renderPass.name}`);
DebugGraphics.pushGpuMarker(this, 'START-PASS');

// set up render target
const rt = renderPass.renderTarget ?? this.backBuffer;
this.renderTarget = rt;
Debug.assert(rt);

DebugGraphics.pushGpuMarker(this, `Pass:${renderPass.name} RT:${rt.name}`);
DebugGraphics.pushGpuMarker(this, 'START-PASS');

this.updateBegin();

// the pass always start using full size of the target
Expand Down
2 changes: 1 addition & 1 deletion src/platform/graphics/webgpu/webgpu-graphics-device.js
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ class WebgpuGraphicsDevice extends GraphicsDevice {
DebugHelper.setLabel(this.passEncoder, renderPass.name);

// push marker to the passEncoder
DebugGraphics.pushGpuMarker(this, `Pass:${renderPass.name}`);
DebugGraphics.pushGpuMarker(this, `Pass:${renderPass.name} RT:${rt.name}`);

this.setupPassEncoderDefaults();

Expand Down
2 changes: 1 addition & 1 deletion src/scene/graphics/render-pass-quad.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class RenderPassQuad extends RenderPass {

execute() {
const { device } = this;
DebugGraphics.pushGpuMarker(device, 'drawQuadWithShader');
DebugGraphics.pushGpuMarker(device, `${this.name}:${this.quad.shader.name}`);

device.setCullMode(CULLFACE_NONE);
device.setDepthState(DepthState.NODEPTH);
Expand Down

0 comments on commit 09901d1

Please sign in to comment.