diff options
author | Brian Paul <brianp@vmware.com> | 2009-09-29 09:32:37 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2009-09-29 09:32:40 -0600 |
commit | 9b5541617fd16d4b1de474a766717edf72112d21 (patch) | |
tree | f23f059c68df6082934dbd910c074c5adea3faee | |
parent | 564df9dc5f6335eb8dc68f3c69cf054d2142663c (diff) |
mesa: work-around glXCopyContext() bug in _mesa_copy_texture_state()
See bug 24217.
-rw-r--r-- | src/mesa/main/texstate.c | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 861c5f37c4e1..8292d43eb6fe 100644 --- a/src/mesa/main/texstate.c +++ b/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); } } |