r300-gallium: Split up vertex format tallying for HW and SW TCL.
authorCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 11 Apr 2009 01:34:55 +0000 (18:34 -0700)
committerCorbin Simpson <MostAwesomeDude@gmail.com>
Sat, 11 Apr 2009 01:35:58 +0000 (18:35 -0700)
This makes things draw (again) with HW TCL. Yay?

src/gallium/drivers/r300/r300_state_derived.c

index d628373a0c6fca264cc3797069ecfa49399d0810..ce7ab6f16a011ad4953045c3a1d10bbb72d306e0 100644 (file)
@@ -45,39 +45,62 @@ static void r300_vs_tab_routes(struct r300_context* r300,
     }
 
     assert(info->num_inputs <= 16);
-    for (i = 0; i < info->num_inputs; i++) {
-        switch (info->input_semantic_name[i]) {
-            case TGSI_SEMANTIC_POSITION:
-                pos = TRUE;
-                tab[i] = 0;
-                break;
-            case TGSI_SEMANTIC_COLOR:
-                tab[i] = 2 + cols;
-                cols++;
-                break;
-            case TGSI_SEMANTIC_PSIZE:
-                psize = TRUE;
-                tab[i] = 1;
-                break;
-            case TGSI_SEMANTIC_FOG:
-                fog = TRUE;
-                /* Fall through */
-            case TGSI_SEMANTIC_GENERIC:
-                tab[i] = 6 + texs;
-                texs++;
-                break;
-            default:
-                debug_printf("r300: Unknown vertex input %d\n",
-                    info->input_semantic_name[i]);
-                break;
-        }
-    }
 
     if (r300screen->caps->has_tcl) {
         /* Just copy vert attribs over as-is. */
         for (i = 0; i < info->num_inputs; i++) {
             tab[i] = i;
         }
+        for (i = 0; i < info->num_outputs; i++) {
+            switch (info->output_semantic_name[i]) {
+                case TGSI_SEMANTIC_POSITION:
+                    pos = TRUE;
+                    break;
+                case TGSI_SEMANTIC_COLOR:
+                    cols++;
+                    break;
+                case TGSI_SEMANTIC_PSIZE:
+                    psize = TRUE;
+                    break;
+                case TGSI_SEMANTIC_FOG:
+                    fog = TRUE;
+                case TGSI_SEMANTIC_GENERIC:
+                    texs++;
+                    break;
+                default:
+                    debug_printf("r300: Unknown vertex output %d\n",
+                        info->output_semantic_name[i]);
+                    break;
+            }
+        }
+    } else {
+        for (i = 0; i < info->num_inputs; i++) {
+            switch (info->input_semantic_name[i]) {
+                case TGSI_SEMANTIC_POSITION:
+                    pos = TRUE;
+                    tab[i] = 0;
+                    break;
+                case TGSI_SEMANTIC_COLOR:
+                    tab[i] = 2 + cols;
+                    cols++;
+                    break;
+                case TGSI_SEMANTIC_PSIZE:
+                    psize = TRUE;
+                    tab[i] = 1;
+                    break;
+                case TGSI_SEMANTIC_FOG:
+                    fog = TRUE;
+                    /* Fall through */
+                case TGSI_SEMANTIC_GENERIC:
+                    tab[i] = 6 + texs;
+                    texs++;
+                    break;
+                default:
+                    debug_printf("r300: Unknown vertex input %d\n",
+                        info->input_semantic_name[i]);
+                    break;
+            }
+        }
     }
 
     /* Do the actual vertex_info setup.