Merge pull request #5903 from linkmauve/fix-mp2e

Round values in swizzlers
This commit is contained in:
Markus Wick 2017-12-02 17:38:21 +01:00 committed by GitHub
commit 76fbdbb06e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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");