diff options
| author | 2020-04-05 19:26:15 -0400 | |
|---|---|---|
| committer | 2020-04-06 09:23:08 -0400 | |
| commit | f9d5718c4b223c35b8ccd136700e14cb6751078a (patch) | |
| tree | 34da40f2bcc237a40d178711f615b77079cf18a4 /src | |
| parent | Shader/Pipeline Cache: Use VAddr instead of physical memory for addressing. (diff) | |
| download | yuzu-f9d5718c4b223c35b8ccd136700e14cb6751078a.tar.gz yuzu-f9d5718c4b223c35b8ccd136700e14cb6751078a.tar.xz yuzu-f9d5718c4b223c35b8ccd136700e14cb6751078a.zip | |
Clang Format.
Diffstat (limited to 'src')
| -rw-r--r-- | src/video_core/query_cache.h | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/video_core/query_cache.h b/src/video_core/query_cache.h index 84cbe93f6..5ea2b01f2 100644 --- a/src/video_core/query_cache.h +++ b/src/video_core/query_cache.h | |||
| @@ -117,12 +117,10 @@ public: | |||
| 117 | void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) { | 117 | void Query(GPUVAddr gpu_addr, VideoCore::QueryType type, std::optional<u64> timestamp) { |
| 118 | std::unique_lock lock{mutex}; | 118 | std::unique_lock lock{mutex}; |
| 119 | auto& memory_manager = system.GPU().MemoryManager(); | 119 | auto& memory_manager = system.GPU().MemoryManager(); |
| 120 | const std::optional<VAddr> cpu_addr_opt = | 120 | const std::optional<VAddr> cpu_addr_opt = memory_manager.GpuToCpuAddress(gpu_addr); |
| 121 | memory_manager.GpuToCpuAddress(gpu_addr); | ||
| 122 | ASSERT(cpu_addr_opt); | 121 | ASSERT(cpu_addr_opt); |
| 123 | VAddr cpu_addr = *cpu_addr_opt; | 122 | VAddr cpu_addr = *cpu_addr_opt; |
| 124 | 123 | ||
| 125 | |||
| 126 | CachedQuery* query = TryGet(cpu_addr); | 124 | CachedQuery* query = TryGet(cpu_addr); |
| 127 | if (!query) { | 125 | if (!query) { |
| 128 | ASSERT_OR_EXECUTE(cpu_addr_opt, return;); | 126 | ASSERT_OR_EXECUTE(cpu_addr_opt, return;); |
| @@ -221,9 +219,8 @@ private: | |||
| 221 | return nullptr; | 219 | return nullptr; |
| 222 | } | 220 | } |
| 223 | auto& contents = it->second; | 221 | auto& contents = it->second; |
| 224 | const auto found = | 222 | const auto found = std::find_if(std::begin(contents), std::end(contents), |
| 225 | std::find_if(std::begin(contents), std::end(contents), | 223 | [addr](auto& query) { return query.GetCpuAddr() == addr; }); |
| 226 | [addr](auto& query) { return query.GetCpuAddr() == addr; }); | ||
| 227 | return found != std::end(contents) ? &*found : nullptr; | 224 | return found != std::end(contents) ? &*found : nullptr; |
| 228 | } | 225 | } |
| 229 | 226 | ||