summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_cb_texture.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-08-26 02:15:22 +0800
committerChia-I Wu <olv@lunarg.com>2010-08-26 16:40:01 +0800
commit0f74efdef05c5c27b3137163d795dc91f34cc114 (patch)
treec5ce01726a21e8c5952f442da73543bdaf75d1c9 /src/mesa/state_tracker/st_cb_texture.c
parent4f6faf65d124bd690c4526f4c8e95de4d041601f (diff)
st/mesa: Fix glEGLImageTargetTexture2DOES.
stObj->pt should be set in st_bind_surface, just as in st_TexImage. On the other hand, st_TexImage should unreference stObj->pt. It also needs to initialize the texture image again as _mesa_clear_texture_object clears the image.
Diffstat (limited to 'src/mesa/state_tracker/st_cb_texture.c')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index a41c780d6e..9eb14033ee 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -548,6 +548,14 @@ st_TexImage(GLcontext * ctx,
/* switch to "normal" */
if (stObj->surface_based) {
_mesa_clear_texture_object(ctx, texObj);
+ pipe_resource_reference(&stObj->pt, NULL);
+
+ /* oops, need to init this image again */
+ _mesa_init_teximage_fields(ctx, target, texImage,
+ width, height, depth, border, internalFormat);
+ _mesa_choose_texture_format(ctx, texObj, texImage, target, level,
+ internalFormat, format, type);
+
stObj->surface_based = GL_FALSE;
}