From 7ee4f32dcdd4cc935ed48ffb46ecc6678047958e Mon Sep 17 00:00:00 2001 From: Cooper Yuan Date: Mon, 24 Aug 2009 13:56:23 +0800 Subject: [PATCH] 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 file 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 ea670f41fb5..c01e61a9b19 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; } } -- 2.30.2