aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/main/texstate.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-22 17:33:44 +0000
committermarha <marha@users.sourceforge.net>2009-12-22 17:33:44 +0000
commitb729d9e1cc1c60e415da24143cabcbaccb525ed7 (patch)
tree54fc81d1a046dc5ec6f4aa2a2d8a2ad015c423fd /mesalib/src/mesa/main/texstate.c
parent0695dfb71ca6fe132d15a4d0890e8a868183adf9 (diff)
downloadvcxsrv-b729d9e1cc1c60e415da24143cabcbaccb525ed7.tar.gz
vcxsrv-b729d9e1cc1c60e415da24143cabcbaccb525ed7.tar.bz2
vcxsrv-b729d9e1cc1c60e415da24143cabcbaccb525ed7.zip
Updated to mesa_7_6_1_rc1
Diffstat (limited to 'mesalib/src/mesa/main/texstate.c')
-rw-r--r--mesalib/src/mesa/main/texstate.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/mesalib/src/mesa/main/texstate.c b/mesalib/src/mesa/main/texstate.c
index 861c5f37c..8292d43eb 100644
--- a/mesalib/src/mesa/main/texstate.c
+++ b/mesalib/src/mesa/main/texstate.c
@@ -99,16 +99,22 @@ _mesa_copy_texture_state( const GLcontext *src, GLcontext *dst )
dst->Texture.Unit[u].BumpTarget = src->Texture.Unit[u].BumpTarget;
COPY_4V(dst->Texture.Unit[u].RotMatrix, src->Texture.Unit[u].RotMatrix);
+ /*
+ * XXX strictly speaking, we should compare texture names/ids and
+ * bind textures in the dest context according to id. For now, only
+ * copy bindings if the contexts share the same pool of textures to
+ * avoid refcounting bugs.
+ */
+ if (dst->Shared == src->Shared) {
+ /* copy texture object bindings, not contents of texture objects */
+ _mesa_lock_context_textures(dst);
- /* copy texture object bindings, not contents of texture objects */
- _mesa_lock_context_textures(dst);
-
- for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
- _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
- src->Texture.Unit[u].CurrentTex[tex]);
+ for (tex = 0; tex < NUM_TEXTURE_TARGETS; tex++) {
+ _mesa_reference_texobj(&dst->Texture.Unit[u].CurrentTex[tex],
+ src->Texture.Unit[u].CurrentTex[tex]);
+ }
+ _mesa_unlock_context_textures(dst);
}
-
- _mesa_unlock_context_textures(dst);
}
}