summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2024-01-01 21:02:20 +0100
committerGitHub <noreply@github.com>2024-01-01 21:02:20 +0100
commit15cf34cd628851a673dec37fe7146a1488a70014 (patch)
treea9010922b2072eea8cc1b6701e6a549afd7c8749
parentMerge pull request #12536 from german77/npad_interface (diff)
parentVulkan: Only recreate swapchain if the frame is bigger than the swap image. (diff)
downloadyuzu-15cf34cd628851a673dec37fe7146a1488a70014.tar
yuzu-15cf34cd628851a673dec37fe7146a1488a70014.tar.gz
yuzu-15cf34cd628851a673dec37fe7146a1488a70014.tar.bz2
yuzu-15cf34cd628851a673dec37fe7146a1488a70014.tar.lz
yuzu-15cf34cd628851a673dec37fe7146a1488a70014.tar.xz
yuzu-15cf34cd628851a673dec37fe7146a1488a70014.tar.zst
yuzu-15cf34cd628851a673dec37fe7146a1488a70014.zip
-rw-r--r--src/core/memory.h3
-rw-r--r--src/video_core/engines/maxwell_dma.cpp4
-rw-r--r--src/video_core/renderer_vulkan/vk_present_manager.cpp2
3 files changed, 5 insertions, 4 deletions
diff --git a/src/core/memory.h b/src/core/memory.h
index 3e4d03f57..dddfaf4a4 100644
--- a/src/core/memory.h
+++ b/src/core/memory.h
@@ -686,7 +686,8 @@ public:
} else {
this->m_memory.WriteBlockUnsafe(this->m_addr, this->data(), this->size_bytes());
}
- } else if constexpr (FLAGS & GuestMemoryFlags::Safe) {
+ } else if constexpr ((FLAGS & GuestMemoryFlags::Safe) ||
+ (FLAGS & GuestMemoryFlags::Cached)) {
this->m_memory.InvalidateRegion(this->m_addr, this->size_bytes());
}
}
diff --git a/src/video_core/engines/maxwell_dma.cpp b/src/video_core/engines/maxwell_dma.cpp
index 422d4d859..56fbff306 100644
--- a/src/video_core/engines/maxwell_dma.cpp
+++ b/src/video_core/engines/maxwell_dma.cpp
@@ -228,7 +228,7 @@ void MaxwellDMA::CopyBlockLinearToPitch() {
Core::Memory::GpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead> tmp_read_buffer(
memory_manager, src_operand.address, src_size, &read_buffer);
- Core::Memory::GpuGuestMemoryScoped<u8, Core::Memory::GuestMemoryFlags::SafeReadCachedWrite>
+ Core::Memory::GpuGuestMemoryScoped<u8, Core::Memory::GuestMemoryFlags::UnsafeReadCachedWrite>
tmp_write_buffer(memory_manager, dst_operand.address, dst_size, &write_buffer);
UnswizzleSubrect(tmp_write_buffer, tmp_read_buffer, bytes_per_pixel, width, height, depth,
@@ -292,7 +292,7 @@ void MaxwellDMA::CopyPitchToBlockLinear() {
GPUVAddr dst_addr = regs.offset_out;
Core::Memory::GpuGuestMemory<u8, Core::Memory::GuestMemoryFlags::SafeRead> tmp_read_buffer(
memory_manager, src_addr, src_size, &read_buffer);
- Core::Memory::GpuGuestMemoryScoped<u8, Core::Memory::GuestMemoryFlags::SafeReadCachedWrite>
+ Core::Memory::GpuGuestMemoryScoped<u8, Core::Memory::GuestMemoryFlags::UnsafeReadCachedWrite>
tmp_write_buffer(memory_manager, dst_addr, dst_size, &write_buffer);
// If the input is linear and the output is tiled, swizzle the input and copy it over.
diff --git a/src/video_core/renderer_vulkan/vk_present_manager.cpp b/src/video_core/renderer_vulkan/vk_present_manager.cpp
index 5e7518d96..792ed9615 100644
--- a/src/video_core/renderer_vulkan/vk_present_manager.cpp
+++ b/src/video_core/renderer_vulkan/vk_present_manager.cpp
@@ -329,7 +329,7 @@ void PresentManager::CopyToSwapchainImpl(Frame* frame) {
// to account for that.
const bool is_suboptimal = swapchain.NeedsRecreation();
const bool size_changed =
- swapchain.GetWidth() != frame->width || swapchain.GetHeight() != frame->height;
+ swapchain.GetWidth() < frame->width || swapchain.GetHeight() < frame->height;
if (is_suboptimal || size_changed) {
RecreateSwapchain(frame);
}