summaryrefslogtreecommitdiff
path: root/src/gallium/include/pipe/p_context.h
diff options
context:
space:
mode:
authorThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-15 15:53:34 +0200
committerThomas Hellstrom <thellstrom-at-vmware-dot-com>2009-04-15 17:16:58 +0200
commit9b75627fab5bf2ea90f27ddd31b60c54895f6de6 (patch)
treeb748494fcd35bde9b8684742dc0b7ba0958acfcb /src/gallium/include/pipe/p_context.h
parentf94053eb7d3f129e5086f6dc431a13f83c93a189 (diff)
gallium: Make sure we flush before some texture / buffer operations.
Also implement context member functions to optimize away those flushes whenever possible. Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
Diffstat (limited to 'src/gallium/include/pipe/p_context.h')
-rw-r--r--src/gallium/include/pipe/p_context.h29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/gallium/include/pipe/p_context.h b/src/gallium/include/pipe/p_context.h
index c5c839799e..57e966ac3b 100644
--- a/src/gallium/include/pipe/p_context.h
+++ b/src/gallium/include/pipe/p_context.h
@@ -42,7 +42,6 @@ struct pipe_state_cache;
struct pipe_query;
struct pipe_winsys;
-
/**
* Gallium rendering context. Basically:
* - state setting functions
@@ -231,6 +230,34 @@ 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);
};