summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorKeith Whitwell <[email protected]>2007-08-10 12:57:14 +0100
committerKeith Whitwell <[email protected]>2007-08-10 12:58:26 +0100
commit5c2c05600081f811e001a81a600778de0fcab85d (patch)
treeba4e239592e9798ca3e660158c668afd7d145639 /src/mesa/pipe/softpipe
parent9ac1a8d416c2bd50ca10186ca09f5e86f6fa4ce6 (diff)
Handle glFlush/glFinish through the state tracker.
Diffstat (limited to 'src/mesa/pipe/softpipe')
-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
4 files changed, 29 insertions, 6 deletions
diff --git a/src/mesa/pipe/softpipe/sp_context.c b/src/mesa/pipe/softpipe/sp_context.c
index 0794d9a8880..db572f169d8 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 aa609469a62..a0bce200ed9 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 5e204f87a56..03c00106230 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 6f6d0f24461..73b06590671 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,