Mesa (master): r300g: Set the vector address in the input memory for bypass_vs_clip_and_viewport case

Cooper Yuan cooperyuan at kemper.freedesktop.org
Mon Aug 24 05:59:39 UTC 2009


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

Author: Cooper Yuan <cooperyuan at gmail.com>
Date:   Mon Aug 24 13:56:23 2009 +0800

r300g: Set the vector address in the input memory for bypass_vs_clip_and_viewport case

---

 src/gallium/drivers/r300/r300_state_derived.c |   36 ++++++++++++++-----------
 1 files changed, 20 insertions(+), 16 deletions(-)

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




More information about the mesa-commit mailing list