summaryrefslogtreecommitdiff
path: root/Source/Core/VideoCommon/OpcodeDecoding.cpp
diff options
context:
space:
mode:
authorPokechu22 <Pokechu022@gmail.com>2021-05-13 16:05:31 -0700
committerPokechu22 <Pokechu022@gmail.com>2021-12-18 15:21:48 -0800
commitd039b1bc0dfaba2a88036468b6d971bb1d7e463d (patch)
treecd4d85ae6ec7f5674112ebf48e4716406663ca21 /Source/Core/VideoCommon/OpcodeDecoding.cpp
parente4605fa39955845145457aaa1f6ef227b7c6f78a (diff)
VideoCommon: Move VertexLoaderManager logic out of CPState
Diffstat (limited to 'Source/Core/VideoCommon/OpcodeDecoding.cpp')
-rw-r--r--Source/Core/VideoCommon/OpcodeDecoding.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/Source/Core/VideoCommon/OpcodeDecoding.cpp b/Source/Core/VideoCommon/OpcodeDecoding.cpp
index 26e0f2da93..cefc88239d 100644
--- a/Source/Core/VideoCommon/OpcodeDecoding.cpp
+++ b/Source/Core/VideoCommon/OpcodeDecoding.cpp
@@ -58,17 +58,42 @@ public:
OPCODE_CALLBACK(void OnCP(u8 command, u32 value))
{
m_cycles += 12;
+ const u8 sub_command = command & CP_COMMAND_MASK;
if constexpr (!is_preprocess)
{
- // TODO: Move all dirty state checking here or to VertexLoaderManager,
- // instead of it being in CPState
- if (command == MATINDEX_A)
+ if (sub_command == MATINDEX_A)
VertexShaderManager::SetTexMatrixChangedA(value);
- else if (command == MATINDEX_B)
+ else if (sub_command == MATINDEX_B)
VertexShaderManager::SetTexMatrixChangedB(value);
+ else if (sub_command == VCD_LO || sub_command == VCD_HI)
+ {
+ VertexLoaderManager::g_main_vat_dirty = BitSet8::AllTrue(CP_NUM_VAT_REG);
+ VertexLoaderManager::g_bases_dirty = true;
+ }
+ else if (sub_command == CP_VAT_REG_A || sub_command == CP_VAT_REG_B ||
+ sub_command == CP_VAT_REG_C)
+ {
+ VertexLoaderManager::g_main_vat_dirty[command & CP_VAT_MASK] = true;
+ }
+ else if (sub_command == ARRAY_BASE)
+ {
+ VertexLoaderManager::g_bases_dirty = true;
+ }
INCSTAT(g_stats.this_frame.num_cp_loads);
}
+ else if constexpr (is_preprocess)
+ {
+ if (sub_command == VCD_LO || sub_command == VCD_HI)
+ {
+ VertexLoaderManager::g_preprocess_vat_dirty = BitSet8::AllTrue(CP_NUM_VAT_REG);
+ }
+ else if (sub_command == CP_VAT_REG_A || sub_command == CP_VAT_REG_B ||
+ sub_command == CP_VAT_REG_C)
+ {
+ VertexLoaderManager::g_preprocess_vat_dirty[command & CP_VAT_MASK] = true;
+ }
+ }
GetCPState().LoadCPReg(command, value);
}
OPCODE_CALLBACK(void OnBP(u8 command, u32 value))