Skip to content

Commit 5855564

Browse files
authored
WebGPURenderer: Fix viewport/scissor after copyFramebufferToTexture() (#29978)
1 parent 269e892 commit 5855564

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/renderers/webgpu/WebGPUBackend.js

+15-1
Original file line numberDiff line numberDiff line change
@@ -1539,7 +1539,7 @@ class WebGPUBackend extends Backend {
15391539
encoder.copyTextureToTexture(
15401540
{
15411541
texture: sourceGPU,
1542-
origin: { x: rectangle.x, y: rectangle.y, z: 0 }
1542+
origin: [ rectangle.x, rectangle.y, 0 ],
15431543
},
15441544
{
15451545
texture: destinationGPU
@@ -1568,6 +1568,20 @@ class WebGPUBackend extends Backend {
15681568
renderContextData.currentPass = encoder.beginRenderPass( descriptor );
15691569
renderContextData.currentSets = { attributes: {}, bindingGroups: [], pipeline: null, index: null };
15701570

1571+
if ( renderContext.viewport ) {
1572+
1573+
this.updateViewport( renderContext );
1574+
1575+
}
1576+
1577+
if ( renderContext.scissor ) {
1578+
1579+
const { x, y, width, height } = renderContext.scissorValue;
1580+
1581+
renderContextData.currentPass.setScissorRect( x, y, width, height );
1582+
1583+
}
1584+
15711585
} else {
15721586

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

0 commit comments

Comments
 (0)