diff options
| author | simply0001 <nicolas.tobago@icloud.com> | 2026-06-26 04:15:31 +0200 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-06-26 04:15:31 +0200 |
| commit | 629ebf1bdee023d3d3ecc96c3276cf3285f8f727 (patch) | |
| tree | de95d7adc46ff0ee49def3e632653f755a254eb6 /src/video_core/macro.cpp | |
| parent | c993bc01a49c39c3d293ce401db86b3dccba69c1 (diff) | |
[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>
Diffstat (limited to 'src/video_core/macro.cpp')
| -rw-r--r-- | src/video_core/macro.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/video_core/macro.cpp b/src/video_core/macro.cpp index 2833f95ee9..0d026a1ce5 100644 --- a/src/video_core/macro.cpp +++ b/src/video_core/macro.cpp @@ -1356,33 +1356,33 @@ static void Dump(u64 hash, std::span<const u32> code, bool decompiled = false) { void MacroEngine::Execute(Core::System& system, Engines::Maxwell3D& maxwell3d, u32 method, std::span<const u32> parameters) { auto const execute_variant = [&system, &maxwell3d, ¶meters, method](AnyCachedMacro& acm) { if (auto a = std::get_if<HLE_DrawArraysIndirect>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_DrawIndexedIndirect>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_MultiDrawIndexedIndirectCount>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_MultiLayerClear>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_C713C83D8F63CCF3>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_D7333D26E0A93EDE>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_BindShader>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_SetRasterBoundingBox>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_ClearConstBuffer>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_ClearMemory>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_TransformFeedbackSetup>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<HLE_DrawIndirectByteCount>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<MacroInterpreterImpl>(&acm)) - a->Execute(system, maxwell3d, parameters, method); + return a->Execute(system, maxwell3d, parameters, method); if (auto a = std::get_if<std::unique_ptr<DynamicCachedMacro>>(&acm)) - a->get()->Execute(system, maxwell3d, parameters, method); + return a->get()->Execute(system, maxwell3d, parameters, method); }; if (auto const it = macro_cache.find(method); it != macro_cache.end()) { auto& ci = it->second; |
