Mesa (master): mesa: Add helper functions for looking up multiple textures

Fredrik Höglund fredrik at kemper.freedesktop.org
Fri May 2 01:21:26 UTC 2014


Module: Mesa
Branch: master
Commit: b8ee235e721ffd2503f4e8114d38685d58a0ceae
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=b8ee235e721ffd2503f4e8114d38685d58a0ceae

Author: Fredrik Höglund <fredrik at kde.org>
Date:   Fri Jan 17 18:35:31 2014 +0100

mesa: Add helper functions for looking up multiple textures

Reviewed-by: Brian Paul <brianp at vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/mesa/main/texobj.c |   21 +++++++++++++++++++++
 src/mesa/main/texobj.h |    9 +++++++++
 2 files changed, 30 insertions(+)

diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 38be9ee..221746f 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -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
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index 25394b6..b1b7a30 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -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 );
 




More information about the mesa-commit mailing list