summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/texobj.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2017-05-04 16:53:56 +1000
committerTimothy Arceri <[email protected]>2017-05-07 15:29:34 +1000
commitccf9669cc1c0d4a5b669d36ae981ebd5e5a196ae (patch)
treeca747c5e2718f94118e9dfae5aa7f800ec65368a /src/mesa/main/texobj.c
parent68cd0e200092b064c5964a02c137f5b98c96e5f0 (diff)
mesa: small texture targetIndex tidy up
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main/texobj.c')
-rw-r--r--src/mesa/main/texobj.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index af9baa976fc..868e4eb7a27 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -329,13 +329,13 @@ _mesa_initialize_texture_object( struct gl_context *ctx,
*/
static void
finish_texture_init(struct gl_context *ctx, GLenum target,
- struct gl_texture_object *obj)
+ struct gl_texture_object *obj, int targetIndex)
{
GLenum filter = GL_LINEAR;
assert(obj->Target == 0);
obj->Target = target;
- obj->TargetIndex = _mesa_tex_target_to_index(ctx, target);
+ obj->TargetIndex = targetIndex;
assert(obj->TargetIndex < NUM_TEXTURE_TARGETS);
switch (target) {
@@ -1649,13 +1649,12 @@ _mesa_BindTexture( GLenum target, GLuint texName )
{
GET_CURRENT_CONTEXT(ctx);
struct gl_texture_object *newTexObj = NULL;
- GLint targetIndex;
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
_mesa_debug(ctx, "glBindTexture %s %d\n",
_mesa_enum_to_string(target), (GLint) texName);
- targetIndex = _mesa_tex_target_to_index(ctx, target);
+ int targetIndex = _mesa_tex_target_to_index(ctx, target);
if (targetIndex < 0) {
_mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target = %s)",
_mesa_enum_to_string(target));
@@ -1684,7 +1683,7 @@ _mesa_BindTexture( GLenum target, GLuint texName )
return;
}
if (newTexObj->Target == 0) {
- finish_texture_init(ctx, target, newTexObj);
+ finish_texture_init(ctx, target, newTexObj, targetIndex);
}
}
else {