summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/viewport.c
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2016-02-09 09:58:39 -0700
committerBrian Paul <[email protected]>2016-02-09 11:27:48 -0700
commitfe14110f359b0665cb0c09aa14f13a5ebb33b1bc (patch)
treeab96a6369db77867a077e937a4edeed8f54c4b72 /src/mesa/main/viewport.c
parent0193e20df531039e89de089bdb33abd4e2095e19 (diff)
mesa: fix incorrect viewport position when GL_CLIP_ORIGIN = GL_LOWER_LEFT
Ilia Mirkin found/fixed the mistake. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93813 Cc: "11.1" <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
Diffstat (limited to 'src/mesa/main/viewport.c')
-rw-r--r--src/mesa/main/viewport.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 7d8914291c3..681e46bfcf7 100644
--- a/src/mesa/main/viewport.c
+++ b/src/mesa/main/viewport.c
@@ -456,11 +456,11 @@ _mesa_get_viewport_xform(struct gl_context *ctx, unsigned i,
translate[0] = half_width + x;
if (ctx->Transform.ClipOrigin == GL_UPPER_LEFT) {
scale[1] = -half_height;
- translate[1] = half_height - y;
} else {
scale[1] = half_height;
- translate[1] = half_height + y;
}
+ translate[1] = half_height + y;
+
if (ctx->Transform.ClipDepthMode == GL_NEGATIVE_ONE_TO_ONE) {
scale[2] = 0.5 * (f - n);
translate[2] = 0.5 * (n + f);