Mesa (master): st/xa: Bind destination before setting new state

Thomas Hellstrom thomash at kemper.freedesktop.org
Tue Apr 8 05:34:23 UTC 2014


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

Author: Thomas Hellstrom <thellstrom at vmware.com>
Date:   Mon Apr  7 02:37:39 2014 -0700

st/xa: Bind destination before setting new state

Binding a new destination may cause the svga driver to emit draw calls
while propagating the surface. Make sure this doesn't happen in the middle
of sampler state setup where state may be incosistent.

In practice, surface propagation should never happen here and even if it did,
it wouldn't be a valid reason for the svga driver to emit partially set up
state, but to avoid future uncertainties, make sure this doesn't happen
anyway.

Found while auditing the state tracker for inconsistent sampler state /
sampler view setup.

Cc: "10.1" <mesa-stable at freedesktop.org>
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob at vmware.com>

---

 src/gallium/state_trackers/xa/xa_renderer.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/gallium/state_trackers/xa/xa_renderer.c b/src/gallium/state_trackers/xa/xa_renderer.c
index 9ba78be..0f5044d 100644
--- a/src/gallium/state_trackers/xa/xa_renderer.c
+++ b/src/gallium/state_trackers/xa/xa_renderer.c
@@ -406,6 +406,9 @@ renderer_copy_prepare(struct xa_context *r,
 				       PIPE_BIND_RENDER_TARGET));
     (void)screen;
 
+    renderer_bind_destination(r, dst_surface,
+			      dst_surface->width, dst_surface->height);
+
     /* set misc state we care about */
     {
 	struct pipe_blend_state blend;
@@ -435,9 +438,6 @@ renderer_copy_prepare(struct xa_context *r,
 	cso_single_sampler_done(r->cso, PIPE_SHADER_FRAGMENT);
     }
 
-    renderer_bind_destination(r, dst_surface,
-			      dst_surface->width, dst_surface->height);
-
     /* texture/sampler view */
     {
 	struct pipe_sampler_view templ;




More information about the mesa-commit mailing list