From 9340c994b78d15253326b83cfcb15c7349c0403a Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 10 Apr 2009 18:34:55 -0700 Subject: 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 file changed, 50 insertions(+), 27 deletions(-) (limited to 'src/gallium/drivers') diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index d628373a0c6..ce7ab6f16a0 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. -- cgit v1.2.3