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

Alexandre Julliard julliard at winehq.org
Thu Apr 1 11:25:06 CDT 2010


Module: wine
Branch: master
Commit: f4330add3928e06131ddc5ede6148ca4c268e9ab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=f4330add3928e06131ddc5ede6148ca4c268e9ab

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Thu Apr  1 11:34:47 2010 +0200

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

---

 dlls/wined3d/state.c |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c
index 607ceab..4465b9d 100644
--- a/dlls/wined3d/state.c
+++ b/dlls/wined3d/state.c
@@ -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);
+            }
         }
     }
 }




More information about the wine-cvs mailing list