Module: wine Branch: master Commit: 284e92def932243e9d75435c2eee2caf02767363 URL: http://source.winehq.org/git/wine.git/?a=commit;h=284e92def932243e9d75435c2e...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Wed Apr 7 21:04:48 2010 +0200
wined3d: Validate some more states.
---
dlls/wined3d/state.c | 21 +++++++++++++++++++++ 1 files changed, 21 insertions(+), 0 deletions(-)
diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 5d6c19a..f94aac5 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -5670,6 +5670,20 @@ static void validate_state_table(struct StateEntry *state_table) {196, 197}, { 0, 0}, }; + static const DWORD simple_states[] = + { + STATE_MATERIAL, + STATE_VDECL, + STATE_STREAMSRC, + STATE_INDEXBUFFER, + STATE_VERTEXSHADERCONSTANT, + STATE_PIXELSHADERCONSTANT, + STATE_VSHADER, + STATE_PIXELSHADER, + STATE_VIEWPORT, + STATE_SCISSORRECT, + STATE_FRONTFACE, + }; unsigned int i, current;
for (i = STATE_RENDER(1), current = 0; i <= STATE_RENDER(WINEHIGHEST_RENDER_STATE); ++i) @@ -5685,6 +5699,13 @@ static void validate_state_table(struct StateEntry *state_table) if (i == STATE_RENDER(rs_holes[current].last)) ++current; }
+ for (i = 0; i < sizeof(simple_states) / sizeof(*simple_states); ++i) + { + if (!state_table[simple_states[i]].representative) + ERR("State %s (%#x) should have a representative.\n", + debug_d3dstate(simple_states[i]), simple_states[i]); + } + for (i = 0; i < STATE_HIGHEST + 1; ++i) { DWORD rep = state_table[i].representative;