diff options
| author | lizzie <lizzie@eden-emu.dev> | 2026-02-20 00:52:07 +0100 |
|---|---|---|
| committer | crueter <crueter@eden-emu.dev> | 2026-02-20 00:52:07 +0100 |
| commit | c9c136bea7567c825be19c1dcb481a47ee6536f6 (patch) | |
| tree | 30725fc00936aa7c749a8c6b4be81803df6a88a6 /src/video_core/buffer_cache/buffer_base.h | |
| parent | 6f9d025ad2eafdaedc636531db256e4f4649b8d9 (diff) | |
[texture_cache, buffer_cache] Added TLS handling + changed command queue for GPU threading. (#3579)
(Merge of #3495 + #3108)
This PR works around to simplify math operations on hot pointers inside the access and requests to the cache of buffers and texture cache, removing previous logic of indirection and replaced by a PoD approach.
This will ensure less CPU times spended on the same request and flow directly into another chain of the render, in the same way, command queue currently uses an internal mutex that constraints the flow of data within the GPU threads, we're moving over a single command, I verified to keep using mutexes instead of internal mutex + mutex per operation, which are resolved by themselves.
In simplier words, this aims to improve performance on those games and devices where the waits for next orders on GPU commands were heavier than a single verification.
Co-Authored-by: @CamilleLaVey
Co-Authored-by: @Lizzie
Co-authored-by: CamilleLaVey <camillelavey99@gmail.com>
Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3579
Reviewed-by: CamilleLaVey <camillelavey99@gmail.com>
Co-authored-by: lizzie <lizzie@eden-emu.dev>
Co-committed-by: lizzie <lizzie@eden-emu.dev>
Diffstat (limited to 'src/video_core/buffer_cache/buffer_base.h')
| -rw-r--r-- | src/video_core/buffer_cache/buffer_base.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index 40e98e3952..bec2dac246 100644 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -1,3 +1,6 @@ +// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project +// SPDX-License-Identifier: GPL-3.0-or-later + // SPDX-FileCopyrightText: Copyright 2022 yuzu Emulator Project // SPDX-License-Identifier: GPL-3.0-or-later @@ -39,7 +42,8 @@ public: static constexpr u64 BASE_PAGE_SIZE = 1ULL << BASE_PAGE_BITS; explicit BufferBase(VAddr cpu_addr_, u64 size_bytes_) - : cpu_addr{cpu_addr_}, size_bytes{size_bytes_} {} + : cpu_addr_cached{static_cast<DAddr>(cpu_addr_)}, cpu_addr{cpu_addr_}, + size_bytes{size_bytes_} {} explicit BufferBase(NullBufferParams) {} @@ -97,6 +101,8 @@ public: return cpu_addr; } + DAddr cpu_addr_cached = 0; + /// Returns the offset relative to the given CPU address /// @pre IsInBounds returns true [[nodiscard]] u32 Offset(VAddr other_cpu_addr) const noexcept { |
