[Mesa-dev] [PATCH] meta: Set correct viewport in decompress_texture_image.

Kenneth Graunke kenneth at whitecape.org
Thu Aug 22 01:32:51 PDT 2013


_mesa_meta_begin() initializes the viewport based on the current
drawbuffer's width and height.  This is probably 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.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68250
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: Mak Nazecic-Andrlon <owlberteinstein at gmail.com>
---
 src/mesa/drivers/common/meta.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 1a42b05..ecb52b9 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -4022,6 +4022,8 @@ decompress_texture_image(struct gl_context *ctx,
    verts[3].x = 0.0F;
    verts[3].y = height;
 
+   _mesa_set_viewport(ctx, 0, 0, width, height);
+
    /* upload new vertex data */
    _mesa_BufferSubData(GL_ARRAY_BUFFER_ARB, 0, sizeof(verts), verts);
 
-- 
1.8.3.4



More information about the mesa-dev mailing list