diff options
| author | Stenzek <stenzek@gmail.com> | 2019-07-18 20:57:42 +1000 |
|---|---|---|
| committer | Stenzek <stenzek@gmail.com> | 2019-07-19 15:33:32 +1000 |
| commit | 97d81ac97c526f952d8a40060f3cfa86f5f22df2 (patch) | |
| tree | 029304fc33f028350cc38e81c825ce544eb7c426 /Source/Core/VideoCommon/FramebufferShaderGen.cpp | |
| parent | 6f53a4d0daa81d34890f91fcbfbc3e135953750a (diff) | |
FramebufferShaderGen: Fix format reinterpret shaders on GLES
Diffstat (limited to 'Source/Core/VideoCommon/FramebufferShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/FramebufferShaderGen.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/Core/VideoCommon/FramebufferShaderGen.cpp b/Source/Core/VideoCommon/FramebufferShaderGen.cpp index f944562d9c..5789c0a0d2 100644 --- a/Source/Core/VideoCommon/FramebufferShaderGen.cpp +++ b/Source/Core/VideoCommon/FramebufferShaderGen.cpp @@ -597,29 +597,30 @@ std::string GenerateTextureReinterpretShader(TextureFormat from_format, TextureF case TextureFormat::I8: case TextureFormat::C8: { - ss << " ocol0.rgba = (float(raw_value & 0xFFu) / 255.0).rrrr;\n"; + ss << " float orgba = float(raw_value & 0xFFu) / 255.0;\n"; + ss << " ocol0 = float4(orgba, orgba, orgba, orgba);\n"; } break; case TextureFormat::IA8: { - ss << " ocol0.rgb = (float(raw_value & 0xFFu) / 255.0).rrr;\n"; - ss << " ocol0.a = float((raw_value >> 8) & 0xFFu) / 255.0;\n"; + ss << " float orgb = float(raw_value & 0xFFu) / 255.0;\n"; + ss << " ocol0 = float4(orgb, orgb, orgb, float((raw_value >> 8) & 0xFFu) / 255.0);\n"; } break; case TextureFormat::IA4: { - ss << " ocol0.rgb = (float(raw_value & 0xFu) / 15.0).rrr;\n"; - ss << " ocol0.a = float((raw_value >> 4) & 0xFu) / 15.0;\n"; + ss << " float orgb = float(raw_value & 0xFu) / 15.0;\n"; + ss << " ocol0 = float4(orgb, orgb, orgb, float((raw_value >> 4) & 0xFu) / 15.0);\n"; } break; case TextureFormat::RGB565: { - ss << " ocol0 = float4(float((raw_value >> 10) & 0x1Fu) / 31.0\n"; + ss << " ocol0 = float4(float((raw_value >> 10) & 0x1Fu) / 31.0,\n"; ss << " float((raw_value >> 5) & 0x1Fu) / 31.0,\n"; - ss << " float(raw_value & 0x1Fu) / 31.0,, 1.0);\n"; + ss << " float(raw_value & 0x1Fu) / 31.0, 1.0);\n"; } break; |
