diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-09-21 12:21:05 -0600 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-09-21 12:21:05 -0600 |
commit | 890125d3adc4c5011e9241210c44d40dfdd6c4eb (patch) | |
tree | 4592726f37eb9f30812a323617dec31235474719 | |
parent | da45890818ab5ae94592208e3581b5c2febaa6b4 (diff) |
fix some post-transform vertex layout issues (bcolors, psize emitted last
-rw-r--r-- | src/mesa/pipe/softpipe/sp_state_derived.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mesa/pipe/softpipe/sp_state_derived.c b/src/mesa/pipe/softpipe/sp_state_derived.c index 35ba32cd81..6c6e798069 100644 --- a/src/mesa/pipe/softpipe/sp_state_derived.c +++ b/src/mesa/pipe/softpipe/sp_state_derived.c @@ -48,6 +48,7 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) const interp_mode colorInterp = softpipe->rasterizer->flatshade ? INTERP_CONSTANT : INTERP_LINEAR; struct vertex_info *vinfo = &softpipe->vertex_info; + boolean emitBack0 = FALSE, emitBack1 = FALSE, emitPsize = FALSE; uint front0 = 0, back0 = 0, front1 = 0, back1 = 0; uint i; @@ -101,11 +102,11 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) case TGSI_SEMANTIC_BCOLOR: if (fs->input_semantic_index[i] == 0) { - back0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + emitBack0 = TRUE; } else { assert(fs->input_semantic_index[i] == 1); - back1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + emitBack1 = TRUE; } break; @@ -117,8 +118,7 @@ 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, FORMAT_1F, INTERP_CONSTANT); - softpipe->psize_slot = i; + emitPsize = TRUE; break; case TGSI_SEMANTIC_GENERIC: @@ -134,20 +134,20 @@ static void calculate_vertex_layout( struct softpipe_context *softpipe ) softpipe->nr_frag_attrs = vinfo->num_attribs; -#if 0 - /* Additional attributes required for setup: Just twosided - * lighting. Edgeflag is dealt with specially by setting bits in - * the vertex header. + /* We want these after all other attribs since they won't get passed + * to the fragment shader. All prior vertex output attribs should match + * up 1:1 with the fragment shader inputs. */ - if (softpipe->rasterizer->light_twoside) { - if (front0) { - back0 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp); - } - if (back0) { - back1 = draw_emit_vertex_attr(vinfo, FORMAT_OMIT, colorInterp); - } + if (emitBack0) { + back0 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + } + if (emitBack1) { + back1 = draw_emit_vertex_attr(vinfo, FORMAT_4F, colorInterp); + } + if (emitPsize) { + softpipe->psize_slot + = draw_emit_vertex_attr(vinfo, FORMAT_1F, INTERP_CONSTANT); } -#endif /* If the attributes have changed, tell the draw module about * the new vertex layout. |