diff options
author | Fredrik Höglund <[email protected]> | 2013-11-12 17:28:12 +0100 |
---|---|---|
committer | Fredrik Höglund <[email protected]> | 2014-05-02 02:53:25 +0200 |
commit | 4bd82720880bef34895f34ac8141d0d9246b2b6d (patch) | |
tree | d84a2a117882038956f8c0f404b240da90a61491 /src/mesa/main/texobj.c | |
parent | 6bf8ac846aeb8b6e53b4a3545ee5f8ce94055ae7 (diff) |
mesa: Add a _BoundTextures field in gl_texture_unit
This will be used by glBindTextures() when unbinding textures,
to avoid having to loop over all the targets.
Reviewed-by: Brian Paul <[email protected]>
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r-- | src/mesa/main/texobj.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 42d057c6ae3..a72b75317f9 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1102,6 +1102,7 @@ unbind_texobj_from_texunits(struct gl_context *ctx, _mesa_reference_texobj(&unit->CurrentTex[tex], ctx->Shared->DefaultTex[tex]); ASSERT(unit->CurrentTex[tex]); + unit->_BoundTextures &= ~(1 << tex); break; } } @@ -1359,6 +1360,11 @@ _mesa_BindTexture( GLenum target, GLuint texName ) ctx->Texture.CurrentUnit + 1); ASSERT(texUnit->CurrentTex[targetIndex]); + if (texName != 0) + texUnit->_BoundTextures |= (1 << targetIndex); + else + texUnit->_BoundTextures &= ~(1 << targetIndex); + /* Pass BindTexture call to device driver */ if (ctx->Driver.BindTexture) ctx->Driver.BindTexture(ctx, target, newTexObj); |