diff options
author | José Fonseca <[email protected]> | 2011-04-07 16:54:37 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2011-04-12 12:00:49 +0100 |
commit | 6b95cfb0de1bcd680679a20d6ecc32b42e5d1546 (patch) | |
tree | fb09be44e1bc379cf25aab685fdc8cdff7a570b8 /src/gallium/drivers/svga/svga_context.c | |
parent | e338a1b0cea94f8c57968b01eebd795c6c8ce74e (diff) |
svga: Rebind framebuffer and tss bindings strictly when necessary.
The earlier change to ensure rendertargets and textures are always
rebound at every command buffer start had the downside of making
successive flushes no longer no-ops, as a command buffer with merely
the rebinding commands were being unnecessarily sent to the vGPU.
This change only re-emits the bindings when necessary, by keeping track
of the need to rebind outside of the dirty state update mechanism.
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.c | 23 |
1 files changed, 4 insertions, 19 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index 4782b4bf70e..dbbc249258d 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -204,7 +204,6 @@ 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; @@ -219,25 +218,11 @@ void svga_context_flush( struct svga_context *svga, svga_screen_cache_flush(svgascreen, fence); - /* To force the reemission of rendertargets and texture bindings at - * the beginning of every command buffer. - */ - 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. + /* To force the re-emission of rendertargets and texture sampler bindings on + * the next command buffer. */ - 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; + svga->rebind.rendertargets = TRUE; + svga->rebind.texture_samplers = TRUE; if (SVGA_DEBUG & DEBUG_SYNC) { if (fence) |