meta: Set correct viewport and projection in decompress_texture_image.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 22 Aug 2013 08:29:11 +0000 (01:29 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 23 Aug 2013 03:28:53 +0000 (20:28 -0700)
_mesa_meta_begin() sets up an orthographic project and initializes the
viewport based on the current drawbuffer's width and height.  This is
likely the window size, since it occurs before the meta operation binds
any temporary buffers.

decompress_texture_image needs the viewport to be the size of the image
it's trying to draw.  Otherwise, it may only draw part of the image.

v2: Actually set the projection properly too.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68250
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Mak Nazecic-Andrlon <owlberteinstein@gmail.com>
src/mesa/drivers/common/meta.c

index 1a42b057490e19d064709c21e5564d966b465a76..798efa680732062cc0f7fb8947f84a713d3641ac 100644 (file)
@@ -4022,6 +4022,11 @@ decompress_texture_image(struct gl_context *ctx,
    verts[3].x = 0.0F;
    verts[3].y = height;
 
+   _mesa_MatrixMode(GL_PROJECTION);
+   _mesa_LoadIdentity();
+   _mesa_Ortho(0.0, width, 0.0, height, -1.0, 1.0);
+   _mesa_set_viewport(ctx, 0, 0, width, height);
+
    /* upload new vertex data */
    _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);