diff options
| author | 2023-05-04 03:16:57 +0200 | |
|---|---|---|
| committer | 2023-05-07 23:46:12 +0200 | |
| commit | 6f90dff2938b5bd5e9311e924e8a29945f16ac18 (patch) | |
| tree | 60d757ecc85615cf846b20a8d392261645a997ab | |
| parent | Query cache: stop updating pages as it's not affected by cpu writes (diff) | |
| download | yuzu-6f90dff2938b5bd5e9311e924e8a29945f16ac18.tar.gz yuzu-6f90dff2938b5bd5e9311e924e8a29945f16ac18.tar.xz yuzu-6f90dff2938b5bd5e9311e924e8a29945f16ac18.zip | |
Address feedback, add CR notice, etc
| -rw-r--r-- | src/core/memory.cpp | 11 | ||||
| -rw-r--r-- | src/video_core/fence_manager.h | 7 | ||||
| -rw-r--r-- | src/video_core/rasterizer_download_area.h | 3 | ||||
| -rw-r--r-- | src/video_core/renderer_vulkan/vk_rasterizer.cpp | 4 | ||||
| -rw-r--r-- | src/video_core/texture_cache/image_view_base.cpp | 3 |
5 files changed, 18 insertions, 10 deletions
diff --git a/src/core/memory.cpp b/src/core/memory.cpp index 549b64ac4..514ba0d66 100644 --- a/src/core/memory.cpp +++ b/src/core/memory.cpp | |||
| @@ -20,7 +20,6 @@ | |||
| 20 | #include "video_core/gpu.h" | 20 | #include "video_core/gpu.h" |
| 21 | #include "video_core/rasterizer_download_area.h" | 21 | #include "video_core/rasterizer_download_area.h" |
| 22 | 22 | ||
| 23 | |||
| 24 | namespace Core::Memory { | 23 | namespace Core::Memory { |
| 25 | 24 | ||
| 26 | // Implementation class used to keep the specifics of the memory subsystem hidden | 25 | // Implementation class used to keep the specifics of the memory subsystem hidden |
| @@ -465,7 +464,8 @@ struct Memory::Impl { | |||
| 465 | } | 464 | } |
| 466 | 465 | ||
| 467 | if (Settings::IsFastmemEnabled()) { | 466 | if (Settings::IsFastmemEnabled()) { |
| 468 | const bool is_read_enable = !Settings::values.use_reactive_flushing.GetValue() || !cached; | 467 | const bool is_read_enable = |
| 468 | !Settings::values.use_reactive_flushing.GetValue() || !cached; | ||
| 469 | system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); | 469 | system.DeviceMemory().buffer.Protect(vaddr, size, is_read_enable, !cached); |
| 470 | } | 470 | } |
| 471 | 471 | ||
| @@ -654,9 +654,7 @@ struct Memory::Impl { | |||
| 654 | LOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:016X}", sizeof(T) * 8, | 654 | LOG_ERROR(HW_Memory, "Unmapped Read{} @ 0x{:016X}", sizeof(T) * 8, |
| 655 | GetInteger(vaddr)); | 655 | GetInteger(vaddr)); |
| 656 | }, | 656 | }, |
| 657 | [&]() { | 657 | [&]() { HandleRasterizerDownload(GetInteger(vaddr), sizeof(T)); }); |
| 658 | HandleRasterizerDownload(GetInteger(vaddr), sizeof(T)); | ||
| 659 | }); | ||
| 660 | if (ptr) { | 658 | if (ptr) { |
| 661 | std::memcpy(&result, ptr, sizeof(T)); | 659 | std::memcpy(&result, ptr, sizeof(T)); |
| 662 | } | 660 | } |
| @@ -721,7 +719,8 @@ struct Memory::Impl { | |||
| 721 | const size_t core = system.GetCurrentHostThreadID(); | 719 | const size_t core = system.GetCurrentHostThreadID(); |
| 722 | auto& current_area = rasterizer_areas[core]; | 720 | auto& current_area = rasterizer_areas[core]; |
| 723 | const VAddr end_address = address + size; | 721 | const VAddr end_address = address + size; |
| 724 | if (current_area.start_address <= address && end_address <= current_area.end_address) [[likely]] { | 722 | if (current_area.start_address <= address && end_address <= current_area.end_address) |
| 723 | [[likely]] { | ||
| 725 | return; | 724 | return; |
| 726 | } | 725 | } |
| 727 | current_area = system.GPU().OnCPURead(address, size); | 726 | current_area = system.GPU().OnCPURead(address, size); |
diff --git a/src/video_core/fence_manager.h b/src/video_core/fence_manager.h index 850d6f27d..35d699bbf 100644 --- a/src/video_core/fence_manager.h +++ b/src/video_core/fence_manager.h | |||
| @@ -55,7 +55,12 @@ public: | |||
| 55 | 55 | ||
| 56 | // Unlike other fences, this one doesn't | 56 | // Unlike other fences, this one doesn't |
| 57 | void SignalOrdering() { | 57 | void SignalOrdering() { |
| 58 | std::function<void()> do_nothing([]{}); | 58 | std::scoped_lock lock{buffer_cache.mutex}; |
| 59 | buffer_cache.AccumulateFlushes(); | ||
| 60 | } | ||
| 61 | |||
| 62 | void SignalReference() { | ||
| 63 | std::function<void()> do_nothing([] {}); | ||
| 59 | SignalFence(std::move(do_nothing)); | 64 | SignalFence(std::move(do_nothing)); |
| 60 | } | 65 | } |
| 61 | 66 | ||
diff --git a/src/video_core/rasterizer_download_area.h b/src/video_core/rasterizer_download_area.h index 771ce903d..2d7425c79 100644 --- a/src/video_core/rasterizer_download_area.h +++ b/src/video_core/rasterizer_download_area.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | // SPDX-FileCopyrightText: Copyright 2023 yuzu Emulator Project | ||
| 2 | // SPDX-License-Identifier: GPL-3.0-or-later | ||
| 3 | |||
| 1 | #pragma once | 4 | #pragma once |
| 2 | 5 | ||
| 3 | #include "common/common_types.h" | 6 | #include "common/common_types.h" |
diff --git a/src/video_core/renderer_vulkan/vk_rasterizer.cpp b/src/video_core/renderer_vulkan/vk_rasterizer.cpp index bae4aa611..2beb0efea 100644 --- a/src/video_core/renderer_vulkan/vk_rasterizer.cpp +++ b/src/video_core/renderer_vulkan/vk_rasterizer.cpp | |||
| @@ -621,7 +621,7 @@ void RasterizerVulkan::SignalSyncPoint(u32 value) { | |||
| 621 | } | 621 | } |
| 622 | 622 | ||
| 623 | void RasterizerVulkan::SignalReference() { | 623 | void RasterizerVulkan::SignalReference() { |
| 624 | fence_manager.SignalOrdering(); | 624 | fence_manager.SignalReference(); |
| 625 | } | 625 | } |
| 626 | 626 | ||
| 627 | void RasterizerVulkan::ReleaseFences() { | 627 | void RasterizerVulkan::ReleaseFences() { |
| @@ -654,7 +654,7 @@ void RasterizerVulkan::WaitForIdle() { | |||
| 654 | cmdbuf.SetEvent(event, flags); | 654 | cmdbuf.SetEvent(event, flags); |
| 655 | cmdbuf.WaitEvents(event, flags, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, {}, {}, {}); | 655 | cmdbuf.WaitEvents(event, flags, VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, {}, {}, {}); |
| 656 | }); | 656 | }); |
| 657 | SignalReference(); | 657 | fence_manager.SignalOrdering(); |
| 658 | } | 658 | } |
| 659 | 659 | ||
| 660 | void RasterizerVulkan::FragmentBarrier() { | 660 | void RasterizerVulkan::FragmentBarrier() { |
diff --git a/src/video_core/texture_cache/image_view_base.cpp b/src/video_core/texture_cache/image_view_base.cpp index 30a7c11f5..c3b2b196d 100644 --- a/src/video_core/texture_cache/image_view_base.cpp +++ b/src/video_core/texture_cache/image_view_base.cpp | |||
| @@ -26,7 +26,8 @@ ImageViewBase::ImageViewBase(const ImageViewInfo& info, const ImageInfo& image_i | |||
| 26 | ASSERT_MSG(VideoCore::Surface::IsViewCompatible(image_info.format, info.format, false, true), | 26 | ASSERT_MSG(VideoCore::Surface::IsViewCompatible(image_info.format, info.format, false, true), |
| 27 | "Image view format {} is incompatible with image format {}", info.format, | 27 | "Image view format {} is incompatible with image format {}", info.format, |
| 28 | image_info.format); | 28 | image_info.format); |
| 29 | const bool preemptive = !Settings::values.use_reactive_flushing.GetValue() && image_info.type == ImageType::Linear; | 29 | const bool preemptive = |
| 30 | !Settings::values.use_reactive_flushing.GetValue() && image_info.type == ImageType::Linear; | ||
| 30 | if (image_info.forced_flushed || preemptive) { | 31 | if (image_info.forced_flushed || preemptive) { |
| 31 | flags |= ImageViewFlagBits::PreemtiveDownload; | 32 | flags |= ImageViewFlagBits::PreemtiveDownload; |
| 32 | } | 33 | } |