summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/i915simple/i915_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/i915simple/i915_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/i915simple/i915_state_derived.c')
-rw-r--r--src/mesa/pipe/i915simple/i915_state_derived.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/src/mesa/pipe/i915simple/i915_state_derived.c b/src/mesa/pipe/i915simple/i915_state_derived.c
index 2a03650620..e825971199 100644
--- a/src/mesa/pipe/i915simple/i915_state_derived.c
+++ b/src/mesa/pipe/i915simple/i915_state_derived.c
@@ -59,28 +59,24 @@ static void calculate_vertex_layout( struct i915_context *i915 )
/* Note: we'll set the S4_VFMT_XYZ[W] bits below */
for (i = 0; i < fs->num_inputs; i++) {
- switch (fs->input_semantics[i]) {
+ switch (fs->input_semantic_name[i]) {
case TGSI_SEMANTIC_POSITION:
break;
- case TGSI_SEMANTIC_COLOR0:
- front0 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
- vinfo->hwfmt[0] |= S4_VFMT_COLOR;
- break;
- case TGSI_SEMANTIC_COLOR1:
- assert(0); /* untested */
- front1 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
- vinfo->hwfmt[0] |= S4_VFMT_SPEC_FOG;
+ case TGSI_SEMANTIC_COLOR:
+ if (fs->input_semantic_index[i] == 0) {
+ front0 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
+ vinfo->hwfmt[0] |= S4_VFMT_COLOR;
+ }
+ else {
+ assert(fs->input_semantic_index[i] == 1);
+ assert(0); /* untested */
+ front1 = draw_emit_vertex_attr(vinfo, FORMAT_4UB, colorInterp);
+ vinfo->hwfmt[0] |= S4_VFMT_SPEC_FOG;
+ }
break;
- case TGSI_SEMANTIC_TEX0:
- case TGSI_SEMANTIC_TEX1:
- case TGSI_SEMANTIC_TEX2:
- case TGSI_SEMANTIC_TEX3:
- case TGSI_SEMANTIC_TEX4:
- case TGSI_SEMANTIC_TEX5:
- case TGSI_SEMANTIC_TEX6:
- case TGSI_SEMANTIC_TEX7:
+ case TGSI_SEMANTIC_TEXCOORD:
{
- const uint unit = fs->input_semantics[i] - TGSI_SEMANTIC_TEX0;
+ const uint unit = fs->input_semantic_index[i];
uint hwtc;
texCoords[unit] = TRUE;
draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE);