From 84f8ebd95fc70bc3482a53f31d5ebcc5266bb4b7 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 5 Sep 2017 23:33:15 +1000 Subject: VideoBackends: Clear uid bits that are unused for the current backend Currently, this is only the logic op bit, but this will be extended to the framebuffer fetch/blend modes. In the future, when/if we move to VideoCommon pipelines, this state will be part of the pipeline UID anyway, and we can mask it out in the backend by using a two-level map, so the shaders/programs are shared. --- Source/Core/VideoCommon/PixelShaderGen.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Source/Core/VideoCommon/PixelShaderGen.cpp') 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(); + + // 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) { -- cgit v1.2.3