From c12b9b013b4219fc712380284e11e6f53c65513a Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Mon, 2 Aug 2021 23:40:10 -0400 Subject: [PATCH] PixelShaderGen: Add logic ops to pixel_shader_uid_data --- Source/Core/VideoCommon/GXPipelineTypes.h | 2 +- Source/Core/VideoCommon/PixelShaderGen.cpp | 3 +++ Source/Core/VideoCommon/PixelShaderGen.h | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Source/Core/VideoCommon/GXPipelineTypes.h b/Source/Core/VideoCommon/GXPipelineTypes.h index 231bddefc193..ca3fb897010e 100644 --- a/Source/Core/VideoCommon/GXPipelineTypes.h +++ b/Source/Core/VideoCommon/GXPipelineTypes.h @@ -19,7 +19,7 @@ namespace VideoCommon // As pipelines encompass both shader UIDs and render states, changes to either of these should // also increment the pipeline UID version. Incrementing the UID version will cause all UID // caches to be invalidated. -constexpr u32 GX_PIPELINE_UID_VERSION = 3; // Last changed in PR 9532 +constexpr u32 GX_PIPELINE_UID_VERSION = 4; // Last changed in PR 10215 struct GXPipelineUid { diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index b1362d73f34b..ca585f1c23b1 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -331,6 +331,9 @@ PixelShaderUid GetPixelShaderUid() uid_data->blend_subtract_alpha = state.subtractAlpha; } + uid_data->logic_op_enable = state.logicopenable; + uid_data->logic_op_mode = u32(state.logicmode.Value()); + return out; } diff --git a/Source/Core/VideoCommon/PixelShaderGen.h b/Source/Core/VideoCommon/PixelShaderGen.h index adf996044ced..6a7a638ac38c 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.h +++ b/Source/Core/VideoCommon/PixelShaderGen.h @@ -59,6 +59,8 @@ struct pixel_shader_uid_data DstBlendFactor blend_dst_factor_alpha : 3; // Only used with shader_framebuffer_fetch blend u32 blend_subtract : 1; // Only used with shader_framebuffer_fetch blend u32 blend_subtract_alpha : 1; // Only used with shader_framebuffer_fetch blend + u32 logic_op_enable : 1; // Only used with shader_framebuffer_fetch logic ops + u32 logic_op_mode : 4; // Only used with shader_framebuffer_fetch logic ops u32 texMtxInfo_n_projection : 8; // 8x1 bit u32 tevindref_bi0 : 3;