diff options
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r-- | src/mesa/pipe/softpipe/sp_prim_setup.c | 12 | ||||
-rw-r--r-- | src/mesa/pipe/softpipe/sp_state_derived.c | 20 |
2 files changed, 15 insertions, 17 deletions
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/mesa/pipe/softpipe/sp_prim_setup.c index 913ae44601..f0f9cf54bd 100644 --- a/src/mesa/pipe/softpipe/sp_prim_setup.c +++ b/src/mesa/pipe/softpipe/sp_prim_setup.c @@ -79,7 +79,7 @@ struct setup_stage { float oneoverarea; - struct tgsi_interp_coef coef[TGSI_ATTRIB_MAX]; + struct tgsi_interp_coef coef[PIPE_MAX_SHADER_INPUTS]; struct quad_header quad; struct { @@ -366,7 +366,7 @@ static void const_coeff( struct setup_stage *setup, unsigned slot, unsigned i ) { - assert(slot < TGSI_ATTRIB_MAX); + assert(slot < PIPE_MAX_SHADER_INPUTS); assert(i <= 3); setup->coef[slot].dadx[i] = 0; @@ -391,7 +391,7 @@ static void tri_linear_coeff( struct setup_stage *setup, float a = setup->ebot.dy * majda - botda * setup->emaj.dy; float b = setup->emaj.dx * botda - majda * setup->ebot.dx; - assert(slot < TGSI_ATTRIB_MAX); + assert(slot < PIPE_MAX_SHADER_INPUTS); assert(i <= 3); setup->coef[slot].dadx[i] = a * setup->oneoverarea; @@ -454,7 +454,7 @@ static void tri_persp_coeff( struct setup_stage *setup, ); */ - assert(slot < TGSI_ATTRIB_MAX); + assert(slot < PIPE_MAX_SHADER_INPUTS); assert(i <= 3); setup->coef[slot].dadx[i] = a * setup->oneoverarea; @@ -910,8 +910,8 @@ setup_point(struct draw_stage *stage, struct prim_header *prim) = sizeAttr ? (0.5f * v0->data[sizeAttr][0]) : (0.5f * setup->softpipe->rasterizer->point_size); const boolean round = setup->softpipe->rasterizer->point_smooth; - const float x = v0->data[TGSI_ATTRIB_POS][0]; - const float y = v0->data[TGSI_ATTRIB_POS][1]; + const float x = v0->data[0][0]; /* Note: data[0] is always position */ + const float y = v0->data[0][1]; unsigned slot, j; assert(sizeAttr >= 0); diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c index 03b5d7ea3f..3ae207910d 100644 --- a/src/mesa/pipe/softpipe/sp_state_derived.c +++ b/src/mesa/pipe/softpipe/sp_state_derived.c @@ -63,7 +63,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) /* always emit vertex pos */ /* TODO - Figure out if we need to do perspective divide, etc. */ - draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_POS, FORMAT_4F, INTERP_LINEAR); + draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_LINEAR); for (i = 0; i < fs->num_inputs; i++) { switch (fs->input_semantics[i]) { @@ -75,15 +75,15 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) softpipe->need_w = TRUE; break; case TGSI_SEMANTIC_COLOR0: - front0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR0, + front0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); break; case TGSI_SEMANTIC_COLOR1: - front1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_COLOR1, + front1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); break; case TGSI_SEMANTIC_FOG: - draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_FOG, + draw_emit_vertex_attr(vinfo, FORMAT_1F, INTERP_PERSPECTIVE); break; #if 0 @@ -91,19 +91,19 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) /* XXX only emit if drawing points or front/back polygon mode * is point mode */ - draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_POINTSIZE, + draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_CONSTANT); break; #endif softpipe->psize_slot = i; /*case TGSI_SEMANTIC_TEXCOORD:*/ case TGSI_SEMANTIC_TEX0: - draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_TEX0, + draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE); softpipe->need_w = TRUE; break; case TGSI_SEMANTIC_OTHER: - draw_emit_vertex_attr(vinfo, i, FORMAT_4F, INTERP_PERSPECTIVE); + draw_emit_vertex_attr(vinfo, FORMAT_4F, INTERP_PERSPECTIVE); softpipe->need_w = TRUE; break; @@ -120,12 +120,10 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) */ if (softpipe->rasterizer->light_twoside) { if (front0) { - back0 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_BFC0, - FORMAT_OMIT, colorInterp); + back0 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp); } if (back0) { - back1 = draw_emit_vertex_attr(vinfo, TGSI_ATTRIB_BFC1, - FORMAT_OMIT, colorInterp); + back1 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp); } } |