diff options
author | Dave Airlie <[email protected]> | 2012-01-06 13:31:07 +0000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2012-01-07 08:30:23 +0000 |
commit | e1ff84371c0e8c58297611f95ec1e2cb5d5acaa4 (patch) | |
tree | 104ac8998abed643ef74b82da1e2722c32d76080 /src/mesa/state_tracker/st_program.c | |
parent | be21ded2aef97b134379dd92b67e5e206720c1b1 (diff) |
st/mesa: fix default interpolation for colors.
Brian mentioned that mesa-demos/reflect was broken on softpipe,
by my previous commit. The problem was were blindly translating none
to perspective, when color/pntc at least need it linear.
this is the final version that fixes the reflect regression.
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index aceaaf8c552..35d0e0fc42f 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -432,10 +432,13 @@ st_get_vp_variant(struct st_context *st, static unsigned -st_translate_interp(enum glsl_interp_qualifier glsl_qual) +st_translate_interp(enum glsl_interp_qualifier glsl_qual, bool is_color) { switch (glsl_qual) { case INTERP_QUALIFIER_NONE: + if (is_color) + return TGSI_INTERPOLATE_LINEAR; + return TGSI_INTERPOLATE_PERSPECTIVE; case INTERP_QUALIFIER_SMOOTH: return TGSI_INTERPOLATE_PERSPECTIVE; case INTERP_QUALIFIER_FLAT: @@ -538,12 +541,14 @@ st_translate_fragment_program(struct st_context *st, case FRAG_ATTRIB_COL0: input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; input_semantic_index[slot] = 0; - interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr]); + interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], + TRUE); break; case FRAG_ATTRIB_COL1: input_semantic_name[slot] = TGSI_SEMANTIC_COLOR; input_semantic_index[slot] = 1; - interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr]); + interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], + TRUE); break; case FRAG_ATTRIB_FOGC: input_semantic_name[slot] = TGSI_SEMANTIC_FOG; @@ -600,7 +605,8 @@ st_translate_fragment_program(struct st_context *st, if (attr == FRAG_ATTRIB_PNTC) interpMode[slot] = TGSI_INTERPOLATE_LINEAR; else - interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr]); + interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr], + FALSE); break; } } |