diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2024-01-22 21:31:03 -0600 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2024-01-23 21:50:42 -0600 |
| commit | 7118fc5b7bd9eb3d83ece9a2dae31708da46b2c8 (patch) | |
| tree | 8221e2b32298b17fd2c0b3abe61a1116a3e07b52 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | a37fd83218616b3e07c98d07f338515e924e3781 (diff) | |
VideoCommon: fix pixel shader compilation error that happens when uint output is defined
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index fff2374531..61a351742b 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1326,8 +1326,20 @@ ShaderCode GeneratePixelShaderCode(APIType api_type, const ShaderHostConfig& hos if (!shader_details.custom_shader.empty()) { out.Write("\t{{\n"); - out.Write("\t\tcustom_data.final_color = ocol0;\n"); - out.Write("\t\tocol0.xyz = {}_{}(custom_data).xyz;\n", CUSTOM_PIXELSHADER_COLOR_FUNC, i); + if (uid_data->uint_output) + { + out.Write("\t\tcustom_data.final_color = float4(ocol0.x / 255.0, ocol0.y / 255.0, ocol0.z " + "/ 255.0, ocol0.w / 255.0);\n"); + out.Write("\t\tfloat3 custom_output = {}_{}(custom_data).xyz;\n", + CUSTOM_PIXELSHADER_COLOR_FUNC, i); + out.Write("\t\tocol0.xyz = uint3(custom_output.x * 255, custom_output.y * 255, " + "custom_output.z * 255);\n"); + } + else + { + out.Write("\t\tcustom_data.final_color = ocol0;\n"); + out.Write("\t\tocol0.xyz = {}_{}(custom_data).xyz;\n", CUSTOM_PIXELSHADER_COLOR_FUNC, i); + } out.Write("\t}}\n\n"); } } |
