From 6e882c92b240d5d6d4fd0a226caaa246ebd8b5fd Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Wed, 5 Jul 2023 07:00:43 +0200 Subject: [PATCH] early-access version 3740 --- README.md | 2 +- src/common/scratch_buffer.h | 17 +++++++++++++++-- src/video_core/vulkan_common/vulkan_device.cpp | 17 +++++++++++++++-- src/video_core/vulkan_common/vulkan_device.h | 8 +------- 4 files changed, 32 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 20c83cb34..718d5a63b 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 3739. +This is the source code for early-access 3740. ## Legal Notice diff --git a/src/common/scratch_buffer.h b/src/common/scratch_buffer.h index d5961b020..2a98cda53 100755 --- a/src/common/scratch_buffer.h +++ b/src/common/scratch_buffer.h @@ -40,8 +40,21 @@ public: ~ScratchBuffer() = default; ScratchBuffer(const ScratchBuffer&) = delete; ScratchBuffer& operator=(const ScratchBuffer&) = delete; - ScratchBuffer(ScratchBuffer&&) = default; - ScratchBuffer& operator=(ScratchBuffer&&) = default; + + ScratchBuffer(ScratchBuffer&& other) noexcept { + swap(other); + other.last_requested_size = 0; + other.buffer_capacity = 0; + other.buffer.reset(); + } + + ScratchBuffer& operator=(ScratchBuffer&& other) noexcept { + swap(other); + other.last_requested_size = 0; + other.buffer_capacity = 0; + other.buffer.reset(); + return *this; + } /// This will only grow the buffer's capacity if size is greater than the current capacity. /// The previously held data will remain intact. diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index a5a7c1c10..266366e7d 100755 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -500,7 +500,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR } if (extensions.extended_dynamic_state2 && is_qualcomm) { const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0)) { + if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) && + version < VK_MAKE_API_VERSION(0, 0, 680, 0)) { // Qualcomm Adreno 7xx drivers do not properly support extended_dynamic_state2. LOG_WARNING(Render_Vulkan, "Qualcomm Adreno 7xx drivers have broken VK_EXT_extended_dynamic_state2"); @@ -540,7 +541,8 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR } if (extensions.vertex_input_dynamic_state && is_qualcomm) { const u32 version = (properties.properties.driverVersion << 3) >> 3; - if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0)) { + if (version >= VK_MAKE_API_VERSION(0, 0, 676, 0) && + version < VK_MAKE_API_VERSION(0, 0, 680, 0)) { // Qualcomm Adreno 7xx drivers do not properly support vertex_input_dynamic_state. LOG_WARNING( Render_Vulkan, @@ -798,6 +800,17 @@ bool Device::ShouldBoostClocks() const { return validated_driver && !is_steam_deck && !is_debugging; } +bool Device::HasTimelineSemaphore() const { + if (GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY || + GetDriverID() == VK_DRIVER_ID_MESA_TURNIP) { + // Timeline semaphores do not work properly on all Qualcomm drivers. + // They generally work properly with Turnip drivers, but are problematic on some devices + // (e.g. ZTE handsets with Snapdragon 870). + return false; + } + return features.timeline_semaphore.timelineSemaphore; +} + bool Device::GetSuitability(bool requires_swapchain) { // Assume we will be suitable. bool suitable = true; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 37c999020..8e51a9a88 100755 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -528,13 +528,7 @@ public: return extensions.shader_atomic_int64; } - bool HasTimelineSemaphore() const { - if (GetDriverID() == VK_DRIVER_ID_QUALCOMM_PROPRIETARY) { - // Timeline semaphores do not work properly on all Qualcomm drivers. - return false; - } - return features.timeline_semaphore.timelineSemaphore; - } + bool HasTimelineSemaphore() const; /// Returns the minimum supported version of SPIR-V. u32 SupportedSpirvVersion() const {