Skip to content
Permalink
Browse files
Merge pull request #5903 from linkmauve/fix-mp2e
Round values in swizzlers
  • Loading branch information
degasus committed Dec 2, 2017
2 parents 7498d80 + 1b32751 commit 76fbdbb
Showing 1 changed file with 2 additions and 2 deletions.
@@ -80,13 +80,13 @@ static void WriteSwizzler(char*& p, EFBCopyFormat format, APIType ApiType)

WRITE(p, "float4 RGBA8ToRGBA6(float4 src)\n");
WRITE(p, "{\n");
WRITE(p, " int4 val = int4(src * 255.0) >> 2;\n");
WRITE(p, " int4 val = int4(roundEven(src * 255.0)) >> 2;\n");
WRITE(p, " return float4(val) / 63.0;\n");
WRITE(p, "}\n");

WRITE(p, "float4 RGBA8ToRGB565(float4 src)\n");
WRITE(p, "{\n");
WRITE(p, " int4 val = int4(src * 255.0);\n");
WRITE(p, " int4 val = int4(roundEven(src * 255.0));\n");
WRITE(p, " val = int4(val.r >> 3, val.g >> 2, val.b >> 3, 1);\n");
WRITE(p, " return float4(val) / float4(31.0, 63.0, 31.0, 1.0);\n");
WRITE(p, "}\n");

0 comments on commit 76fbdbb

Please sign in to comment.