Browse Source

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@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
tags/11.2-branchpoint
Brian Paul 9 years ago
parent
commit
fe14110f35
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      src/mesa/main/viewport.c

+ 2
- 2
src/mesa/main/viewport.c View File

@@ -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);

Loading…
Cancel
Save