summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-10-14 20:06:56 +1100
committerTimothy Arceri <[email protected]>2016-10-26 14:29:36 +1100
commit20c0e67501350952191b70c907c26019e5722243 (patch)
treefc3d29862abe85a1792a02a2d87edcd0a0a06be0 /src/mesa/state_tracker/st_program.c
parentcdafd499cc18ab1b4f96fb5fe6537d9c24f5757a (diff)
st/mesa: stop making use of InterpQualifier array
A following patch is going to merge the gl_fragment_program struct into a common gl_program and we want to avoid all stages having this array. V2: use TGSI_INTERPOLATE_COUNT as the temporary placeholder. Suggested by Marek. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c40
1 files changed, 10 insertions, 30 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 55cf57289ec..6ea46781762 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -558,27 +558,6 @@ st_get_vp_variant(struct st_context *st,
}
-static unsigned
-st_translate_interp(enum glsl_interp_mode glsl_qual, bool is_color)
-{
- switch (glsl_qual) {
- case INTERP_MODE_NONE:
- if (is_color)
- return TGSI_INTERPOLATE_COLOR;
- return TGSI_INTERPOLATE_PERSPECTIVE;
- case INTERP_MODE_SMOOTH:
- return TGSI_INTERPOLATE_PERSPECTIVE;
- case INTERP_MODE_FLAT:
- return TGSI_INTERPOLATE_CONSTANT;
- case INTERP_MODE_NOPERSPECTIVE:
- return TGSI_INTERPOLATE_LINEAR;
- default:
- assert(0 && "unexpected interp mode in st_translate_interp()");
- return TGSI_INTERPOLATE_PERSPECTIVE;
- }
-}
-
-
/**
* Translate a Mesa fragment shader into a TGSI shader.
*/
@@ -660,14 +639,14 @@ st_translate_fragment_program(struct st_context *st,
case VARYING_SLOT_COL0:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 0;
- interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr],
- TRUE);
+ interpMode[slot] = stfp->glsl_to_tgsi ?
+ TGSI_INTERPOLATE_COUNT : TGSI_INTERPOLATE_COLOR;
break;
case VARYING_SLOT_COL1:
input_semantic_name[slot] = TGSI_SEMANTIC_COLOR;
input_semantic_index[slot] = 1;
- interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr],
- TRUE);
+ interpMode[slot] = stfp->glsl_to_tgsi ?
+ TGSI_INTERPOLATE_COUNT : TGSI_INTERPOLATE_COLOR;
break;
case VARYING_SLOT_FOGC:
input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
@@ -743,8 +722,8 @@ st_translate_fragment_program(struct st_context *st,
if (st->needs_texcoord_semantic) {
input_semantic_name[slot] = TGSI_SEMANTIC_TEXCOORD;
input_semantic_index[slot] = attr - VARYING_SLOT_TEX0;
- interpMode[slot] =
- st_translate_interp(stfp->Base.InterpQualifier[attr], FALSE);
+ interpMode[slot] = stfp->glsl_to_tgsi ?
+ TGSI_INTERPOLATE_COUNT : TGSI_INTERPOLATE_PERSPECTIVE;
break;
}
/* fall through */
@@ -766,9 +745,10 @@ st_translate_fragment_program(struct st_context *st,
input_semantic_index[slot] = st_get_generic_varying_index(st, attr);
if (attr == VARYING_SLOT_PNTC)
interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
- else
- interpMode[slot] = st_translate_interp(stfp->Base.InterpQualifier[attr],
- FALSE);
+ else {
+ interpMode[slot] = stfp->glsl_to_tgsi ?
+ TGSI_INTERPOLATE_COUNT : TGSI_INTERPOLATE_PERSPECTIVE;
+ }
break;
}
}