Skip to content

Commit

Permalink
WebGPURenderer: Fix viewport/scissor after `copyFramebufferToTexture(…
Browse files Browse the repository at this point in the history
…)` (#29978)
  • Loading branch information
sunag authored Nov 27, 2024
1 parent 269e892 commit 5855564
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion src/renderers/webgpu/WebGPUBackend.js
Original file line number Diff line number Diff line change
Expand Up @@ -1539,7 +1539,7 @@ class WebGPUBackend extends Backend {
encoder.copyTextureToTexture(
{
texture: sourceGPU,
origin: { x: rectangle.x, y: rectangle.y, z: 0 }
origin: [ rectangle.x, rectangle.y, 0 ],
},
{
texture: destinationGPU
Expand Down Expand Up @@ -1568,6 +1568,20 @@ class WebGPUBackend extends Backend {
renderContextData.currentPass = encoder.beginRenderPass( descriptor );
renderContextData.currentSets = { attributes: {}, bindingGroups: [], pipeline: null, index: null };

if ( renderContext.viewport ) {

this.updateViewport( renderContext );

}

if ( renderContext.scissor ) {

const { x, y, width, height } = renderContext.scissorValue;

renderContextData.currentPass.setScissorRect( x, y, width, height );

}

} else {

this.device.queue.submit( [ encoder.finish() ] );
Expand Down

0 comments on commit 5855564

Please sign in to comment.