Fix bugs with fog bit in shader IDs

This commit is contained in:
Henrik Rydgard 2013-01-21 00:34:37 +01:00
parent 9a132e6a85
commit 784c191caf
2 changed files with 3 additions and 4 deletions

View file

@ -53,7 +53,7 @@ void ComputeFragmentShaderID(FragmentShaderID *id)
id->d[0] |= (gstate.textureMapEnable & 1) << 7;
id->d[0] |= (gstate.alphaTestEnable & 1) << 8;
id->d[0] |= (gstate.alphatest & 0x7) << 9; // alpha test func
id->d[0] |= (gstate.fogEnable & 1) << 9;
id->d[0] |= (gstate.fogEnable & 1) << 12;
}
}

View file

@ -51,9 +51,7 @@ void ComputeVertexShaderID(VertexShaderID *id, int prim)
bool hasColor = (gstate.vertType & GE_VTYPE_COL_MASK) != 0;
bool hasNormal = (gstate.vertType & GE_VTYPE_NRM_MASK) != 0;
bool hasBones = (gstate.vertType & GE_VTYPE_WEIGHT_MASK) != 0;
int shadeLight0 = gstate.getUVGenMode() == 2 ? gstate.getUVLS0() : -1;
int shadeLight1 = gstate.getUVGenMode() == 2 ? gstate.getUVLS1() : -1;
bool enableFog = gstate.isFogEnabled() && !gstate.isModeThrough() && !gstate.isModeClear();
memset(id->d, 0, sizeof(id->d));
id->d[0] = gstate.lmode & 1;
@ -61,6 +59,7 @@ void ComputeVertexShaderID(VertexShaderID *id, int prim)
id->d[0] |= ((int)gstate.isFogEnabled()) << 2;
id->d[0] |= doTexture << 3;
id->d[0] |= (hasColor & 1) << 4;
id->d[0] |= ((int)enableFog) << 5;
if (CanUseHardwareTransform(prim)) {
id->d[0] |= 1 << 8;
id->d[0] |= (hasNormal & 1) << 9;