diff options
author | Brian Paul <[email protected]> | 2009-09-29 09:46:49 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-09-29 09:46:49 -0600 |
commit | 124f5875eae0b914d5c679fec6b25633907ad843 (patch) | |
tree | fcacb16e4b09a320130eb23d1d20662f1f380a62 /src/mesa/main/texstate.c | |
parent | 170bd0c8827f6f65c7bfa5a7fb68ba0678ed57ba (diff) | |
parent | 69a3043f4109463f35e87102e509e0a4599cd09a (diff) |
Merge branch 'mesa_7_6_branch'
Conflicts:
Makefile
configs/default
docs/relnotes.html
src/gallium/drivers/softpipe/sp_context.c
src/gallium/drivers/softpipe/sp_tile_cache.c
src/mesa/main/version.h
Diffstat (limited to 'src/mesa/main/texstate.c')
-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 b9311d0ffc9..43f26873e0f 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -97,16 +97,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); } } |