summaryrefslogtreecommitdiff
path: root/src/mesa/state_tracker/st_atom_shader.c
diff options
context:
space:
mode:
authorZack Rusin <zack@kde.org>2009-07-01 10:42:58 -0400
committerZack Rusin <zack@kde.org>2009-07-01 10:45:55 -0400
commit1c04731b8721850b6abb12a43a3eec616b850e86 (patch)
tree1b172fcb4b651718b39a613c2267b76b457ccf8e /src/mesa/state_tracker/st_atom_shader.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_atom_shader.c')
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index ee649be885..c02ccc3528 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -137,8 +137,23 @@ find_translated_vp(struct st_context *st,
for (inAttr = 0; inAttr < FRAG_ATTRIB_MAX; inAttr++) {
if (fragInputsRead & (1 << inAttr)) {
- stfp->input_to_slot[inAttr] = numIn;
- numIn++;
+ if ((fragInputsRead & FRAG_BIT_FOGC)) {
+ if (stfp->Base.UsesPointCoord) {
+ stfp->input_to_slot[inAttr] = numIn;
+ numIn++;
+ }
+ if (stfp->Base.UsesFrontFacing) {
+ stfp->input_to_slot[inAttr] = numIn;
+ numIn++;
+ }
+ if (stfp->Base.UsesFogFragCoord) {
+ stfp->input_to_slot[inAttr] = numIn;
+ numIn++;
+ }
+ } else {
+ stfp->input_to_slot[inAttr] = numIn;
+ numIn++;
+ }
}
else {
stfp->input_to_slot[inAttr] = UNUSED;