Module: Mesa
Branch: gallium-0.1
Commit: bce0203909a8d1e7a6788166633999197d6f2106
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=bce0203909a8d1e7a6788166633999197d6f2106

Author: José Fonseca <[email protected]>
Date:   Mon Oct 12 19:56:51 2009 +0100

gallium: Backport is_texture/buffer_referenced.

---

 src/gallium/include/pipe/p_context.h |   27 +++++++++++++++++++++++++++
 src/gallium/include/pipe/p_defines.h |    8 ++++++++
 2 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/src/gallium/include/pipe/p_context.h 
b/src/gallium/include/pipe/p_context.h
index 2646706..d03d966 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -216,6 +216,33 @@ struct pipe_context {
    void (*flush)( struct pipe_context *pipe,
                   unsigned flags,
                   struct pipe_fence_handle **fence );
+
+   /**
+    * Check whether a texture is referenced by an unflushed hw command.
+    * The state-tracker uses this function to optimize away unnecessary
+    * flushes. It is safe (but wasteful) to always return.
+    * PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE.
+    * \param pipe  The pipe context whose unflushed hw commands will be
+    *              checked.
+    * \param level  mipmap level.
+    * \param texture  texture to check.
+    * \param face  cubemap face. Use 0 for non-cubemap texture.
+    */
+   unsigned int (*is_texture_referenced) (struct pipe_context *pipe,
+                                          struct pipe_texture *texture,
+                                          unsigned face, unsigned level);
+
+   /**
+    * Check whether a buffer is referenced by an unflushed hw command.
+    * The state-tracker uses this function to optimize away unnecessary
+    * flushes. It is safe (but wasteful) to always return
+    * PIPE_REFERENCED_FOR_READ | PIPE_REFERENCED_FOR_WRITE.
+    * \param pipe  The pipe context whose unflushed hw commands will be
+    *              checked.
+    * \param buf  Buffer to check.
+    */
+   unsigned int (*is_buffer_referenced) (struct pipe_context *pipe,
+                                         struct pipe_buffer *buf);
 };
 
 
diff --git a/src/gallium/include/pipe/p_defines.h 
b/src/gallium/include/pipe/p_defines.h
index 284ebe0..034e651 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -296,6 +296,14 @@ enum pipe_texture_target {
 #define PIPE_CAP_TEXTURE_MIRROR_REPEAT   25
 
 
+/**
+ * Referenced query flags.
+ */
+
+#define PIPE_UNREFERENCED         0
+#define PIPE_REFERENCED_FOR_READ  (1 << 0)
+#define PIPE_REFERENCED_FOR_WRITE (1 << 1)
+
 
 #ifdef __cplusplus
 }

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to