From 8a12bf4948295c0b45bfbb56d5245d703795ccba Mon Sep 17 00:00:00 2001 From: pineappleEA Date: Sun, 29 Aug 2021 23:44:59 +0200 Subject: [PATCH] early-access version 2023 --- README.md | 2 +- src/video_core/buffer_cache/buffer_base.h | 4 ++-- .../renderer_vulkan/vk_descriptor_pool.cpp | 5 +++-- src/video_core/vulkan_common/vulkan_device.cpp | 12 ++++++++++++ src/video_core/vulkan_common/vulkan_device.h | 5 +++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index f3dcf2055..e27cc1c54 100755 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ yuzu emulator early access ============= -This is the source code for early-access 2020. +This is the source code for early-access 2023. ## Legal Notice diff --git a/src/video_core/buffer_cache/buffer_base.h b/src/video_core/buffer_cache/buffer_base.h index 18a3390c0..be2113f5a 100755 --- a/src/video_core/buffer_cache/buffer_base.h +++ b/src/video_core/buffer_cache/buffer_base.h @@ -298,11 +298,11 @@ public: } size_t getLRUID() const noexcept { - return lru_id; + return lru_id; } void setLRUID(size_t lru_id_) { - lru_id = lru_id_; + lru_id = lru_id_; } private: diff --git a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp index 8e77e4796..7a5564f37 100755 --- a/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp +++ b/src/video_core/renderer_vulkan/vk_descriptor_pool.cpp @@ -58,11 +58,12 @@ static DescriptorBankInfo MakeBankInfo(std::span infos) { static void AllocatePool(const Device& device, DescriptorBank& bank) { std::array pool_sizes; size_t pool_cursor{}; + const u32 sets_per_pool = device.GetSetsPerPool(); const auto add = [&](VkDescriptorType type, u32 count) { if (count > 0) { pool_sizes[pool_cursor++] = { .type = type, - .descriptorCount = count * SETS_PER_POOL, + .descriptorCount = count * sets_per_pool, }; } }; @@ -77,7 +78,7 @@ static void AllocatePool(const Device& device, DescriptorBank& bank) { .sType = VK_STRUCTURE_TYPE_DESCRIPTOR_POOL_CREATE_INFO, .pNext = nullptr, .flags = VK_DESCRIPTOR_POOL_CREATE_FREE_DESCRIPTOR_SET_BIT, - .maxSets = SETS_PER_POOL, + .maxSets = sets_per_pool, .poolSizeCount = static_cast(pool_cursor), .pPoolSizes = std::data(pool_sizes), })); diff --git a/src/video_core/vulkan_common/vulkan_device.cpp b/src/video_core/vulkan_common/vulkan_device.cpp index 24821c1a3..dad8fb409 100755 --- a/src/video_core/vulkan_common/vulkan_device.cpp +++ b/src/video_core/vulkan_common/vulkan_device.cpp @@ -587,6 +587,13 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR ext_extended_dynamic_state = false; } } + if (ext_sampler_filter_minmax) { + if (driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || + driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE || driver_id == VK_DRIVER_ID_MESA_RADV) { + // Disable ext_sampler_filter_minmax in GCN as it is broken. + ext_sampler_filter_minmax = is_float16_supported; + } + } if (ext_vertex_input_dynamic_state && driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS) { LOG_WARNING(Render_Vulkan, "Blacklisting Intel for VK_EXT_vertex_input_dynamic_state"); ext_vertex_input_dynamic_state = false; @@ -599,6 +606,11 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR graphics_queue = logical.GetQueue(graphics_family); present_queue = logical.GetQueue(present_family); + + sets_per_pool = 64; + if (driver_id == VK_DRIVER_ID_AMD_PROPRIETARY || driver_id == VK_DRIVER_ID_AMD_OPEN_SOURCE) { + sets_per_pool = 96; + } } Device::~Device() = default; diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h index 5599c38c5..bc180a32a 100755 --- a/src/video_core/vulkan_common/vulkan_device.h +++ b/src/video_core/vulkan_common/vulkan_device.h @@ -323,6 +323,10 @@ public: return device_access_memory; } + u32 GetSetsPerPool() const { + return sets_per_pool; + } + private: /// Checks if the physical device is suitable. void CheckSuitability(bool requires_swapchain) const; @@ -376,6 +380,7 @@ private: VkShaderStageFlags guest_warp_stages{}; ///< Stages where the guest warp size can be forced. u64 device_access_memory{}; ///< Total size of device local memory in bytes. u32 max_push_descriptors{}; ///< Maximum number of push descriptors + u32 sets_per_pool{}; ///< Sets per Description Pool bool is_optimal_astc_supported{}; ///< Support for native ASTC. bool is_float16_supported{}; ///< Support for float16 arithmetic. bool is_int8_supported{}; ///< Support for int8 arithmetic.