From 6085555c2bb5b0f306f9badd6826fec6a2122368 Mon Sep 17 00:00:00 2001 From: CamilleLaVey Date: Sun, 11 Jan 2026 00:38:19 -0400 Subject: [PATCH] [engines, maxwell] Extended table for the register dirty tracking --- src/video_core/engines/maxwell_3d.cpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/video_core/engines/maxwell_3d.cpp b/src/video_core/engines/maxwell_3d.cpp index 31b7c4600e..a6ca0851bb 100644 --- a/src/video_core/engines/maxwell_3d.cpp +++ b/src/video_core/engines/maxwell_3d.cpp @@ -198,19 +198,15 @@ bool Maxwell3D::IsMethodExecutable(u32 method) { void Maxwell3D::ProcessMacro(u32 method, const u32* base_start, u32 amount, bool is_last_call) { if (executing_macro == 0) { + // A macro call must begin by writing the macro method's register, not its argument. ASSERT_MSG((method % 2) == 0, "Can't start macro execution by writing to the ARGS register"); executing_macro = method; - macro_params.reserve(64); - macro_addresses.reserve(64); - macro_segments.reserve(8); } macro_params.insert(macro_params.end(), base_start, base_start + amount); - const size_t old_size = macro_addresses.size(); - macro_addresses.resize(old_size + amount); for (size_t i = 0; i < amount; i++) { - macro_addresses[old_size + i] = current_dma_segment + i * sizeof(u32); + macro_addresses.push_back(current_dma_segment + i * sizeof(u32)); } macro_segments.emplace_back(current_dma_segment, amount); current_macro_dirty |= current_dirty; @@ -328,9 +324,12 @@ void Maxwell3D::ProcessDirtyRegisters(u32 method, u32 argument) { } regs.reg_array[method] = argument; - for (const auto& table : dirty.tables) { - dirty.flags[table[method]] = true; - } + const auto& table0 = dirty.tables[0]; + const auto& table1 = dirty.tables[1]; + const u8 flag0 = table0[method]; + const u8 flag1 = table1[method]; + dirty.flags[flag0] = true; + dirty.flags[flag1] = true; } void Maxwell3D::ProcessMethodCall(u32 method, u32 argument, u32 nonshadow_argument,