Mesa (master): mesa: fix incorrect viewport position when GL_CLIP_ORIGIN = GL_LOWER_LEFT

Brian Paul brianp at kemper.freedesktop.org
Tue Feb 9 18:36:44 UTC 2016


Module: Mesa
Branch: master
Commit: fe14110f359b0665cb0c09aa14f13a5ebb33b1bc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=fe14110f359b0665cb0c09aa14f13a5ebb33b1bc

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Feb  9 09:58:39 2016 -0700

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" <mesa-stable at lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca at vmware.com>
Reviewed-by: Roland Scheidegger <sroland at vmware.com>

---

 src/mesa/main/viewport.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
index 7d891429..681e46b 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);




More information about the mesa-commit mailing list