diff options
| author | 2023-04-22 11:59:57 +0200 | |
|---|---|---|
| committer | 2023-04-23 22:03:44 +0200 | |
| commit | 7e76c1642cb4dfde5bfc97600ca3df7dcbea01de (patch) | |
| tree | 6d68c31d9588def484be15d84cb54bb2f72af4df | |
| parent | Fence Manager: implement async fence management in a sepparate thread. (diff) | |
| download | yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.gz yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.tar.xz yuzu-7e76c1642cb4dfde5bfc97600ca3df7dcbea01de.zip | |
Accuracy Normal: reduce accuracy further for perf improvements in Project Lime
| -rw-r--r-- | src/core/memory.cpp | 2 | ||||
| -rw-r--r-- | src/video_core/fence_manager.h | 9 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_query_cache.cpp | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 2 |
4 files changed, 11 insertions, 5 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 432310632..a9667463f 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -462,7 +462,7 @@ struct Memory::Impl { | |||
| 462 | } | 462 | } |
| 463 | 463 | ||
| 464 | if (Settings::IsFastmemEnabled()) { | 464 | if (Settings::IsFastmemEnabled()) { |
| 465 | const bool is_read_enable = Settings::IsGPULevelHigh() || !cached; | 465 | const bool is_read_enable = !Settings::IsGPULevelExtreme() || !cached; |
| 466 | system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); | 466 | system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); |
| 467 | } | 467 | } |
| 468 | 468 | ||
diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index 027e663bf..19bbdd547 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h | |||
| @@ -64,19 +64,24 @@ public: | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | void SignalFence(std::function<void()>&& func) { | 66 | void SignalFence(std::function<void()>&& func) { |
| 67 | bool delay_fence = Settings::IsGPULevelHigh(); | ||
| 67 | if constexpr (!can_async_check) { | 68 | if constexpr (!can_async_check) { |
| 68 | TryReleasePendingFences<false>(); | 69 | TryReleasePendingFences<false>(); |
| 69 | } | 70 | } |
| 70 | std::function<void()> callback = std::move(func); | ||
| 71 | const bool should_flush = ShouldFlush(); | 71 | const bool should_flush = ShouldFlush(); |
| 72 | CommitAsyncFlushes(); | 72 | CommitAsyncFlushes(); |
| 73 | TFence new_fence = CreateFence(!should_flush); | 73 | TFence new_fence = CreateFence(!should_flush); |
| 74 | if constexpr (can_async_check) { | 74 | if constexpr (can_async_check) { |
| 75 | guard.lock(); | 75 | guard.lock(); |
| 76 | } | 76 | } |
| 77 | if (delay_fence) { | ||
| 78 | uncommitted_operations.emplace_back(std::move(func)); | ||
| 79 | } | ||
| 77 | pending_operations.emplace_back(std::move(uncommitted_operations)); | 80 | pending_operations.emplace_back(std::move(uncommitted_operations)); |
| 78 | QueueFence(new_fence); | 81 | QueueFence(new_fence); |
| 79 | callback(); | 82 | if (!delay_fence) { |
| 83 | func(); | ||
| 84 | } | ||
| 80 | fences.push(std::move(new_fence)); | 85 | fences.push(std::move(new_fence)); |
| 81 | if (should_flush) { | 86 | if (should_flush) { |
| 82 | rasterizer.FlushCommands(); | 87 | rasterizer.FlushCommands(); |
diff --git a/src/video_core/renderer_vulkan/vk_query_cache.cpp b/src/video_core/renderer_vulkan/vk_query_cache.cpp index 929c8ece6..0701e572b 100644 --- a/src/video_core/renderer_vulkan/vk_query_cache.cpp +++ b/src/video_core/renderer_vulkan/vk_query_cache.cpp | |||
| @@ -98,8 +98,9 @@ HostCounter::HostCounter(QueryCache& cache_, std::shared_ptr<HostCounter> depend | |||
| 98 | query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} { | 98 | query{cache_.AllocateQuery(type_)}, tick{cache_.GetScheduler().CurrentTick()} { |
| 99 | const vk::Device* logical = &cache.GetDevice().GetLogical(); | 99 | const vk::Device* logical = &cache.GetDevice().GetLogical(); |
| 100 | cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { | 100 | cache.GetScheduler().Record([logical, query = query](vk::CommandBuffer cmdbuf) { |
| 101 | const bool use_precise = Settings::IsGPULevelHigh(); | ||
| 101 | logical->ResetQueryPool(query.first, query.second, 1); | 102 | logical->ResetQueryPool(query.first, query.second, 1); |
| 102 | cmdbuf.BeginQuery(query.first, query.second, VK_QUERY_CONTROL_PRECISE_BIT); | 103 | cmdbuf.BeginQuery(query.first, query.second, use_precise ? VK_QUERY_CONTROL_PRECISE_BIT : 0); |
| 103 | }); | 104 | }); |
| 104 | } | 105 | } |
| 105 | 106 | ||
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index 673ab478e..f366fdd2a 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -675,7 +675,7 @@ bool RasterizerVulkan::AccelerateConditionalRendering() { | |||
| 675 | const GPUVAddr condition_address{maxwell3d->regs.render_enable.Address()}; | 675 | const GPUVAddr condition_address{maxwell3d->regs.render_enable.Address()}; |
| 676 | Maxwell::ReportSemaphore::Compare cmp; | 676 | Maxwell::ReportSemaphore::Compare cmp; |
| 677 | if (gpu_memory->IsMemoryDirty(condition_address, sizeof(cmp), | 677 | if (gpu_memory->IsMemoryDirty(condition_address, sizeof(cmp), |
| 678 | VideoCommon::CacheType::BufferCache)) { | 678 | VideoCommon::CacheType::BufferCache | VideoCommon::CacheType::QueryCache)) { |
| 679 | return true; | 679 | return true; |
| 680 | } | 680 | } |
| 681 | return false; | 681 | return false; |