|
|
@@ -777,8 +777,7 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
if ( renderContext.scissor ) {
|
|
|
|
|
|
- const { x, y, width, height } = renderContext.scissorValue;
|
|
|
- currentPass.setScissorRect( x, y, width, height );
|
|
|
+ this.updateScissor( renderContext );
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -1138,6 +1137,20 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * Updates the scissor with the values from the given render context.
|
|
|
+ *
|
|
|
+ * @param {RenderContext} renderContext - The render context.
|
|
|
+ */
|
|
|
+ updateScissor( renderContext ) {
|
|
|
+
|
|
|
+ const { currentPass } = this.get( renderContext );
|
|
|
+ const { x, y, width, height } = renderContext.scissorValue;
|
|
|
+
|
|
|
+ currentPass.setScissorRect( x, y, width, height );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* Returns the clear color and alpha into a single
|
|
|
* color object.
|
|
|
@@ -2401,6 +2414,15 @@ class WebGPUBackend extends Backend {
|
|
|
]
|
|
|
);
|
|
|
|
|
|
+ // mipmaps must be genereated with the same encoder otherwise the copied texture data
|
|
|
+ // might be out-of-sync, see #31768
|
|
|
+
|
|
|
+ if ( texture.generateMipmaps ) {
|
|
|
+
|
|
|
+ this.textureUtils.generateMipmaps( texture, encoder );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
if ( renderContextData.currentPass ) {
|
|
|
|
|
|
const { descriptor } = renderContextData;
|
|
|
@@ -2425,9 +2447,7 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
if ( renderContext.scissor ) {
|
|
|
|
|
|
- const { x, y, width, height } = renderContext.scissorValue;
|
|
|
-
|
|
|
- renderContextData.currentPass.setScissorRect( x, y, width, height );
|
|
|
+ this.updateScissor( renderContext );
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -2437,12 +2457,6 @@ class WebGPUBackend extends Backend {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( texture.generateMipmaps ) {
|
|
|
-
|
|
|
- this.textureUtils.generateMipmaps( texture );
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
|
|
|
dispose() {
|