summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_program.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-07-01 10:42:58 -0400
committerZack Rusin <[email protected]>2009-07-01 10:45:55 -0400
commit1c04731b8721850b6abb12a43a3eec616b850e86 (patch)
tree1b172fcb4b651718b39a613c2267b76b457ccf8e /src/mesa/state_tracker/st_program.c
parente8c4663c11cfbb80ed23b1581cf1f3ccaef28bce (diff)
gallium: fix the front face semantics
mesa allocates both frontface and pointcoord registers within the fog coordinate register, by using swizzling. to make it cleaner and easier for drivers we want each of them in its own register. so when doing compilation from the mesa IR to tgsi allocate new registers for both and add new semantics to the respective declarations.
Diffstat (limited to 'src/mesa/state_tracker/st_program.c')
-rw-r--r--src/mesa/state_tracker/st_program.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c
index 72ca8524582..9a346fbde0c 100644
--- a/src/mesa/state_tracker/st_program.c
+++ b/src/mesa/state_tracker/st_program.c
@@ -437,11 +437,16 @@ st_translate_fragment_program(struct st_context *st,
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 {
stfp->input_semantic_name[slot] = TGSI_SEMANTIC_FOG;
stfp->input_semantic_index[slot] = 0;
+ interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
}
- interpMode[slot] = TGSI_INTERPOLATE_PERSPECTIVE;
break;
case FRAG_ATTRIB_TEX0:
case FRAG_ATTRIB_TEX1: