summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga/svga_context.c
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2011-02-23 13:32:37 +0000
committerJosé Fonseca <[email protected]>2011-02-24 14:00:13 +0000
commit369ece170257ef687ca609cacd1d66d186274eb3 (patch)
treefb5cee238c2e4584f234f7253b569bd15dc44ea0 /src/gallium/drivers/svga/svga_context.c
parentf19439940c43aa9d937716c6f1ee70cc26799e08 (diff)
svga: Ensure rendertargets and textures are always rebound at every command buffer start.
The svga_update_state() mechanism is inadequate as it will always end up flushing the primitives before processing the SVGA_NEW_COMMAND_BUFFER dirty state flag.
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.c')
-rw-r--r--src/gallium/drivers/svga/svga_context.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c
index 9b737a187e7..f0f875b2b23 100644
--- a/src/gallium/drivers/svga/svga_context.c
+++ b/src/gallium/drivers/svga/svga_context.c
@@ -204,6 +204,7 @@ void svga_context_flush( struct svga_context *svga,
{
struct svga_screen *svgascreen = svga_screen(svga->pipe.screen);
struct pipe_fence_handle *fence = NULL;
+ enum pipe_error ret;
svga->curr.nr_fbs = 0;
@@ -223,6 +224,21 @@ void svga_context_flush( struct svga_context *svga,
*/
svga->dirty |= SVGA_NEW_COMMAND_BUFFER;
+ /*
+ * We must reemit the surface bindings here, because svga_update_state
+ * will always flush the primitives before processing the
+ * SVGA_NEW_COMMAND_BUFFER state change.
+ *
+ * TODO: Refactor this.
+ */
+ ret = svga_reemit_framebuffer_bindings(svga);
+ assert(ret == PIPE_OK);
+
+ ret = svga_reemit_tss_bindings(svga);
+ assert(ret == PIPE_OK);
+
+ svga->dirty &= ~SVGA_NEW_COMMAND_BUFFER;
+
if (SVGA_DEBUG & DEBUG_SYNC) {
if (fence)
svga->pipe.screen->fence_finish( svga->pipe.screen, fence, 0);