From a37fd83218616b3e07c98d07f338515e924e3781 Mon Sep 17 00:00:00 2001 From: iwubcode Date: Mon, 22 Jan 2024 21:30:37 -0600 Subject: [PATCH] VideoCommon: fix uber shader pixel compilation error that happens when uint output is defined --- Source/Core/VideoCommon/UberShaderPixel.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/Source/Core/VideoCommon/UberShaderPixel.cpp b/Source/Core/VideoCommon/UberShaderPixel.cpp index a4874fd388..1117352dfd 100644 --- a/Source/Core/VideoCommon/UberShaderPixel.cpp +++ b/Source/Core/VideoCommon/UberShaderPixel.cpp @@ -1593,8 +1593,20 @@ ShaderCode GenPixelShader(APIType api_type, const ShaderHostConfig& host_config, 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"); } }