summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2009-07-04 07:43:01 +0200
committerJakob Bornecrantz <[email protected]>2009-07-04 07:43:01 +0200
commit28471cfa970702128d822c2ecbb1703eedbca245 (patch)
treefa91f0d366ba857e228946ac88966e1717dc879f /src/mesa/state_tracker/st_program.c
parent9982821cdaf2205443c6297368eaab4115bf92f6 (diff)
parent71633abafc935c25da9731bab48c228ceb9b4097 (diff)
Merge branch 'mesa_7_5_branch'
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c34
1 files changed, 24 insertions, 10 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 3365bc0b8bb..e4d3bb33c71 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -453,20 +453,34 @@ st_translate_fragment_program(struct st_context *st,
stfp->input_semantic_index[slot] = 1;
interpMode[slot] = TGSI_INTERPOLATE_LINEAR;
break;
- case FRAG_ATTRIB_FOGC:
- if (stfp->Base.UsesPointCoord) {
- stfp->input_semantic_name[slot] = TGSI_SEMANTIC_GENERIC;
- stfp->input_semantic_index[slot] = num_generic++;
- interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
- } else if (stfp->Base.UsesFrontFacing) {
- stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FACE;
- stfp->input_semantic_index[slot] = 0;
- interpMode[slot] = TGSI_INTERPOLATE_CONSTANT;
- } else {
+ case FRAG_ATTRIB_FOGC: {
+ int extra_decls = 0;
+ if (stfp->Base.UsesFogFragCoord) {
stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
stfp->input_semantic_index[slot] = 0;
interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
+ input_flags[slot] = stfp->Base.Base.InputFlags[attr];
+ ++extra_decls;
}
+ if (stfp->Base.UsesFrontFacing) {
+ GLint idx = slot + extra_decls;
+ stfp->input_semantic_name[idx] = TGSI_SEMANTIC_FACE;
+ stfp->input_semantic_index[idx] = 0;
+ interpMode[idx] = TGSI_INTERPOLATE_CONSTANT;
+ input_flags[idx] = stfp->Base.Base.InputFlags[attr];
+ ++extra_decls;
+ }
+ if (stfp->Base.UsesPointCoord) {
+ GLint idx = slot + extra_decls;
+ stfp->input_semantic_name[idx] = TGSI_SEMANTIC_GENERIC;
+ stfp->input_semantic_index[idx] = num_generic++;
+ interpMode[idx] = TGSI_INTERPOLATE_PERSPECTIVE;
+ input_flags[idx] = stfp->Base.Base.InputFlags[attr];
+ ++extra_decls;
+ }
+ fs_num_inputs += extra_decls - 1;
+ continue;
+ }
break;
case FRAG_ATTRIB_TEX0:
case FRAG_ATTRIB_TEX1: