diff options
author | Brian <[email protected]> | 2007-08-23 08:53:43 +0100 |
---|---|---|
committer | Brian <[email protected]> | 2007-08-23 08:53:43 +0100 |
commit | 4b654d41da08b3b5475144c027e97a3ae7ab5696 (patch) | |
tree | 2b19565434268fad9c767e6f39553fffafca7fcf /src/mesa/main/texstate.c | |
parent | dbef6158c6c19a28dc96a96357c9ed9bd9422b88 (diff) |
For _mesa_share_state(), update the context's references to the new share group's objects (Shane Blackett)
Diffstat (limited to 'src/mesa/main/texstate.c')
-rw-r--r-- | src/mesa/main/texstate.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c index 020e3eef4c0..288b334eaf6 100644 --- a/src/mesa/main/texstate.c +++ b/src/mesa/main/texstate.c @@ -3202,3 +3202,27 @@ _mesa_free_texture_data(GLcontext *ctx) _mesa_TexEnvProgramCacheDestroy( ctx ); } + + +/** + * Update the default texture objects in the given context to reference those + * specified in the shared state and release those referencing the old + * shared state. + */ +void +_mesa_update_default_objects_texture(GLcontext *ctx) +{ + GLuint i; + + for (i = 0; i < MAX_TEXTURE_UNITS; i++) { + struct gl_texture_unit *texUnit = &ctx->Texture.Unit[i]; + + _mesa_reference_texobj(&texUnit->Current1D, ctx->Shared->Default1D); + _mesa_reference_texobj(&texUnit->Current2D, ctx->Shared->Default2D); + _mesa_reference_texobj(&texUnit->Current3D, ctx->Shared->Default3D); + _mesa_reference_texobj(&texUnit->CurrentCubeMap, ctx->Shared->DefaultCubeMap); + _mesa_reference_texobj(&texUnit->CurrentRect, ctx->Shared->DefaultRect); + _mesa_reference_texobj(&texUnit->Current1DArray, ctx->Shared->Default1DArray); + _mesa_reference_texobj(&texUnit->Current2DArray, ctx->Shared->Default2DArray); + } +} |