diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2013-08-22 01:29:11 -0700 |
---|---|---|
committer | Carl Worth <cworth@cworth.org> | 2013-10-04 14:12:50 -0700 |
commit | d227751144548e9e32c6d20dfb69287696e8f655 (patch) | |
tree | 1ed16664b9e5a722b6a7d634b3a8e57193253977 | |
parent | 8c753e01e4e2a9e78c6bbf831fb29619073597d8 (diff) | |
download | mesa-d227751144548e9e32c6d20dfb69287696e8f655.tar.gz |
meta: Set correct viewport and projection in decompress_texture_image.
_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>
(cherry picked from commit 62411681da4d1b7f9417f34dbf92a3e79e24dc09)
-rw-r--r-- | src/mesa/drivers/common/meta.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index 151da84d7ec..526c88f49cc 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -3956,6 +3956,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); |