r300g: Set the vector address in the input memory for bypass_vs_clip_and_viewport...
authorCooper Yuan <cooperyuan@gmail.com>
Mon, 24 Aug 2009 05:56:23 +0000 (13:56 +0800)
committerCooper Yuan <cooperyuan@gmail.com>
Mon, 24 Aug 2009 05:56:23 +0000 (13:56 +0800)
src/gallium/drivers/r300/r300_state_derived.c

index ea670f41fb536e89f1e34870a372876bdd8d3d7f..c01e61a9b19e9fcdfe8fd5d13478088a5fce7701 100644 (file)
@@ -49,59 +49,63 @@ static void r300_vs_tab_routes(struct r300_context* r300,
 
     assert(info->num_inputs <= 16);
 
-    if (r300screen->caps->has_tcl) {
-        /* Just copy vert attribs over as-is. */
+    if (!r300screen->caps->has_tcl || !r300->rs_state->enable_vte)
+    {
         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]) {
+            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] = 15;
                     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 output %d\n",
-                        info->output_semantic_name[i]);
+                    debug_printf("r300: Unknown vertex input %d\n",
+                        info->input_semantic_name[i]);
                     break;
             }
         }
-    } else {
+    }
+    else
+    {
+        /* Just copy vert attribs over as-is. */
         for (i = 0; i < info->num_inputs; i++) {
-            switch (info->input_semantic_name[i]) {
+            tab[i] = i;
+        }
+
+        for (i = 0; i < info->num_outputs; i++) {
+            switch (info->output_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] = 15;
                     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]);
+                    debug_printf("r300: Unknown vertex output %d\n",
+                        info->output_semantic_name[i]);
                     break;
             }
         }