summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe/sp_state_derived.c
diff options
context:
space:
mode:
authorBrian <brian.paul@tungstengraphics.com>2007-09-20 14:47:22 -0600
committerBrian <brian.paul@tungstengraphics.com>2007-09-20 14:47:22 -0600
commitf69b5c56feb60791bad27d491ee9592238d4efb0 (patch)
tree4e20d2ee723239121e5bf8b94a9786dc05e00440 /src/mesa/pipe/softpipe/sp_state_derived.c
parent478d1e2c9c73fc29542375c44d01ab964ce8eccf (diff)
Clean-up the TGSI_SEMANTIC tokens, introduce semantic indexes.
Still need to produce decl instructions for vertex shaders...
Diffstat (limited to 'src/mesa/pipe/softpipe/sp_state_derived.c')
-rw-r--r--src/mesa/pipe/softpipe/sp_state_derived.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c
index b51ab66cf3..66e5cc48f6 100644
--- a/src/mesa/pipe/softpipe/sp_state_derived.c
+++ b/src/mesa/pipe/softpipe/sp_state_derived.c
@@ -65,7 +65,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_LINEAR);
for (i = 0; i < fs->num_inputs; i++) {
- switch (fs->input_semantics[i]) {
+ switch (fs->input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION:
/* Need Z if depth test is enabled or the fragment program uses the
* fragment position (XYZW).
@@ -73,13 +73,16 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
softpipe->need_z = TRUE;
softpipe->need_w = TRUE;
break;
- case TGSI_SEMANTIC_COLOR0:
- front0 = draw_emit_vertex_attr(vinfo,
- FORMAT_4F, colorInterp);
- break;
- case TGSI_SEMANTIC_COLOR1:
- front1 = draw_emit_vertex_attr(vinfo,
- FORMAT_4F, colorInterp);
+ case TGSI_SEMANTIC_COLOR:
+ if (fs->input_semantic_index[i] == 0) {
+ front0 = draw_emit_vertex_attr(vinfo,
+ FORMAT_4F, colorInterp);
+ }
+ else {
+ assert(fs->input_semantic_index[i] == 1);
+ front1 = draw_emit_vertex_attr(vinfo,
+ FORMAT_4F, colorInterp);
+ }
break;
case TGSI_SEMANTIC_FOG:
draw_emit_vertex_attr(vinfo,
@@ -96,12 +99,13 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe )
#endif
softpipe->psize_slot = i;
/*case TGSI_SEMANTIC_TEXCOORD:*/
- case TGSI_SEMANTIC_TEX0:
+ case TGSI_SEMANTIC_TEXCOORD:
+ /* unit = fs->input_semantic_index[i] */
draw_emit_vertex_attr(vinfo,
FORMAT_4F, INTERP_PERSPECTIVE);
softpipe->need_w = TRUE;
break;
- case TGSI_SEMANTIC_OTHER:
+ case TGSI_SEMANTIC_GENERIC:
draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE);
softpipe->need_w = TRUE;
break;