summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe/i915simple
diff options
context:
space:
mode:
authorBrian <[email protected]>2008-01-21 11:16:22 -0700
committerBrian <[email protected]>2008-01-21 11:16:22 -0700
commit382b86e90f69fa0493fae3c7e5c9cd482984af8f (patch)
tree6fc58cd23789615754c828eb509be395ed76a045 /src/mesa/pipe/i915simple
parentf4b89be70111793a6b5eb511e1c92be72bb6b3d9 (diff)
gallium: add a src_index[] array to draw's vertex_info for mapping post-xform vertex attribs to hw vertex attribs
Diffstat (limited to 'src/mesa/pipe/i915simple')
-rw-r--r--src/mesa/pipe/i915simple/i915_state_derived.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/mesa/pipe/i915simple/i915_state_derived.c b/src/mesa/pipe/i915simple/i915_state_derived.c
index be73769cf2f..466c704d87b 100644
--- a/src/mesa/pipe/i915simple/i915_state_derived.c
+++ b/src/mesa/pipe/i915simple/i915_state_derived.c
@@ -50,12 +50,13 @@ static void calculate_vertex_layout( struct i915_context *i915 )
boolean needW = 0;
uint i;
boolean texCoords[8];
+ uint src = 0;
memset(texCoords, 0, sizeof(texCoords));
memset(&vinfo, 0, sizeof(vinfo));
/* pos */
- draw_emit_vertex_attr(&vinfo, FORMAT_3F, INTERP_LINEAR);
+ draw_emit_vertex_attr(&vinfo, FORMAT_3F, INTERP_LINEAR, src++);
/* Note: we'll set the S4_VFMT_XYZ[W] bits below */
for (i = 0; i < fs->num_inputs; i++) {
@@ -64,12 +65,12 @@ static void calculate_vertex_layout( struct i915_context *i915 )
break;
case TGSI_SEMANTIC_COLOR:
if (fs->input_semantic_index[i] == 0) {
- front0 = draw_emit_vertex_attr(&vinfo, FORMAT_4UB, colorInterp);
+ front0 = draw_emit_vertex_attr(&vinfo, FORMAT_4UB, colorInterp, src++);
vinfo.hwfmt[0] |= S4_VFMT_COLOR;
}
else {
assert(fs->input_semantic_index[i] == 1);
- front1 = draw_emit_vertex_attr(&vinfo, FORMAT_4UB, colorInterp);
+ front1 = draw_emit_vertex_attr(&vinfo, FORMAT_4UB, colorInterp, src++);
vinfo.hwfmt[0] |= S4_VFMT_SPEC_FOG;
}
break;
@@ -79,7 +80,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
const uint unit = fs->input_semantic_index[i];
uint hwtc;
texCoords[unit] = TRUE;
- draw_emit_vertex_attr(&vinfo, FORMAT_4F, INTERP_PERSPECTIVE);
+ draw_emit_vertex_attr(&vinfo, FORMAT_4F, INTERP_PERSPECTIVE, src++);
hwtc = TEXCOORDFMT_4D;
needW = TRUE;
vinfo.hwfmt[1] |= hwtc << (unit * 4);
@@ -87,7 +88,7 @@ static void calculate_vertex_layout( struct i915_context *i915 )
break;
case TGSI_SEMANTIC_FOG:
fprintf(stderr, "i915 fogcoord not implemented yet\n");
- draw_emit_vertex_attr(&vinfo, FORMAT_1F, INTERP_PERSPECTIVE);
+ draw_emit_vertex_attr(&vinfo, FORMAT_1F, INTERP_PERSPECTIVE, src++);
break;
default:
assert(0);
@@ -119,10 +120,10 @@ static void calculate_vertex_layout( struct i915_context *i915 )
*/
if (i915->rasterizer->light_twoside) {
if (front0) {
- back0 = draw_emit_vertex_attr(&vinfo, FORMAT_OMIT, colorInterp);
+ back0 = draw_emit_vertex_attr(&vinfo, FORMAT_OMIT, colorInterp, src++);
}
if (back0) {
- back1 = draw_emit_vertex_attr(&vinfo, FORMAT_OMIT, colorInterp);
+ back1 = draw_emit_vertex_attr(&vinfo, FORMAT_OMIT, colorInterp, src++);
}
}