diff options
| author | OatmealDome <julian@oatmealdome.me> | 2021-08-02 23:39:34 -0400 |
|---|---|---|
| committer | OatmealDome <julian@oatmealdome.me> | 2021-11-24 17:52:26 -0500 |
| commit | 04ec02c06bccdcc575765da70378e50b0b671f2c (patch) | |
| tree | 58b9a2c92db1b778ef75140a726db9ead81183c7 | |
| parent | 8e72136eebb95daea111d1f7b8e5a348194464bb (diff) | |
ConstantManager: Add logic ops to PixelShaderConstants
| -rw-r--r-- | Source/Core/VideoCommon/ConstantManager.h | 4 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderGen.cpp | 2 | ||||
| -rw-r--r-- | Source/Core/VideoCommon/PixelShaderManager.cpp | 10 |
3 files changed, 16 insertions, 0 deletions
diff --git a/Source/Core/VideoCommon/ConstantManager.h b/Source/Core/VideoCommon/ConstantManager.h index 7144342503..5335af963a 100644 --- a/Source/Core/VideoCommon/ConstantManager.h +++ b/Source/Core/VideoCommon/ConstantManager.h @@ -15,6 +15,7 @@ using int4 = std::array<s32, 4>; enum class DstBlendFactor : u32; enum class SrcBlendFactor : u32; enum class ZTexOp : u32; +enum class LogicOp : u32; struct PixelShaderConstants { @@ -54,6 +55,9 @@ struct PixelShaderConstants DstBlendFactor blend_dst_factor_alpha; u32 blend_subtract; u32 blend_subtract_alpha; + // For shader_framebuffer_fetch logic ops: + u32 logic_op_enable; // bool + LogicOp logic_op_mode; }; struct VertexShaderConstants diff --git a/Source/Core/VideoCommon/PixelShaderGen.cpp b/Source/Core/VideoCommon/PixelShaderGen.cpp index 6261f57812..b1362d73f3 100644 --- a/Source/Core/VideoCommon/PixelShaderGen.cpp +++ b/Source/Core/VideoCommon/PixelShaderGen.cpp @@ -423,6 +423,8 @@ void WritePixelShaderCommonHeader(ShaderCode& out, APIType api_type, "\tuint blend_dst_factor_alpha;\n" "\tbool blend_subtract;\n" "\tbool blend_subtract_alpha;\n" + "\tbool logic_op_enable;\n" + "\tuint logic_op_mode;\n" "}};\n\n"); out.Write("#define bpmem_combiners(i) (bpmem_pack1[(i)].xy)\n" "#define bpmem_tevind(i) (bpmem_pack1[(i)].z)\n" diff --git a/Source/Core/VideoCommon/PixelShaderManager.cpp b/Source/Core/VideoCommon/PixelShaderManager.cpp index f63722c9c1..675bcceca5 100644 --- a/Source/Core/VideoCommon/PixelShaderManager.cpp +++ b/Source/Core/VideoCommon/PixelShaderManager.cpp @@ -510,6 +510,16 @@ void PixelShaderManager::SetBlendModeChanged() constants.blend_subtract_alpha = state.subtractAlpha; dirty = true; } + if (constants.logic_op_enable != state.logicopenable) + { + constants.logic_op_enable = state.logicopenable; + dirty = true; + } + if (constants.logic_op_mode != state.logicmode) + { + constants.logic_op_mode = state.logicmode; + dirty = true; + } s_bDestAlphaDirty = true; } |
