Mesa (master): swr: call swr_update_derived unconditionally when drawing/ clearing

Ilia Mirkin imirkin at kemper.freedesktop.org
Tue Nov 22 02:12:43 UTC 2016


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

Author: Ilia Mirkin <imirkin at alum.mit.edu>
Date:   Sun Nov 20 00:04:42 2016 -0500

swr: call swr_update_derived unconditionally when drawing/clearing

Currently a sequence like draw/map/draw/map will cause the second map to
not wait for the second draw. This is because the first map will clear
the resource business bit, and the second draw won't reset it since no
state has changed.

swr_update_derived does a tiny bit of extra work, including updating the
SWR_BACKEND_STATE as well as waiting for prending fences. If that's a
problem, we could call swr_update_resource_status directly from
draw/clear handlers.

Fixes clearbuffer-stencil, clearbuffer-depth, clearbuffer-depth-stencil,
and clearbuffer-display-lists.

Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Bruce Cherniak <bruce.cherniak at intel.com>

---

 src/gallium/drivers/swr/swr_clear.cpp | 3 +--
 src/gallium/drivers/swr/swr_draw.cpp  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/gallium/drivers/swr/swr_clear.cpp b/src/gallium/drivers/swr/swr_clear.cpp
index 0101b4b..ff3eca8 100644
--- a/src/gallium/drivers/swr/swr_clear.cpp
+++ b/src/gallium/drivers/swr/swr_clear.cpp
@@ -39,8 +39,7 @@ swr_clear(struct pipe_context *pipe,
    if (!swr_check_render_cond(pipe))
       return;
 
-   if (ctx->dirty)
-      swr_update_derived(pipe);
+   swr_update_derived(pipe);
 
    if (buffers & PIPE_CLEAR_COLOR && fb->nr_cbufs) {
       for (unsigned i = 0; i < fb->nr_cbufs; ++i)
diff --git a/src/gallium/drivers/swr/swr_draw.cpp b/src/gallium/drivers/swr/swr_draw.cpp
index 39378e6..920ca9f 100644
--- a/src/gallium/drivers/swr/swr_draw.cpp
+++ b/src/gallium/drivers/swr/swr_draw.cpp
@@ -90,8 +90,7 @@ swr_draw_vbo(struct pipe_context *pipe, const struct pipe_draw_info *info)
    }
 
    /* Update derived state, pass draw info to update function */
-   if (ctx->dirty)
-      swr_update_derived(pipe, info);
+   swr_update_derived(pipe, info);
 
    swr_update_draw_context(ctx);
 




More information about the mesa-commit mailing list