summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2007-08-10 12:57:14 +0100
committerKeith Whitwell <keith@tungstengraphics.com>2007-08-10 12:58:26 +0100
commit5c2c05600081f811e001a81a600778de0fcab85d (patch)
treeba4e239592e9798ca3e660158c668afd7d145639 /src/mesa/pipe
parent9ac1a8d416c2bd50ca10186ca09f5e86f6fa4ce6 (diff)
Handle glFlush/glFinish through the state tracker.
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/i915simple/i915_flush.c5
-rw-r--r--src/mesa/pipe/i915simple/i915_winsys.h6
-rw-r--r--src/mesa/pipe/p_context.h6
-rw-r--r--src/mesa/pipe/softpipe/sp_context.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_flush.c19
-rw-r--r--src/mesa/pipe/softpipe/sp_flush.h2
-rw-r--r--src/mesa/pipe/softpipe/sp_winsys.h12
7 files changed, 42 insertions, 10 deletions
diff --git a/src/mesa/pipe/i915simple/i915_flush.c b/src/mesa/pipe/i915simple/i915_flush.c
index 1cf945e9a2..8af4ce770c 100644
--- a/src/mesa/pipe/i915simple/i915_flush.c
+++ b/src/mesa/pipe/i915simple/i915_flush.c
@@ -66,11 +66,10 @@ static void i915_flush( struct pipe_context *pipe,
FLUSH_BATCH();
}
-static void i915_finish(struct pipe_context *pipe)
+static void i915_wait_idle(struct pipe_context *pipe)
{
struct i915_context *i915 = i915_context(pipe);
- i915_flush( pipe, 0 );
i915->winsys->batch_wait_idle( i915->winsys );
}
@@ -78,5 +77,5 @@ static void i915_finish(struct pipe_context *pipe)
void i915_init_flush_functions( struct i915_context *i915 )
{
i915->pipe.flush = i915_flush;
- i915->pipe.finish = i915_finish;
+ i915->pipe.wait_idle = i915_wait_idle;
}
diff --git a/src/mesa/pipe/i915simple/i915_winsys.h b/src/mesa/pipe/i915simple/i915_winsys.h
index 9802148aa1..a3dadbfd3d 100644
--- a/src/mesa/pipe/i915simple/i915_winsys.h
+++ b/src/mesa/pipe/i915simple/i915_winsys.h
@@ -50,6 +50,12 @@ struct pipe_buffer_handle;
struct i915_winsys {
+ /* Do any special operations to ensure frontbuffer contents are
+ * displayed, eg copy fake frontbuffer.
+ */
+ void (*flush_frontbuffer)( struct i915_winsys *sws );
+
+
/* debug output
*/
void (*printf)( struct i915_winsys *sws,
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 7eb492816b..533840c555 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -220,10 +220,14 @@ struct pipe_context {
struct pipe_mipmap_tree *mt );
+ /* Simple flush/finish support:
+ */
void (*flush)( struct pipe_context *pipe,
unsigned flags );
- void (*finish)( struct pipe_context *pipe );
+ void (*wait_idle)( struct pipe_context *pipe );
+
+ void (*flush_frontbuffer)( struct pipe_context *pipe );
};
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 0794d9a888..db572f169d 100644
--- a/src/mesa/pipe/softpipe/sp_context.c
+++ b/src/mesa/pipe/softpipe/sp_context.c
@@ -221,7 +221,7 @@ struct pipe_context *softpipe_create( struct softpipe_winsys *sws )
softpipe->pipe.draw_vertices = softpipe_draw_vertices;
softpipe->pipe.clear = softpipe_clear;
softpipe->pipe.flush = softpipe_flush;
- softpipe->pipe.finish = softpipe_finish;
+ softpipe->pipe.wait_idle = softpipe_wait_idle;
softpipe->pipe.reset_occlusion_counter = softpipe_reset_occlusion_counter;
softpipe->pipe.get_occlusion_counter = softpipe_get_occlusion_counter;
diff --git a/src/mesa/pipe/softpipe/sp_flush.c b/src/mesa/pipe/softpipe/sp_flush.c
index aa609469a6..a0bce200ed 100644
--- a/src/mesa/pipe/softpipe/sp_flush.c
+++ b/src/mesa/pipe/softpipe/sp_flush.c
@@ -33,6 +33,7 @@
#include "pipe/p_defines.h"
#include "sp_flush.h"
#include "sp_context.h"
+#include "sp_winsys.h"
/* There will be actual work to do here. In future we may want a
* fence-like interface instead of finish, and perhaps flush will take
@@ -49,9 +50,21 @@ softpipe_flush( struct pipe_context *pipe,
}
void
-softpipe_finish(struct pipe_context *pipe)
+softpipe_wait_idle(struct pipe_context *pipe)
{
- /* Just calls into flush()
+ /* Nothing to do.
+ * XXX: What about swapbuffers.
+ * XXX: Even more so - what about fake frontbuffer copies??
*/
- softpipe_flush( pipe, 0 );
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+ softpipe->winsys->wait_idle( softpipe->winsys );
+}
+
+
+void
+softpipe_flush_frontbuffer( struct pipe_context *pipe )
+{
+ struct softpipe_context *softpipe = softpipe_context(pipe);
+
+ softpipe->winsys->flush_frontbuffer( softpipe->winsys );
}
diff --git a/src/mesa/pipe/softpipe/sp_flush.h b/src/mesa/pipe/softpipe/sp_flush.h
index 5e204f87a5..03c0010623 100644
--- a/src/mesa/pipe/softpipe/sp_flush.h
+++ b/src/mesa/pipe/softpipe/sp_flush.h
@@ -30,7 +30,7 @@
struct pipe_context;
-void softpipe_finish(struct pipe_context *pipe);
void softpipe_flush(struct pipe_context *pipe, unsigned flags );
+void softpipe_wait_idle(struct pipe_context *pipe);
#endif
diff --git a/src/mesa/pipe/softpipe/sp_winsys.h b/src/mesa/pipe/softpipe/sp_winsys.h
index 6f6d0f2446..73b0659067 100644
--- a/src/mesa/pipe/softpipe/sp_winsys.h
+++ b/src/mesa/pipe/softpipe/sp_winsys.h
@@ -50,9 +50,19 @@ struct pipe_buffer_handle;
struct softpipe_winsys {
+ /* Do any special operations to ensure frontbuffer contents are
+ * displayed, eg copy fake frontbuffer.
+ */
+ void (*flush_frontbuffer)( struct softpipe_winsys *sws );
+
+ /* Wait for any hw swapbuffers, etc. to finish:
+ */
+ void (*wait_idle)( struct softpipe_winsys *sws );
+
/* debug output
*/
- void (*printf)( const char *, ... );
+ void (*printf)( struct softpipe_winsys *sws,
+ const char *, ... );
/* The buffer manager is modeled after the dri_bugmgr interface,