Skip to content

Commit d81522a

Browse files
committed
Address feedback.
1 parent 9105249 commit d81522a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

GPU/Common/ReinterpretFramebuffer.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,9 @@ static const VaryingDef varyings[1] = {
88
{ "vec2", "v_texcoord", "TEXCOORD0" },
99
};
1010

11-
// TODO: We could have an option to preserve any extra color precision. But gonna start without it.
12-
// Requires full size integer math.
11+
// TODO: We could possibly have an option to preserve any extra color precision? But gonna start without it.
12+
// Requires full size integer math. It would be possible to make a floating point-only version with lots of
13+
// modulo and stuff, might do it one day.
1314
bool GenerateReinterpretFragmentShader(char *buffer, GEBufferFormat from, GEBufferFormat to, const ShaderLanguageDesc &lang) {
1415
if (!lang.bitwiseOps) {
1516
return false;
@@ -30,7 +31,7 @@ bool GenerateReinterpretFragmentShader(char *buffer, GEBufferFormat from, GEBuff
3031
break;
3132
case GE_FORMAT_5551:
3233
writer.C(" uint color = uint(val.r * 31.99) | (uint(val.g * 31.99) << 5) | (uint(val.b * 31.99) << 10);\n");
33-
writer.C(" if (val.a > 128.0) color |= 0x8000U;\n");
34+
writer.C(" if (val.a >= 0.5) color |= 0x8000U;\n");
3435
break;
3536
case GE_FORMAT_565:
3637
writer.C(" uint color = uint(val.r * 31.99) | (uint(val.g * 63.99) << 5) | (uint(val.b * 31.99) << 11);\n");

0 commit comments

Comments
 (0)