summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-11-07 16:59:37 -0700
committerBrian <[email protected]>2007-11-07 16:59:37 -0700
commitae44a81d1bd40852a7cea9b8025dfa3821adc785 (patch)
treed1e0b635f17abbe2f82687701d9802755241cf18 /src/mesa/pipe
parent10c62bf0683437672c83339138a6802d56aeca8f (diff)
New PIPE_FLUSH_WAIT flag for pipe->flush().
The state tracker doesn't have to directly call winsys->wait_idle() anymore. glFlush and glFinish both go through pipe->flush() now.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/i915simple/i915_flush.c6
-rw-r--r--src/mesa/pipe/p_defines.h3
2 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/pipe/i915simple/i915_flush.c b/src/mesa/pipe/i915simple/i915_flush.c
index 9c2adf87637..5a80ed5e2f5 100644
--- a/src/mesa/pipe/i915simple/i915_flush.c
+++ b/src/mesa/pipe/i915simple/i915_flush.c
@@ -47,7 +47,7 @@ static void i915_flush( struct pipe_context *pipe,
/* Do we need to emit an MI_FLUSH command to flush the hardware
* caches?
*/
- if (flags) {
+ if (flags & (PIPE_FLUSH_RENDER_CACHE | PIPE_FLUSH_TEXTURE_CACHE)) {
unsigned flush = MI_FLUSH;
if (!(flags & PIPE_FLUSH_RENDER_CACHE))
@@ -67,6 +67,10 @@ static void i915_flush( struct pipe_context *pipe,
/* If there are no flags, just flush pending commands to hardware:
*/
FLUSH_BATCH();
+
+ if (flags & PIPE_FLUSH_WAIT) {
+ i915->pipe.winsys->wait_idle(i915->pipe.winsys, i915->pipe.private);
+ }
}
diff --git a/src/mesa/pipe/p_defines.h b/src/mesa/pipe/p_defines.h
index ca9929bfeec..6b5881b64db 100644
--- a/src/mesa/pipe/p_defines.h
+++ b/src/mesa/pipe/p_defines.h
@@ -187,8 +187,9 @@
/**
* Flush types:
*/
-#define PIPE_FLUSH_RENDER_CACHE 0x1
+#define PIPE_FLUSH_RENDER_CACHE 0x1
#define PIPE_FLUSH_TEXTURE_CACHE 0x2
+#define PIPE_FLUSH_WAIT 0x4
/**