Mesa (master): r300-gallium: Split up vertex format tallying for HW and SW TCL.

Corbin Simpson csimpson at kemper.freedesktop.org
Sat Apr 11 01:36:12 UTC 2009


Module: Mesa
Branch: master
Commit: 9340c994b78d15253326b83cfcb15c7349c0403a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=9340c994b78d15253326b83cfcb15c7349c0403a

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Fri Apr 10 18:34:55 2009 -0700

r300-gallium: Split up vertex format tallying for HW and SW TCL.

This makes things draw (again) with HW TCL. Yay?

---

 src/gallium/drivers/r300/r300_state_derived.c |   77 ++++++++++++++++---------
 1 files changed, 50 insertions(+), 27 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index d628373..ce7ab6f 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -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.




More information about the mesa-commit mailing list