[Mesa-dev] [PATCH 04/41] main: Moved _mesa_lock_texture and _mesa_unlock_texture to texobj.h from teximage.h.

Laura Ekstrand laura at jlekstrand.net
Mon Dec 15 17:22:19 PST 2014


---
 src/mesa/drivers/dri/i965/intel_tex_copy.c |  1 +
 src/mesa/drivers/dri/swrast/swrast.c       |  1 +
 src/mesa/main/texgetimage.c                |  2 +-
 src/mesa/main/teximage.h                   | 18 ------------------
 src/mesa/main/texobj.h                     | 18 ++++++++++++++++++
 5 files changed, 21 insertions(+), 19 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/intel_tex_copy.c b/src/mesa/drivers/dri/i965/intel_tex_copy.c
index d55539a..5d249ed 100644
--- a/src/mesa/drivers/dri/i965/intel_tex_copy.c
+++ b/src/mesa/drivers/dri/i965/intel_tex_copy.c
@@ -28,6 +28,7 @@
 #include "main/mtypes.h"
 #include "main/enums.h"
 #include "main/image.h"
+#include "main/texobj.h"
 #include "main/teximage.h"
 #include "main/texstate.h"
 #include "main/fbobject.h"
diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
index e8a2c12..63ebcd9 100644
--- a/src/mesa/drivers/dri/swrast/swrast.c
+++ b/src/mesa/drivers/dri/swrast/swrast.c
@@ -52,6 +52,7 @@
 #include "drivers/common/meta.h"
 #include "utils.h"
 
+#include "main/texobj.h"
 #include "main/teximage.h"
 #include "main/texformat.h"
 #include "main/texstate.h"
diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index cb5f793..1c09337 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -45,7 +45,7 @@
 #include "texgetimage.h"
 #include "teximage.h"
 #include "texstore.h"
-
+#include "texobj.h"
 
 
 /**
diff --git a/src/mesa/main/teximage.h b/src/mesa/main/teximage.h
index 4b27381..f652b6c 100644
--- a/src/mesa/main/teximage.h
+++ b/src/mesa/main/teximage.h
@@ -160,24 +160,6 @@ _mesa_legal_texture_base_format_for_target(struct gl_context *ctx,
                                            unsigned dimensions,
                                            const char *caller);
 
-/**
- * Lock a texture for updating.  See also _mesa_lock_context_textures().
- */
-static inline void
-_mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
-{
-   mtx_lock(&ctx->Shared->TexMutex);
-   ctx->Shared->TextureStateStamp++;
-   (void) texObj;
-}
-
-static inline void
-_mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
-{
-   (void) texObj;
-   mtx_unlock(&ctx->Shared->TexMutex);
-}
-
 /*@}*/
 
 
diff --git a/src/mesa/main/texobj.h b/src/mesa/main/texobj.h
index abf03a1..b1534a1 100644
--- a/src/mesa/main/texobj.h
+++ b/src/mesa/main/texobj.h
@@ -93,6 +93,24 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
       _mesa_reference_texobj_(ptr, tex);
 }
 
+/**
+ * Lock a texture for updating.  See also _mesa_lock_context_textures().
+ */
+static inline void
+_mesa_lock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
+{
+   mtx_lock(&ctx->Shared->TexMutex);
+   ctx->Shared->TextureStateStamp++;
+   (void) texObj;
+}
+
+static inline void
+_mesa_unlock_texture(struct gl_context *ctx, struct gl_texture_object *texObj)
+{
+   (void) texObj;
+   mtx_unlock(&ctx->Shared->TexMutex);
+}
+
 
 /**
  * Return number of faces for a texture target.  This will be 6 for
-- 
2.1.0



More information about the mesa-dev mailing list