From 77decca678b99b388ddbde3517cb9bd5f065cb80 Mon Sep 17 00:00:00 2001 From: lizzie Date: Tue, 28 Apr 2026 17:44:51 +0200 Subject: [video_core/engines/maxwell3d] memory inline DrawState to reduce indirection on hot paths (#3758) usual indirection removal helps very slightly to codegen the idea is basically to reduce the amount of pointer deference overall in the code, and use idiomatic std::variant<>-isms to not rely on vtables/unique_ptr overhead this should allow the compiler to emit better code of course it's a tiny optimisation and only CPU side, but allows us to reduce indirection which is almost always a good thing "but youre passing more parameters to the function!!!" its literally memoized into a register my friend Signed-off-by: lizzie Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3758 Reviewed-by: crueter Reviewed-by: MaranBr --- src/video_core/gpu_thread.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/video_core/gpu_thread.cpp') diff --git a/src/video_core/gpu_thread.cpp b/src/video_core/gpu_thread.cpp index 63a2516399..68f2530668 100644 --- a/src/video_core/gpu_thread.cpp +++ b/src/video_core/gpu_thread.cpp @@ -63,9 +63,7 @@ ThreadManager::ThreadManager(Core::System& system_, bool is_async_) ThreadManager::~ThreadManager() = default; -void ThreadManager::StartThread(VideoCore::RendererBase& renderer, - Core::Frontend::GraphicsContext& context, - Tegra::Control::Scheduler& scheduler) { +void ThreadManager::StartThread(VideoCore::RendererBase& renderer, Core::Frontend::GraphicsContext& context, Tegra::Control::Scheduler& scheduler) { rasterizer = renderer.ReadRasterizer(); thread = std::jthread(RunThread, std::ref(system), std::ref(renderer), std::ref(context), std::ref(scheduler), std::ref(state)); -- cgit v1.2.3