summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorJMC47 <JMC4789@gmail.com>2022-10-18 12:12:08 -0400
committerGitHub <noreply@github.com>2022-10-18 12:12:08 -0400
commit9aece1810c47916e9e56b8a2ef0a7e7f99fb0c54 (patch)
tree975429143806ee21cfe6eab50bd39aa991cf245e /Source/Core/VideoCommon/PixelShaderGen.cpp
parentee5a93c6b8ecffe476ffc0b6348172ab9c59dd0f (diff)
parent637dca680ccc53a2a7183917451c356e71117894 (diff)
Merge pull request #10836 from iwubcode/d3d_uint_fix
VideoCommon: fix uint shader compiler error when using d3d
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 9eda40c8e5..3a612382e6 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -1665,9 +1665,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",
@@ -1795,8 +1803,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");