diff options
author | Brian <[email protected]> | 2008-01-21 11:16:22 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-21 11:16:22 -0700 |
commit | 382b86e90f69fa0493fae3c7e5c9cd482984af8f (patch) | |
tree | 6fc58cd23789615754c828eb509be395ed76a045 /src/mesa/pipe/cell | |
parent | f4b89be70111793a6b5eb511e1c92be72bb6b3d9 (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/cell')
-rw-r--r-- | src/mesa/pipe/cell/ppu/cell_state_derived.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mesa/pipe/cell/ppu/cell_state_derived.c b/src/mesa/pipe/cell/ppu/cell_state_derived.c index dc2879b9150..1e31c11ecd2 100644 --- a/src/mesa/pipe/cell/ppu/cell_state_derived.c +++ b/src/mesa/pipe/cell/ppu/cell_state_derived.c @@ -54,6 +54,7 @@ static void calculate_vertex_layout( struct cell_context *cell ) = cell->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR; struct vertex_info *vinfo = &cell->vertex_info; uint front0; + uint src = 0; memset(vinfo, 0, sizeof(*vinfo)); @@ -68,10 +69,10 @@ static void calculate_vertex_layout( struct cell_context *cell ) #endif /* always emit vertex pos */ - draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_LINEAR); + draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_LINEAR, src++); #if 1 - front0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + front0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp, src++); #endif #if 0 @@ -94,11 +95,11 @@ static void calculate_vertex_layout( struct cell_context *cell ) case TGSI_SEMANTIC_COLOR: if (vs->output_semantic_index[i] == 0) { - front0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + front0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp, src++); } else { assert(vs->output_semantic_index[i] == 1); - front1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + front1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp, src++); } break; @@ -113,7 +114,7 @@ static void calculate_vertex_layout( struct cell_context *cell ) break; case TGSI_SEMANTIC_FOG: - draw_emit_vertex_attr(vinfo, FORMAT_1F, INTERP_PERSPECTIVE); + draw_emit_vertex_attr(vinfo, FORMAT_1F, INTERP_PERSPECTIVE, src++); break; case TGSI_SEMANTIC_PSIZE: @@ -125,7 +126,7 @@ static void calculate_vertex_layout( struct cell_context *cell ) case TGSI_SEMANTIC_GENERIC: /* this includes texcoords and varying vars */ - draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE); + draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE, src++); break; default: @@ -140,14 +141,14 @@ static void calculate_vertex_layout( struct cell_context *cell ) * up 1:1 with the fragment shader inputs. */ if (emitBack0) { - back0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + back0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp, src++); } if (emitBack1) { - back1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + back1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp, src++); } if (emitPsize) { cell->psize_slot - = draw_emit_vertex_attr(vinfo, FORMAT_1F, INTERP_CONSTANT); + = draw_emit_vertex_attr(vinfo, FORMAT_1F, INTERP_CONSTANT, src++); } /* If the attributes have changed, tell the draw module about |