Skip to content

Commit 6f6fbad

Browse files
committed
Don't adjust viewport unless needed
1 parent 216f74b commit 6f6fbad

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

src/renderer/webgl/WebGLRenderer.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1524,10 +1524,11 @@ var WebGLRenderer = new Class({
15241524
* @param {WebGLFramebuffer} framebuffer - The framebuffer that needs to be bound.
15251525
* @param {boolean} [updateScissor=false] - Set the gl scissor to match the frame buffer size? Or, if `null` given, pop the scissor from the stack.
15261526
* @param {boolean} [resetTextures=false] - Should the WebGL Textures be reset after the new framebuffer is bound?
1527+
* @param {boolean} [setViewport=true] - Should the WebGL viewport be set?
15271528
*
15281529
* @return {this} This WebGLRenderer instance.
15291530
*/
1530-
pushFramebuffer: function (framebuffer, updateScissor, resetTextures)
1531+
pushFramebuffer: function (framebuffer, updateScissor, resetTextures, setViewport)
15311532
{
15321533
if (framebuffer === this.currentFramebuffer)
15331534
{
@@ -1536,7 +1537,7 @@ var WebGLRenderer = new Class({
15361537

15371538
this.fboStack.push(framebuffer);
15381539

1539-
return this.setFramebuffer(framebuffer, updateScissor, resetTextures);
1540+
return this.setFramebuffer(framebuffer, updateScissor, resetTextures, setViewport);
15401541
},
15411542

15421543
/**
@@ -1572,7 +1573,7 @@ var WebGLRenderer = new Class({
15721573
var width = this.width;
15731574
var height = this.height;
15741575

1575-
if (framebuffer && framebuffer.renderTexture)
1576+
if (framebuffer && framebuffer.renderTexture && setViewport)
15761577
{
15771578
width = framebuffer.renderTexture.width;
15781579
height = framebuffer.renderTexture.height;

0 commit comments

Comments
 (0)