[PATCH 5/5] wined3d: Add some state table consistency checking to context_invalidate_state().

Matteo Bruni wine at gitlab.winehq.org
Fri May 20 05:40:07 CDT 2022


From: Matteo Bruni <mbruni at codeweavers.com>

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
It's been helpful for me a few times for investigating state table
issues when running wined3d on "unconventional" configurations. It
also adds a check in a relatively hot codepath, so there's an argument
to not have the patch upstream.
Just submitting it for consideration...
---
 dlls/wined3d/context.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/dlls/wined3d/context.c b/dlls/wined3d/context.c
index 8c4277bc7ca..f9af58936a6 100644
--- a/dlls/wined3d/context.c
+++ b/dlls/wined3d/context.c
@@ -78,6 +78,9 @@ void context_invalidate_state(struct wined3d_context *context, unsigned int stat
     unsigned int representative = context->state_table[state_id].representative;
     unsigned int index, shift;
 
+    if (!representative)
+        ERR("Invalidating representative 0, state_id %u.\n", state_id);
+
     index = representative / (sizeof(*context->dirty_graphics_states) * CHAR_BIT);
     shift = representative & ((sizeof(*context->dirty_graphics_states) * CHAR_BIT) - 1);
     context->dirty_graphics_states[index] |= (1u << shift);
-- 
GitLab

https://gitlab.winehq.org/wine/wine/-/merge_requests/101



More information about the wine-devel mailing list