[video_core/maxwell3d] compute macro param address on demand (#4067)

GetMacroAddress only reads a couple of indices per macro, but ProcessMacro was
then building a full std::vector GPUVAddr> with one push_back per parameter word
every submission. macro_segments already holds base, count per chunk, so
GetMacroAddress can just walk it instead, drops the per-word loop, a
.clear(), and a vector member.

Also makes it so it returns on the first match in the macro dispatch instead of running every
std::get_if check.

Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4067
Reviewed-by: Lizzie <lizzie@eden-emu.dev>
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
This commit is contained in:
simply0001
2026-06-26 04:15:31 +02:00
committed by crueter
parent c993bc01a4
commit 629ebf1bde
3 changed files with 22 additions and 20 deletions
+8 -2
View File
@@ -3158,7 +3158,14 @@ public:
DrawManager draw_manager;
GPUVAddr GetMacroAddress(size_t index) const {
return macro_addresses[index];
size_t base = 0;
for (const auto& [addr, count] : macro_segments) {
if (index < base + count) {
return addr + (index - base) * sizeof(u32);
}
base += count;
}
return 0;
}
void RefreshParameters() {
@@ -3261,7 +3268,6 @@ private:
bool execute_on{true};
std::vector<std::pair<GPUVAddr, size_t>> macro_segments;
std::vector<GPUVAddr> macro_addresses;
bool current_macro_dirty{};
};