aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_atom_shader.c
diff options
context:
space:
mode:
authorZack Rusin <[email protected]>2009-07-06 21:33:56 -0400
committerZack Rusin <[email protected]>2009-07-06 21:35:15 -0400
commita4d952358d8fd0f9d135c91c37969acdcf394f0a (patch)
treefc484c9f37b098701250c1de86914ee8219990f0 /src/mesa/state_tracker/st_atom_shader.c
parent7fb4becf986872268af4ba3f62c0a85b41ef7e5d (diff)
gallium: more fog extraction fixes
fix the cases when fog coord/front face/point coord are used in the same shader.
Diffstat (limited to 'src/mesa/state_tracker/st_atom_shader.c')
-rw-r--r--src/mesa/state_tracker/st_atom_shader.c21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c
index c02ccc35283..299aa762c20 100644
--- a/src/mesa/state_tracker/st_atom_shader.c
+++ b/src/mesa/state_tracker/st_atom_shader.c
@@ -137,22 +137,15 @@ 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++;
+ /* leave placeholders for the
+ * extra registers we extract from fog */
+ if (stfp->Base.UsesFrontFacing ||
+ stfp->Base.UsesPointCoord) {
+ numIn += 2;
}
- 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 {