summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/PixelShaderGen.cpp
diff options
context:
space:
mode:
authorStenzek <stenzek@users.noreply.github.com>2017-09-06 18:33:47 +1000
committerGitHub <noreply@github.com>2017-09-06 18:33:47 +1000
commit1073053df98cb019d49266c45dfe716367da0d52 (patch)
tree878f99f2bfa98f5993cfc0bfcb9b005ec2ebf0ff /Source/Core/VideoCommon/PixelShaderGen.cpp
parent2e20cd0ffdfb909a52a70217474fa5b53bd12996 (diff)
parent84f8ebd95fc70bc3482a53f31d5ebcc5266bb4b7 (diff)
Merge pull request #6026 from stenzek/d3d-ubershader-logicop
ShaderGen: Output uint when logic op is enabled for D3D ubershaders
Diffstat (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp')
-rw-r--r--Source/Core/VideoCommon/PixelShaderGen.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp
index 5e561456ab..990f5f938f 100644
--- a/Source/Core/VideoCommon/PixelShaderGen.cpp
+++ b/Source/Core/VideoCommon/PixelShaderGen.cpp
@@ -322,6 +322,16 @@ PixelShaderUid GetPixelShaderUid()
return out;
}
+void ClearUnusedPixelShaderUidBits(APIType ApiType, PixelShaderUid* uid)
+{
+ pixel_shader_uid_data* uid_data = uid->GetUidData<pixel_shader_uid_data>();
+
+ // OpenGL and Vulkan convert implicitly normalized color outputs to their uint representation.
+ // Therefore, it is not necessary to use a uint output on these backends.
+ if (ApiType != APIType::D3D)
+ uid_data->uint_output = 0;
+}
+
void WritePixelShaderCommonHeader(ShaderCode& out, APIType ApiType, u32 num_texgens,
bool per_pixel_lighting, bool bounding_box)
{