Mesa (master): svga: avoid ubinding render targets that have already been unbound

Brian Paul brianp at kemper.freedesktop.org
Fri Jul 15 20:38:02 UTC 2016


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

Author: Charmaine Lee <charmainel at vmware.com>
Date:   Mon Jul 11 17:11:41 2016 -0700

svga: avoid ubinding render targets that have already been unbound

Fixed the remaining redundant SetRenderTargets command emission.

Tested with lightsMark2008, Heaven, mtt piglit, glretrace, conform.

Reviewed-by: Brian Paul <brianp at vmware.com>

---

 src/gallium/drivers/svga/svga_state_framebuffer.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/svga/svga_state_framebuffer.c b/src/gallium/drivers/svga/svga_state_framebuffer.c
index 54f75a2..b1362a9 100644
--- a/src/gallium/drivers/svga/svga_state_framebuffer.c
+++ b/src/gallium/drivers/svga/svga_state_framebuffer.c
@@ -168,6 +168,7 @@ emit_fb_vgpu10(struct svga_context *svga)
    struct pipe_framebuffer_state *curr = &svga->curr.framebuffer;
    struct pipe_framebuffer_state *hw = &svga->state.hw_clear.framebuffer;
    const unsigned num_color = MAX2(curr->nr_cbufs, hw->nr_cbufs);
+   int last_rtv = -1;
    unsigned i;
    enum pipe_error ret = PIPE_OK;
 
@@ -187,6 +188,7 @@ emit_fb_vgpu10(struct svga_context *svga)
          }
 
          assert(svga_surface(rtv[i])->view_id != SVGA3D_INVALID_ID);
+         last_rtv = i;
       }
       else {
          rtv[i] = NULL;
@@ -213,7 +215,10 @@ emit_fb_vgpu10(struct svga_context *svga)
       if (ret != PIPE_OK)
          return ret;
 
-      svga->state.hw_draw.num_rendertargets = num_color;
+      /* number of render targets sent to the device, not including trailing
+       * unbound render targets.
+       */
+      svga->state.hw_draw.num_rendertargets = last_rtv + 1;
       svga->state.hw_draw.dsv = dsv;
       memcpy(svga->state.hw_draw.rtv, rtv, num_color * sizeof(rtv[0]));
     




More information about the mesa-commit mailing list