|
@@ -446,9 +446,12 @@ class WebGLBackend extends Backend {
|
|
|
|
|
|
|
|
if ( renderContext.scissor ) {
|
|
if ( renderContext.scissor ) {
|
|
|
|
|
|
|
|
- const { x, y, width, height } = renderContext.scissorValue;
|
|
|
|
|
|
|
+ this.updateScissor( renderContext );
|
|
|
|
|
|
|
|
- state.scissor( x, renderContext.height - height - y, width, height );
|
|
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ const { width, height } = this.getDrawingBufferSize();
|
|
|
|
|
+ state.scissor( 0, 0, width, height );
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -545,6 +548,17 @@ class WebGLBackend extends Backend {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if ( previousContext.scissor ) {
|
|
|
|
|
+
|
|
|
|
|
+ this.updateScissor( previousContext );
|
|
|
|
|
+
|
|
|
|
|
+ } else {
|
|
|
|
|
+
|
|
|
|
|
+ const { width, height } = this.getDrawingBufferSize();
|
|
|
|
|
+ state.scissor( 0, 0, width, height );
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
this.prepareTimestampBuffer( TimestampQuery.RENDER, this.getTimestampUID( renderContext ) );
|
|
this.prepareTimestampBuffer( TimestampQuery.RENDER, this.getTimestampUID( renderContext ) );
|
|
@@ -646,6 +660,20 @@ class WebGLBackend extends Backend {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Updates the scissor with the values from the given render context.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param {RenderContext} renderContext - The render context.
|
|
|
|
|
+ */
|
|
|
|
|
+ updateScissor( renderContext ) {
|
|
|
|
|
+
|
|
|
|
|
+ const { state } = this;
|
|
|
|
|
+ const { x, y, width, height } = renderContext.scissorValue;
|
|
|
|
|
+
|
|
|
|
|
+ state.scissor( x, renderContext.height - height - y, width, height );
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* Defines the scissor test.
|
|
* Defines the scissor test.
|
|
|
*
|
|
*
|