From: Matteo Bruni mbruni@codeweavers.com
Signed-off-by: Matteo Bruni mbruni@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);