|
|
@@ -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 );
|
|
|
|
|
|
}
|
|
|
|