mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Fix bugs with fog bit in shader IDs
This commit is contained in:
parent
9a132e6a85
commit
784c191caf
2 changed files with 3 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue