Просмотр исходного кода

WebGPURenderer: WebGL fallback - fix scissor with MSAA (#29148)

* scissor msaa resolve and invalidation

* update screenshot

* exclude screenshot from tests

---------

Co-authored-by: aardgoose <angus.sawyer@email.com>
aardgoose 1 год назад
Родитель
Сommit
769a82d469

BIN
examples/screenshots/webgpu_textures_anisotropy.jpg


+ 1 - 1
examples/webgpu_textures_anisotropy.html

@@ -228,7 +228,7 @@
 				renderer.setScissor( SCREEN_WIDTH / 2, 0, SCREEN_WIDTH / 2 - 2, SCREEN_HEIGHT );
 				renderer.render( scene2, camera );
 
-				// renderer.setScissorTest( false );
+				renderer.setScissorTest( false );
 
 			}
 

+ 13 - 2
src/renderers/webgl-fallback/WebGLBackend.js

@@ -274,9 +274,20 @@ class WebGLBackend extends Backend {
 
 					// TODO Add support for MRT
 
-					gl.blitFramebuffer( 0, 0, renderContext.width, renderContext.height, 0, 0, renderContext.width, renderContext.height, mask, gl.NEAREST );
+					if ( renderContext.scissor ) {
+
+						const { x, y, width, height } = renderContext.scissorValue;
+
+						gl.blitFramebuffer( x, y, x + width, y + height, x, y, x + width, y + height, mask, gl.NEAREST );
+						gl.invalidateSubFramebuffer( gl.READ_FRAMEBUFFER, renderTargetContextData.invalidationArray, x, y, width, height );
+
+					} else {
+
+						gl.blitFramebuffer( 0, 0, renderContext.width, renderContext.height, 0, 0, renderContext.width, renderContext.height, mask, gl.NEAREST );
+						gl.invalidateFramebuffer( gl.READ_FRAMEBUFFER, renderTargetContextData.invalidationArray );
+
+					}
 
-					gl.invalidateFramebuffer( gl.READ_FRAMEBUFFER, renderTargetContextData.invalidationArray );
 
 				}
 

+ 1 - 0
test/e2e/puppeteer.js

@@ -149,6 +149,7 @@ const exceptionList = [
 	'webgpu_tsl_vfx_flames',
 	'webgpu_tsl_halftone',
 	'webgpu_tsl_vfx_tornado',
+	'webgpu_textures_anisotropy',
 
 	// WebGPU idleTime and parseTime too low
 	'webgpu_compute_particles',

粤ICP备19079148号