r300g: add some assertions
authorMaciej Cencora <m.cencora@gmail.com>
Sun, 27 Sep 2009 20:20:41 +0000 (22:20 +0200)
committerMaciej Cencora <m.cencora@gmail.com>
Sun, 27 Sep 2009 20:44:28 +0000 (22:44 +0200)
Not sure why we are getting a shader with two inputs with position semantic, but we don't know how to handle it correctly so it's better to stop the app than lock the machine.

src/gallium/drivers/r300/r300_state_derived.c

index 2bbbcdfd9c211f6a05834ec3ac322af8d4df5943..083861a071265c67cbc801648089944adc6b219b 100644 (file)
@@ -55,6 +55,7 @@ static void r300_vs_tab_routes(struct r300_context* r300,
         for (i = 0; i < info->num_inputs; i++) {
             switch (info->input_semantic_name[i]) {
                 case TGSI_SEMANTIC_POSITION:
+                    assert(pos == FALSE);
                     pos = TRUE;
                     tab[i] = 0;
                     break;
@@ -63,10 +64,12 @@ static void r300_vs_tab_routes(struct r300_context* r300,
                     cols++;
                     break;
                 case TGSI_SEMANTIC_PSIZE:
+                    assert(psize == FALSE);
                     psize = TRUE;
                     tab[i] = 15;
                     break;
                 case TGSI_SEMANTIC_FOG:
+                    assert(fog == FALSE);
                     fog = TRUE;
                     /* Fall through */
                 case TGSI_SEMANTIC_GENERIC: