Module: Mesa
Branch: main
Commit: 4c65ccab6d48abe7be650ee7b9f3b72a70609a9a
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=4c65ccab6d48abe7be650ee7b9f3b72a70609a9a

Author: Axel Davy <[email protected]>
Date:   Sat Jul 30 00:25:29 2022 +0200

frontend/nine: Fix cso restore bug

Invalidating all state groups is not sufficient, as
some states check for actual changes.
The correct way is to invalidate the
commit mask.

Found with a wine test.

cc: mesa-stable

Signed-off-by: Axel Davy <[email protected]>
Acked-by: David Heidelberg <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>

---

 src/gallium/frontends/nine/nine_state.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/frontends/nine/nine_state.c 
b/src/gallium/frontends/nine/nine_state.c
index 9f940bc6f59..3725ebf6259 100644
--- a/src/gallium/frontends/nine/nine_state.c
+++ b/src/gallium/frontends/nine/nine_state.c
@@ -2841,10 +2841,10 @@ void nine_state_restore_non_cso(struct NineDevice9 
*device)
 {
     struct nine_context *context = &device->context;
 
-    context->changed.group = NINE_STATE_ALL;
+    context->changed.group = NINE_STATE_ALL; /* TODO: we can remove states 
that have prepared commits */
     context->changed.vtxbuf = (1ULL << device->caps.MaxStreams) - 1;
     context->changed.ucp = TRUE;
-    context->commit |= NINE_STATE_COMMIT_CONST_VS | NINE_STATE_COMMIT_CONST_PS;
+    context->commit |= 0xffffffff; /* re-commit everything */
     context->enabled_sampler_count_vs = 0;
     context->enabled_sampler_count_ps = 0;
 }

Reply via email to