summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-09-20 11:48:57 -0600
committerBrian Paul <[email protected]>2011-09-20 20:17:42 -0600
commit9e414865a6716f688c7bce904d841f9ba16cd967 (patch)
treef0c7600e7dd08099418daae0f9794e47c13294ac /src/mesa/drivers/common
parent20b92c9d1ed8802cf0acb1c24884d0cef2bce10e (diff)
meta: use _mesa_set_enable(), fix decompress_texture_image()
Use _mesa_set_enable() to avoid a redudant context lookup. Need to disable the texture target in decompress_texture_image() so the unit isn't still enabled after glGetTexImage() returns. Arguably, the meta restore code should do this, but it doesn't. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/meta.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 82b072eeb8c..be1953ab2f9 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -3182,7 +3182,7 @@ decompress_texture_image(struct gl_context *ctx,
/* setup texture state */
_mesa_BindTexture(target, texObj->Name);
- _mesa_Enable(target);
+ _mesa_set_enable(ctx, target, GL_TRUE);
{
/* save texture object state */
@@ -3233,6 +3233,9 @@ decompress_texture_image(struct gl_context *ctx,
ctx->Pack.RowLength = destRowLength;
_mesa_ReadPixels(0, 0, width, height, destFormat, destType, dest);
+ /* disable texture unit */
+ _mesa_set_enable(ctx, target, GL_FALSE);
+
_mesa_meta_end(ctx);
/* restore fbo bindings */