summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_opengl/gl_shader_gen.cpp
diff options
context:
space:
mode:
authorYuri Kunde Schlesner <yuriks@yuriks.net>2016-09-30 06:08:32 +0200
committerGitHub <noreply@github.com>2016-09-30 06:08:32 +0200
commit4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a (patch)
treef8a9a0ec07221758b50b952ba58ab0ea28b459a2 /src/video_core/renderer_opengl/gl_shader_gen.cpp
parentMerge pull request #2100 from wwylele/fix-load-assert (diff)
parentOpenGL: Take cached viewport sub-rect into account for scissor (diff)
downloadyuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.tar
yuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.tar.gz
yuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.tar.bz2
yuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.tar.lz
yuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.tar.xz
yuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.tar.zst
yuzu-4b14e17b18e20f7f8077f0c7efc0e3a44ca8ca2a.zip
Diffstat (limited to 'src/video_core/renderer_opengl/gl_shader_gen.cpp')
-rw-r--r--src/video_core/renderer_opengl/gl_shader_gen.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/video_core/renderer_opengl/gl_shader_gen.cpp b/src/video_core/renderer_opengl/gl_shader_gen.cpp
index 1808ee0a9..8f278722d 100644
--- a/src/video_core/renderer_opengl/gl_shader_gen.cpp
+++ b/src/video_core/renderer_opengl/gl_shader_gen.cpp
@@ -645,11 +645,10 @@ vec4 secondary_fragment_color = vec4(0.0);
// Negate the condition if we have to keep only the pixels outside the scissor box
if (state.scissor_test_mode == Regs::ScissorMode::Include)
out += "!";
- // x2,y2 have +1 added to cover the entire pixel area
- out += "(gl_FragCoord.x >= scissor_x1 * framebuffer_scale.x && "
- "gl_FragCoord.y >= scissor_y1 * framebuffer_scale.y && "
- "gl_FragCoord.x < (scissor_x2 + 1) * framebuffer_scale.x && "
- "gl_FragCoord.y < (scissor_y2 + 1) * framebuffer_scale.y)) discard;\n";
+ out += "(gl_FragCoord.x >= scissor_x1 && "
+ "gl_FragCoord.y >= scissor_y1 && "
+ "gl_FragCoord.x < scissor_x2 && "
+ "gl_FragCoord.y < scissor_y2)) discard;\n";
}
out += "float z_over_w = 1.0 - gl_FragCoord.z * 2.0;\n";