diff options
| author | iwubcode <iwubcode@users.noreply.github.com> | 2022-07-11 21:20:38 -0500 |
|---|---|---|
| committer | iwubcode <iwubcode@users.noreply.github.com> | 2022-08-06 16:08:58 -0500 |
| commit | 05135b4f4322d88c383d7ef17da75c331fbc5c56 (patch) | |
| tree | 9fa8c6a16d616560a4ba466831243a48f10bfd55 /Source/Core/VideoCommon/PixelShaderGen.cpp | |
| parent | 7b2b559743f09d2b087728d7eb0c14c6b81a9f2a (diff) | |
VideoCommon: fix uint shader compiler error in specialized shaders. This error is in renderers that use uint for their color output (for logic ops). Remove D3D check for uint output since other backends could use uint output as well.
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 79d2bd1d52..af8435270b 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -1675,9 +1675,17 @@ static void WriteAlphaTest(ShaderCode& out, const pixel_shader_uid_data* uid_dat else out.Write(")) {{\n"); - out.Write("\t\tocol0 = float4(0.0, 0.0, 0.0, 0.0);\n"); - if (use_dual_source && !(api_type == APIType::D3D && uid_data->uint_output)) - out.Write("\t\tocol1 = float4(0.0, 0.0, 0.0, 0.0);\n"); + if (uid_data->uint_output) + out.Write("\t\tocol0 = uint4(0, 0, 0, 0);\n"); + else + out.Write("\t\tocol0 = float4(0.0, 0.0, 0.0, 0.0);\n"); + if (use_dual_source) + { + if (uid_data->uint_output) + out.Write("\t\tocol1 = uint4(0, 0, 0, 0);\n"); + else + out.Write("\t\tocol1 = float4(0.0, 0.0, 0.0, 0.0);\n"); + } if (per_pixel_depth) { out.Write("\t\tdepth = {};\n", @@ -1805,8 +1813,9 @@ static void WriteLogicOp(ShaderCode& out, const pixel_shader_uid_data* uid_data) static void WriteColor(ShaderCode& out, APIType api_type, const pixel_shader_uid_data* uid_data, bool use_dual_source) { - // D3D requires that the shader outputs be uint when writing to a uint render target for logic op. - if (api_type == APIType::D3D && uid_data->uint_output) + // Some backends require the shader outputs be uint when writing to a uint render target for logic + // op. + if (uid_data->uint_output) { if (uid_data->rgba6_format) out.Write("\tocol0 = uint4(prev & 0xFC);\n"); |
