aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_device.h
diff options
context:
space:
mode:
authorCamilleLaVey <camillelavey99@gmail.com>2026-08-25 20:03:18 +0200
committercrueter <crueter@eden-emu.dev>2026-08-25 20:03:18 +0200
commit0295dc5fff9b2977e753e7c126cc870abb07ee3f (patch)
tree751496ed005803472254a4739b10f4cfb26045d7 /src/video_core/vulkan_common/vulkan_device.h
parent60a474b8df051beb1d5fb84f4363d1576fcbb3fa (diff)
[vulkan] Removal of QCOM sampler limiters + CustomBorderColor and ColorBorderSwizzle adjustments (#4301)
This PR removes the artificial limit added for QCOM drivers based on a sampler budget limit (based on #3280 work), removes the ban on CustomBorderColor/BorderColorSwizzle for also QCOM driver, reduce the amount of combination required to created a sampler with custom border color/ color border swizzle; adds cases on R16 formats not able to swizzle on BGR565 formats; degrades samplers and color combinations when there's no color border swizzle available; fixes the srgb (LUT) values from legacy and now all the color variations are cached in the same key, instead of having 7 different handlers for them. In resume, rather than performance (due to the reduced amount of process on duplicated/ synced code on pipeline/texture cache), it's a graphica accuracy work that will improve image quality at the cost of almost 0 performance hit, rather than certain hitch if the color combination wasn't cached before. This applies to all platform. Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4301 Reviewed-by: Samuel <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.h')
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h32
1 files changed, 18 insertions, 14 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index a0aabea1ad..a33ff5cb26 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -6,6 +6,7 @@
#pragma once
+#include <atomic>
#include <optional>
#include <set>
#include <span>
@@ -699,20 +700,18 @@ FN_MAX_LIMIT_LIST
return features.transform_feedback.geometryStreams;
}
- /// Returns true if the device supports VK_EXT_custom_border_color.
- bool IsExtCustomBorderColorSupported() const {
- return extensions.custom_border_color;
+ /// Returns true if custom border colors can be created without a format.
+ bool IsCustomBorderColorUsable() const {
+ return extensions.custom_border_color &&
+ features.custom_border_color.customBorderColors &&
+ features.custom_border_color.customBorderColorWithoutFormat;
}
- /// Returns true if customBorderColors feature is available.
- bool IsCustomBorderColorsSupported() const {
- return features.custom_border_color.customBorderColors;
- }
+ /// Takes budget for samplers carrying a custom border color, false when exhausted.
+ bool TryReserveCustomBorderColorSamplers(size_t count) const;
- /// Returns true if customBorderColorWithoutFormat feature is available.
- bool IsCustomBorderColorWithoutFormatSupported() const {
- return features.custom_border_color.customBorderColorWithoutFormat;
- }
+ /// Gives back budget taken by TryReserveCustomBorderColorSamplers.
+ void ReleaseCustomBorderColorSamplers(size_t count) const;
/// Returns true if the device supports VK_EXT_color_write_enable.
bool IsExtColorWriteEnableSupported() const {
@@ -724,6 +723,12 @@ FN_MAX_LIMIT_LIST
return extensions.border_color_swizzle;
}
+ /// Returns true if samplers must be carried with border color swizzle mapping.
+ bool NeedsBorderColorSwizzleMapping() const {
+ return extensions.border_color_swizzle &&
+ !features.border_color_swizzle.borderColorSwizzleFromImage;
+ }
+
/// Returns true if borderColorSwizzleFromImage is available.
bool IsBorderColorSwizzleFromImageSupported() const {
return features.border_color_swizzle.borderColorSwizzleFromImage;
@@ -919,8 +924,6 @@ FN_MAX_LIMIT_LIST
return has_broken_parallel_compiling;
}
- std::optional<size_t> GetSamplerHeapBudget() const;
-
/// Returns the vendor name reported from Vulkan.
std::string_view GetVendorName() const {
return properties.driver.driverName;
@@ -1173,6 +1176,7 @@ private:
VkPhysicalDeviceTransformFeedbackPropertiesEXT transform_feedback{};
VkPhysicalDeviceMaintenance5PropertiesKHR maintenance5{};
VkPhysicalDeviceDepthStencilResolveProperties depth_stencil_resolve{};
+ VkPhysicalDeviceCustomBorderColorPropertiesEXT custom_border_color{};
VkPhysicalDeviceProperties properties{};
};
@@ -1211,7 +1215,7 @@ private:
bool dynamic_state3_alpha_to_coverage{};
bool dynamic_state3_alpha_to_one{};
bool supports_conditional_barriers{}; ///< Allows barriers in conditional control flow.
- size_t sampler_heap_budget{}; ///< Sampler budget for buggy drivers (0 = unlimited).
+ mutable std::atomic<size_t> custom_border_color_samplers_used{};
u64 device_access_memory{}; ///< Total size of device local memory in bytes.
u32 sets_per_pool{}; ///< Sets per Description Pool
NvidiaArchitecture nvidia_arch{NvidiaArchitecture::Arch_AmpereOrNewer};