diff options
author | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-10 12:57:14 +0100 |
---|---|---|
committer | Keith Whitwell <keith@tungstengraphics.com> | 2007-08-10 12:58:26 +0100 |
commit | 5c2c05600081f811e001a81a600778de0fcab85d (patch) | |
tree | ba4e239592e9798ca3e660158c668afd7d145639 /src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c | |
parent | 9ac1a8d416c2bd50ca10186ca09f5e86f6fa4ce6 (diff) |
Handle glFlush/glFinish through the state tracker.
Diffstat (limited to 'src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c')
-rw-r--r-- | src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c b/src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c index 06db5c9f43..439bb372e1 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_pipe_softpipe.c @@ -36,6 +36,8 @@ #include "intel_context.h" #include "intel_pipe.h" +#include "intel_batchbuffer.h" +#include "intel_blit.h" #include "pipe/softpipe/sp_winsys.h" #include "pipe/p_defines.h" @@ -175,6 +177,33 @@ intel_supported_formats(struct pipe_context *pipe, GLuint *numFormats) } +static void intel_wait_idle( struct softpipe_winsys *sws ) +{ + struct intel_context *intel = intel_softpipe_winsys(sws)->intel; + + if (intel->batch->last_fence) { + driFenceFinish(intel->batch->last_fence, + DRM_FENCE_TYPE_EXE | DRM_I915_FENCE_TYPE_RW, GL_FALSE); + driFenceUnReference(intel->batch->last_fence); + intel->batch->last_fence = NULL; + } +} + + +/* The state tracker (should!) keep track of whether the fake + * frontbuffer has been touched by any rendering since the last time + * we copied its contents to the real frontbuffer. Our task is easy: + */ +static void +intel_flush_frontbuffer( struct softpipe_winsys *sws ) +{ + struct intel_context *intel = intel_softpipe_winsys(sws)->intel; + __DRIdrawablePrivate *dPriv = intel->driDrawable; + + intelCopyBuffer(dPriv, NULL); +} + + struct pipe_context * intel_create_softpipe( struct intel_context *intel ) @@ -197,6 +226,8 @@ intel_create_softpipe( struct intel_context *intel ) isws->sws.buffer_data = intel_buffer_data; isws->sws.buffer_subdata = intel_buffer_subdata; isws->sws.buffer_get_subdata = intel_buffer_get_subdata; + isws->sws.flush_frontbuffer = intel_flush_frontbuffer; + isws->sws.wait_idle = intel_wait_idle; isws->intel = intel; /* Create the softpipe context: |