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.
This commit is contained in:
Zack Rusin
2009-07-01 10:42:58 -04:00
parent e8c4663c11
commit 1c04731b87
6 changed files with 60 additions and 20 deletions

View File

@@ -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;