diff options
-rw-r--r-- | src/gallium/drivers/svga/svga_state.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/svga/svga_state.h | 4 |
2 files changed, 9 insertions, 6 deletions
diff --git a/src/gallium/drivers/svga/svga_state.c b/src/gallium/drivers/svga/svga_state.c index 9ca6a18e0f0..dad78389a23 100644 --- a/src/gallium/drivers/svga/svga_state.c +++ b/src/gallium/drivers/svga/svga_state.c @@ -237,19 +237,24 @@ done: } -void +/** + * Update state. If the first attempt fails, flush the command buffer + * and retry. + * \return true if success, false if second attempt fails. + */ +bool svga_update_state_retry(struct svga_context *svga, unsigned max_level) { enum pipe_error ret; ret = svga_update_state( svga, max_level ); - if (ret == PIPE_ERROR_OUT_OF_MEMORY) { + if (ret != PIPE_OK) { svga_context_flush(svga, NULL); ret = svga_update_state( svga, max_level ); } - assert( ret == PIPE_OK ); + return ret == PIPE_OK; } diff --git a/src/gallium/drivers/svga/svga_state.h b/src/gallium/drivers/svga/svga_state.h index 04b20e161fe..d75617860e6 100644 --- a/src/gallium/drivers/svga/svga_state.h +++ b/src/gallium/drivers/svga/svga_state.h @@ -91,9 +91,7 @@ extern struct svga_tracked_state svga_update_swtnl_vdecl; enum pipe_error svga_update_state( struct svga_context *svga, unsigned level ); -void svga_update_state_retry( struct svga_context *svga, - unsigned level ); - +bool svga_update_state_retry(struct svga_context *svga, unsigned level); enum pipe_error svga_emit_initial_state( struct svga_context *svga ); |