mesa: Add helper functions for looking up multiple textures

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Fredrik Höglund 2014-01-17 18:35:31 +01:00
parent b16e2ada4c
commit b8ee235e72
2 changed files with 30 additions and 0 deletions

View File

@ -61,6 +61,27 @@ _mesa_lookup_texture(struct gl_context *ctx, GLuint id)
}
void
_mesa_begin_texture_lookups(struct gl_context *ctx)
{
_mesa_HashLockMutex(ctx->Shared->TexObjects);
}
void
_mesa_end_texture_lookups(struct gl_context *ctx)
{
_mesa_HashUnlockMutex(ctx->Shared->TexObjects);
}
struct gl_texture_object *
_mesa_lookup_texture_locked(struct gl_context *ctx, GLuint id)
{
return (struct gl_texture_object *)
_mesa_HashLookupLocked(ctx->Shared->TexObjects, id);
}
/**
* Allocate and initialize a new texture object. But don't put it into the

View File

@ -46,6 +46,15 @@
extern struct gl_texture_object *
_mesa_lookup_texture(struct gl_context *ctx, GLuint id);
extern void
_mesa_begin_texture_lookups(struct gl_context *ctx);
extern void
_mesa_end_texture_lookups(struct gl_context *ctx);
extern struct gl_texture_object *
_mesa_lookup_texture_locked(struct gl_context *ctx, GLuint id);
extern struct gl_texture_object *
_mesa_new_texture_object( struct gl_context *ctx, GLuint name, GLenum target );