mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-26 11:48:36 +01:00
Merge pull request #1704 from raven02/patch-1
Add rounding to equality check for ColorTest
This commit is contained in:
commit
4d07fcd7c9
1 file changed
+5
-2
@@ -256,7 +256,7 @@ void GenerateFragmentShader(char *buffer) {
|
||||
if (alphaTestFuncs[alphaTestFunc][0] != '#') {
|
||||
// If it's an equality check (!=, ==, <=, >=), rounding is more likely to be important.
|
||||
if (alphaTestFuncs[alphaTestFunc][2] == '=')
|
||||
WRITE(p, " if (round255f(v.a) %s round255f(u_alphacolorref.a)) discard;\n", alphaTestFuncs[alphaTestFunc]);
|
||||
WRITE(p, " if (round255f(v.a) %s u_alphacolorref.a) discard;\n", alphaTestFuncs[alphaTestFunc]);
|
||||
else
|
||||
WRITE(p, " if (v.a %s u_alphacolorref.a) discard;\n", alphaTestFuncs[alphaTestFunc]);
|
||||
}
|
||||
@@ -271,7 +271,10 @@ void GenerateFragmentShader(char *buffer) {
|
||||
const char *colorTestFuncs[] = { "#", "#", " != ", " == " }; // never/always don't make sense
|
||||
int colorTestMask = gstate.colormask;
|
||||
if (colorTestFuncs[colorTestFunc][0] != '#')
|
||||
WRITE(p, "if (v.rgb %s u_alphacolorref.rgb) discard;\n", colorTestFuncs[colorTestFunc]);
|
||||
if (colorTestFuncs[colorTestFunc][2] == '=')
|
||||
WRITE(p, "if (round255f(v.rgb) %s u_alphacolorref.rgb) discard;\n", colorTestFuncs[colorTestFunc]);
|
||||
else
|
||||
WRITE(p, "if (v.rgb %s u_alphacolorref.rgb) discard;\n", colorTestFuncs[colorTestFunc]);
|
||||
}
|
||||
|
||||
if (enableFog) {
|
||||
|
||||
Reference in new issue
Block a user