Mesa (master): r300-gallium: Cleanup PSC for HW TCL.

Corbin Simpson csimpson at kemper.freedesktop.org
Mon May 11 17:11:54 UTC 2009


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

Author: Corbin Simpson <MostAwesomeDude at gmail.com>
Date:   Mon May 11 09:57:57 2009 -0700

r300-gallium: Cleanup PSC for HW TCL.

Still dies in assert, but at least it's not my assert anymore. :3

---

 src/gallium/drivers/r300/r300_state_derived.c |   35 +++++++++++++++++--------
 1 files changed, 24 insertions(+), 11 deletions(-)

diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c
index c4c9784..caa5f3b 100644
--- a/src/gallium/drivers/r300/r300_state_derived.c
+++ b/src/gallium/drivers/r300/r300_state_derived.c
@@ -162,26 +162,40 @@ static void r300_vs_tab_routes(struct r300_context* r300,
 static void r300_vertex_psc(struct r300_context* r300,
                             struct r300_vertex_format* vformat)
 {
+    struct r300_screen* r300screen = r300_screen(r300->context.screen);
     struct vertex_info* vinfo = &vformat->vinfo;
     int* tab = vformat->vs_tab;
     uint32_t temp;
-    int i;
+    int i, attrib_count;
 
-    debug_printf("r300: attrib count: %d\n", vinfo->num_attribs);
-    for (i = 0; i < vinfo->num_attribs; i++) {
-        debug_printf("r300: attrib: offset %d, interp %d, size %d,"
-               " tab %d\n", vinfo->attrib[i].src_index,
-               vinfo->attrib[i].interp_mode, vinfo->attrib[i].emit,
-               tab[i]);
+    /* Vertex shaders have no semantics on their inputs,
+     * so PSC should just route stuff based on their info,
+     * and not on attrib information. */
+    if (r300screen->caps->has_tcl) {
+        attrib_count = r300->vs->info.num_inputs;
+        debug_printf("r300: routing %d attribs in psc for vs\n",
+                attrib_count);
+    } else {
+        attrib_count = vinfo->num_attribs;
+        debug_printf("r300: attrib count: %d\n", attrib_count);
+        for (i = 0; i < attrib_count; i++) {
+            debug_printf("r300: attrib: offset %d, interp %d, size %d,"
+                   " tab %d\n", vinfo->attrib[i].src_index,
+                   vinfo->attrib[i].interp_mode, vinfo->attrib[i].emit,
+                   tab[i]);
+        }
     }
 
-    for (i = 0; i < vinfo->num_attribs; i++) {
+    for (i = 0; i < attrib_count; i++) {
         /* Make sure we have a proper destination for our attribute */
         assert(tab[i] != -1);
 
         /* Add the attribute to the PSC table. */
-        temp = translate_vertex_data_type(vinfo->attrib[i].emit) |
-            (tab[i] << R300_DST_VEC_LOC_SHIFT);
+        temp = r300screen->caps->has_tcl ?
+            R300_DATA_TYPE_FLOAT_4 :
+            translate_vertex_data_type(vinfo->attrib[i].emit);
+        temp |= tab[i] << R300_DST_VEC_LOC_SHIFT;
+
         if (i & 1) {
             vformat->vap_prog_stream_cntl[i >> 1] &= 0x0000ffff;
             vformat->vap_prog_stream_cntl[i >> 1] |= temp << 16;
@@ -206,7 +220,6 @@ static void r300_vertex_psc(struct r300_context* r300,
 /* Update the vertex format. */
 static void r300_update_vertex_format(struct r300_context* r300)
 {
-    struct r300_screen* r300screen = r300_screen(r300->context.screen);
     struct r300_vertex_format vformat;
     int i;
 




More information about the mesa-commit mailing list