frontend/nine: Fix cso restore bug
authorAxel Davy <davyaxel0@gmail.com>
Fri, 29 Jul 2022 22:25:29 +0000 (00:25 +0200)
committerAxel Davy <davyaxel0@gmail.com>
Fri, 12 Aug 2022 19:53:11 +0000 (21:53 +0200)
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 <davyaxel0@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18021>

src/gallium/frontends/nine/nine_state.c

index 9f940bc..3725ebf 100644 (file)
@@ -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;
 }