}
}
+/**
+ * Light-weight bind texture for internal users
+ *
+ * This is really just \c finish_texture_init plus \c bind_texture_object.
+ * This is intended to be used by internal Mesa functions that use
+ * \c _mesa_CreateTexture and need to bind textures (e.g., meta).
+ */
+void
+_mesa_bind_texture(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *tex_obj)
+{
+ const GLint targetIndex = _mesa_tex_target_to_index(ctx, target);
+
+ assert(targetIndex >= 0 && targetIndex < NUM_TEXTURE_TARGETS);
+
+ if (tex_obj->Target == 0)
+ finish_texture_init(ctx, target, tex_obj, targetIndex);
+
+ assert(tex_obj->Target == target);
+ assert(tex_obj->TargetIndex == targetIndex);
+
+ bind_texture_object(ctx, ctx->Texture.CurrentUnit, tex_obj);
+}
/**
* Implement glBindTexture(). Do error checking, look-up or create a new
bind_texture_object(ctx, ctx->Texture.CurrentUnit, newTexObj);
}
-
void GLAPIENTRY
_mesa_BindTexture_no_error(GLenum target, GLuint texName)
{
_mesa_delete_nameless_texture(struct gl_context *ctx,
struct gl_texture_object *texObj);
-
+extern void
+_mesa_bind_texture(struct gl_context *ctx, GLenum target,
+ struct gl_texture_object *tex_obj);
/*@}*/
/**