From 5328d17090b249928e4614f4ef05ba4366745ce9 Mon Sep 17 00:00:00 2001 From: Jonas Kulla Date: Sun, 8 Dec 2013 12:23:12 +0100 Subject: [PATCH] Graphics: Fix viewport effect rendering bug We didn't account for the spec dictating that scissor test does affect FBO blit operations, which resulted in corrupted output if more than one viewport with an active effect (tone, color) was created. The reason I never caught this before must be that the fglrx-legacy driver is actually bugged in this aspect and ignores the scissor on blit. --- src/graphics.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/graphics.cpp b/src/graphics.cpp index b8c528d..3039ef5 100644 --- a/src/graphics.cpp +++ b/src/graphics.cpp @@ -175,7 +175,13 @@ public: void requestViewportRender(Vec4 &c, Vec4 &f, Vec4 &t) { pp.swapRender(); + + /* Scissor test _does_ affect FBO blit operations, + * and since we're inside the draw cycle, it will + * be turned on, so turn it off temporarily */ + glState.scissorTest.pushSet(false); pp.blitFBOs(); + glState.scissorTest.pop(); PlaneShader &shader = shState->planeShader(); shader.bind();