wined3d: Verify each state table entry has either a handler or a representative.

This commit is contained in:
Henri Verbeet 2010-04-01 11:34:47 +02:00 committed by Alexandre Julliard
parent 57cfd613a5
commit f4330add39
1 changed files with 17 additions and 4 deletions

View File

@ -5662,11 +5662,24 @@ static void validate_state_table(struct StateEntry *state_table)
for (i = 0; i < STATE_HIGHEST + 1; ++i)
{
DWORD rep = state_table[i].representative;
if (rep && !state_table[rep].representative)
if (rep)
{
ERR("State %s (%#x) has invalid representative %s (%#x).\n",
debug_d3dstate(i), i, debug_d3dstate(rep), rep);
state_table[i].representative = 0;
if (!state_table[rep].representative)
{
ERR("State %s (%#x) has invalid representative %s (%#x).\n",
debug_d3dstate(i), i, debug_d3dstate(rep), rep);
state_table[i].representative = 0;
}
if (rep != i)
{
if (state_table[i].apply)
ERR("State %s (%#x) has both a handler and representative.\n", debug_d3dstate(i), i);
}
else if (!state_table[i].apply)
{
ERR("Self representing state %s (%#x) has no handler.\n", debug_d3dstate(i), i);
}
}
}
}