meta: Use NDC in decompress_texture_image
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 13 Dec 2013 22:12:09 +0000 (14:12 -0800)
committerIan Romanick <ian.d.romanick@intel.com>
Sun, 2 Feb 2014 15:49:09 +0000 (16:49 +0100)
There is no need to use pixel coordinates, and using NDC directly will
simplify the GLSL paths.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/drivers/common/meta.c

index 3479eb16d6ff2c6a1c22ef4440fd0fbd1a450fa5..1d870d2980f42a7efb21eb5905c1e450bbcb2d52 100644 (file)
@@ -4108,18 +4108,17 @@ decompress_texture_image(struct gl_context *ctx,
                         verts[3].tex);
 
    /* setup vertex positions */
-   verts[0].x = 0.0F;
-   verts[0].y = 0.0F;
-   verts[1].x = width;
-   verts[1].y = 0.0F;
-   verts[2].x = width;
-   verts[2].y = height;
-   verts[3].x = 0.0F;
-   verts[3].y = height;
+   verts[0].x = -1.0F;
+   verts[0].y = -1.0F;
+   verts[1].x =  1.0F;
+   verts[1].y = -1.0F;
+   verts[2].x =  1.0F;
+   verts[2].y =  1.0F;
+   verts[3].x = -1.0F;
+   verts[3].y =  1.0F;
 
    _mesa_MatrixMode(GL_PROJECTION);
    _mesa_LoadIdentity();
-   _mesa_Ortho(0.0, width, 0.0, height, -1.0, 1.0);
    _mesa_set_viewport(ctx, 0, 0, 0, width, height);
 
    /* upload new vertex data */