Mesa (master): svga: if svga_update_state() fails, skip the draw call

Brian Paul brianp at kemper.freedesktop.org
Fri Mar 2 19:31:58 UTC 2018


Module: Mesa
Branch: master
Commit: 72df3a7a3957a13c4a667ffb2295ced7b91e5620
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=72df3a7a3957a13c4a667ffb2295ced7b91e5620

Author: Brian Paul <brianp at vmware.com>
Date:   Wed Feb 21 13:57:39 2018 -0700

svga: if svga_update_state() fails, skip the draw call

If svga_update_state() fails, we flush the command buffer and retry.
If it fails again, it likely means we were unable to translate a shader
for some reason (uses too many resources, for example).  In that case,
let's just skip the draw call.  The alternative, just disabling the
shader stage in question, would certainly lead to bad rendering anyway,
and probably device errors.

Fixes failed assertion running Piglit glsl-1.50/execution/
variable-indexing/gs-output-array-vec4-index-wr.shader_test since it
uses too many GS output registers (though the test still fails).
VMware bug 2063492.

v2: also call pipe_debug_message() so apps or apitrace can be notified
when this issue occurs.
v3: use svga_update_state_retry().

Reviewed-by: Charmaine Lee <charmainel at vmware.com>
Reviewed-by: Neha Bhende <bhenden at vmware.com>

---

 src/gallium/drivers/svga/svga_pipe_draw.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/svga/svga_pipe_draw.c b/src/gallium/drivers/svga/svga_pipe_draw.c
index c73c406e69..ace1d2cb6f 100644
--- a/src/gallium/drivers/svga/svga_pipe_draw.c
+++ b/src/gallium/drivers/svga/svga_pipe_draw.c
@@ -203,11 +203,11 @@ svga_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
       ret = svga_swtnl_draw_vbo(svga, info, indexbuf, index_offset);
    }
    else {
-      ret = svga_update_state(svga, SVGA_STATE_HW_DRAW);
-      if (ret != PIPE_OK) {
-         svga_context_flush(svga, NULL);
-         ret = svga_update_state(svga, SVGA_STATE_HW_DRAW);
-         assert(ret == PIPE_OK);
+      if (!svga_update_state_retry(svga, SVGA_STATE_HW_DRAW)) {
+         static const char *msg = "State update failed, skipping draw call";
+         debug_printf("%s\n", msg);
+         pipe_debug_message(&svga->debug.callback, INFO, "%s", msg);
+         goto done;
       }
 
       svga_hwtnl_set_fillmode(svga->hwtnl, svga->curr.rast->hw_fillmode);




More information about the mesa-commit mailing list