aboutsummaryrefslogtreecommitdiff
path: root/src/video_core/vulkan_common/vulkan_device.h
diff options
context:
space:
mode:
authorCamilleLaVey <camillelavey99@gmail.com>2026-07-09 04:22:43 +0200
committercrueter <crueter@eden-emu.dev>2026-07-09 04:22:43 +0200
commit8225151a4469a13ac602215dbeb2ce9a3702f38b (patch)
treeca17c9a7f88e3bde78edc6bead17c103289757ca /src/video_core/vulkan_common/vulkan_device.h
parent41762940d6bd6350901f12662248b95b91b51e6c (diff)
[vulkan] 3rd Vulkan Global Maintenance (#4189)
Following the philosophy on the previous Vulkan maintenance PR's, this one is reviewing the video_core to resolve VUID's related to the missing handling/ safechecks (UBO's case on missing StorageBufferAccess 8/16 bits on QCOM drivers, resulting on bad compute pipeline compiled), wiring topology representative to EDS2 configuration (following #4117), refactored the sampled image access via new memeber function for type "typeless" which adds a handling on the integer mistmatch (uint to sint, float to uint) + fixing bugs on current texture sampling (int) including the depth/stencil path resolve, maintenance to previous changes on query cache (resolving bugs from #3853), reduced the amount of binding BindVertexBufferEXT2 when a new tick/ frame is presented (with this being a reason for performance reduction on games where vertex polutes the stage, like BOTW/TOTK where grass is draw with vertex); implemented color border swizzle and color write enable for future improvements on EDS3, added initial implementation on Synchronization2 starting a path to ensure an access to VK 1.3 features safely and other smaller fixes along the road. Special Thanks: -> Mr. Smolio Gidolard (@gidoly) Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/4189
Diffstat (limited to 'src/video_core/vulkan_common/vulkan_device.h')
-rw-r--r--src/video_core/vulkan_common/vulkan_device.h42
1 files changed, 40 insertions, 2 deletions
diff --git a/src/video_core/vulkan_common/vulkan_device.h b/src/video_core/vulkan_common/vulkan_device.h
index 110d0c1199..cf039768fd 100644
--- a/src/video_core/vulkan_common/vulkan_device.h
+++ b/src/video_core/vulkan_common/vulkan_device.h
@@ -43,12 +43,15 @@ VK_DEFINE_HANDLE(VmaAllocator)
FEATURE(EXT, ShaderDemoteToHelperInvocation, SHADER_DEMOTE_TO_HELPER_INVOCATION, \
shader_demote_to_helper_invocation) \
FEATURE(EXT, SubgroupSizeControl, SUBGROUP_SIZE_CONTROL, subgroup_size_control) \
- FEATURE(KHR, Maintenance4, MAINTENANCE_4, maintenance4)
+ FEATURE(KHR, Maintenance4, MAINTENANCE_4, maintenance4) \
+ FEATURE(KHR, Synchronization2, SYNCHRONIZATION_2, synchronization2)
#define FOR_EACH_VK_FEATURE_1_4(FEATURE)
// Define all features which may be used by the implementation and require an extension here.
#define FOR_EACH_VK_FEATURE_EXT(FEATURE) \
+ FEATURE(EXT, BorderColorSwizzle, BORDER_COLOR_SWIZZLE, border_color_swizzle) \
+ FEATURE(EXT, ColorWriteEnable, COLOR_WRITE_ENABLE, color_write_enable) \
FEATURE(EXT, CustomBorderColor, CUSTOM_BORDER_COLOR, custom_border_color) \
FEATURE(EXT, DepthBiasControl, DEPTH_BIAS_CONTROL, depth_bias_control) \
FEATURE(EXT, DepthClipControl, DEPTH_CLIP_CONTROL, depth_clip_control) \
@@ -180,6 +183,7 @@ VK_DEFINE_HANDLE(VmaAllocator)
FEATURE_NAME(robustness2, nullDescriptor) \
FEATURE_NAME(shader_float16_int8, shaderFloat16) \
FEATURE_NAME(shader_float16_int8, shaderInt8) \
+ FEATURE_NAME(synchronization2, synchronization2) \
FEATURE_NAME(timeline_semaphore, timelineSemaphore) \
FEATURE_NAME(transform_feedback, transformFeedback) \
FEATURE_NAME(uniform_buffer_standard_layout, uniformBufferStandardLayout) \
@@ -383,6 +387,16 @@ FN_MAX_LIMIT_LIST
return features.shader_float16_int8.shaderInt8;
}
+ /// Returns true if the device allows 8-bit integer members in uniform/storage buffers.
+ bool IsUniformAndStorageBuffer8BitAccessSupported() const {
+ return features.bit8_storage.uniformAndStorageBuffer8BitAccess;
+ }
+
+ /// Returns true if the device allows 16-bit integer members in uniform/storage buffers.
+ bool IsUniformAndStorageBuffer16BitAccessSupported() const {
+ return features.bit16_storage.uniformAndStorageBuffer16BitAccess;
+ }
+
/// Returns true if the device supports binding multisample images as storage images.
bool IsStorageImageMultisampleSupported() const {
return features.features.shaderStorageImageMultisample;
@@ -509,7 +523,6 @@ FN_MAX_LIMIT_LIST
}
/// Returns true if the device supports VK_EXT_shader_stencil_export.
- /// Note: Most Mali/NVIDIA drivers don't support this. Use hardware blits as fallback.
bool IsExtShaderStencilExportSupported() const {
return extensions.shader_stencil_export;
}
@@ -546,6 +559,11 @@ FN_MAX_LIMIT_LIST
return extensions.subgroup_size_control;
}
+ /// Returns true if vkResetQueryPool (host-side query reset) is supported.
+ bool IsHostQueryResetSupported() const {
+ return features.host_query_reset.hostQueryReset != VK_FALSE;
+ }
+
/// Returns true if the device supports VK_EXT_transform_feedback.
bool IsExtTransformFeedbackSupported() const {
return extensions.transform_feedback;
@@ -582,6 +600,21 @@ FN_MAX_LIMIT_LIST
return features.custom_border_color.customBorderColorWithoutFormat;
}
+ /// Returns true if the device supports VK_EXT_color_write_enable.
+ bool IsExtColorWriteEnableSupported() const {
+ return extensions.color_write_enable;
+ }
+
+ /// Returns true if the device supports VK_EXT_border_color_swizzle.
+ bool IsExtBorderColorSwizzleSupported() const {
+ return extensions.border_color_swizzle;
+ }
+
+ /// Returns true if borderColorSwizzleFromImage is available.
+ bool IsBorderColorSwizzleFromImageSupported() const {
+ return features.border_color_swizzle.borderColorSwizzleFromImage;
+ }
+
/// Returns true if the device supports VK_EXT_extended_dynamic_state.
bool IsExtExtendedDynamicStateSupported() const {
return extensions.extended_dynamic_state;
@@ -722,6 +755,11 @@ FN_MAX_LIMIT_LIST
bool HasTimelineSemaphore() const;
+ /// Returns true if the device supports VK_KHR_synchronization2.
+ bool HasSynchronization2() const {
+ return extensions.synchronization2;
+ }
+
/// Returns the minimum supported version of SPIR-V.
u32 SupportedSpirvVersion() const {
if (instance_version >= VK_API_VERSION_1_3) {