From 5e6b72bea946ac082014aa3b9d3242befc60c0e3 Mon Sep 17 00:00:00 2001 From: Subv Date: Fri, 4 Dec 2015 13:46:28 -0500 Subject: [PATCH] fixup --- src/video_core/rasterizer.cpp | 8 ++++---- src/video_core/renderer_opengl/gl_shader_gen.cpp | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/video_core/rasterizer.cpp b/src/video_core/rasterizer.cpp index 4249ae235..10ec818c2 100644 --- a/src/video_core/rasterizer.cpp +++ b/src/video_core/rasterizer.cpp @@ -393,10 +393,10 @@ static void ProcessTriangleInternal(const Shader::OutputVertex& v0, for (u16 x = min_x + 8; x < max_x; x += 0x10) { // Do not process the pixel if it's inside the scissor box and the scissor mode is set to Exclude - if (regs.scissor_test.mode == Regs::ScissorMode::Exclude) { - if (x >= scissor_x && x <= scissor_x + scissor_width && - y >= scissor_y && y <= scissor_y + scissor_height) - continue; + if (regs.scissor_test.mode == Regs::ScissorMode::Exclude && + x >= scissor_x && x <= scissor_x + scissor_width && + y >= scissor_y && y <= scissor_y + scissor_height) { + continue; } // Calculate the barycentric coordinates w0, w1 and w2 diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp index e2ca1867c..5c7b01c2c 100644 --- a/src/video_core/renderer_opengl/gl_shader_gen.cpp +++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp @@ -346,6 +346,12 @@ uniform sampler2D tex[3]; void main() { )"; + // Do not do any sort of processing if it's obvious we're not going to pass the alpha test + if (config.alpha_test_func == Regs::CompareFunc::Never) { + out += "discard; }"; + return out; + } + // Append the scissor test if (config.scissor_test_mode == Regs::ScissorMode::Include || config.scissor_test_mode == Regs::ScissorMode::Exclude) { out += "if (scissor_left <= scissor_right || scissor_top >= scissor_bottom) discard;\n"; @@ -356,12 +362,6 @@ void main() { out += "(gl_FragCoord.x >= scissor_right && gl_FragCoord.x <= scissor_left && gl_FragCoord.y >= scissor_top && gl_FragCoord.y <= scissor_bottom)) discard;\n"; } - // Do not do any sort of processing if it's obvious we're not going to pass the alpha test - if (config.alpha_test_func == Regs::CompareFunc::Never) { - out += "discard; }"; - return out; - } - out += "vec4 combiner_buffer = vec4(0.0);\n"; out += "vec4 next_combiner_buffer = tev_combiner_buffer_color;\n"; out += "vec4 last_tex_env_out = vec4(0.0);\n";