diff --git a/3rdparty/vulkan-headers b/3rdparty/vulkan-headers index 52a76fd0a6..9f4c61a314 160000 --- a/3rdparty/vulkan-headers +++ b/3rdparty/vulkan-headers @@ -1 +1 @@ -Subproject commit 52a76fd0a693708eb8c25bd0ab7a1008091f64d4 +Subproject commit 9f4c61a31435a7a90a314fc68aeb386c92a09c0f diff --git a/common/Vulkan/Context.cpp b/common/Vulkan/Context.cpp index f6c6a41741..33ee58321b 100644 --- a/common/Vulkan/Context.cpp +++ b/common/Vulkan/Context.cpp @@ -450,6 +450,8 @@ namespace Vulkan SupportsExtension(VK_KHR_DRIVER_PROPERTIES_EXTENSION_NAME, false); m_optional_extensions.vk_arm_rasterization_order_attachment_access = SupportsExtension(VK_ARM_RASTERIZATION_ORDER_ATTACHMENT_ACCESS_EXTENSION_NAME, false); + m_optional_extensions.vk_khr_fragment_shader_barycentric = + SupportsExtension(VK_KHR_FRAGMENT_SHADER_BARYCENTRIC_EXTENSION_NAME, false); return true; } diff --git a/common/Vulkan/Context.h b/common/Vulkan/Context.h index 0483e89ab0..74488197c3 100644 --- a/common/Vulkan/Context.h +++ b/common/Vulkan/Context.h @@ -52,6 +52,7 @@ namespace Vulkan bool vk_ext_memory_budget : 1; bool vk_khr_driver_properties : 1; bool vk_arm_rasterization_order_attachment_access : 1; + bool vk_khr_fragment_shader_barycentric : 1; }; ~Context(); diff --git a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp index 4e362ba920..069003f0ce 100644 --- a/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp +++ b/pcsx2/GS/Renderers/Vulkan/GSDeviceVK.cpp @@ -230,7 +230,12 @@ bool GSDeviceVK::CheckFeatures() m_features.texture_barrier = GSConfig.OverrideTextureBarriers != 0; m_features.broken_point_sampler = isAMD; m_features.geometry_shader = features.geometryShader && GSConfig.OverrideGeometryShaders != 0; - m_features.primitive_id = features.fragmentStoresAndAtomics; + // Usually, geometry shader indicates primid support + // However on Metal (MoltenVK), geometry shader is never available, but primid sometimes is + // Officially, it's available on GPUs that support barycentric coordinates (Newer AMD and Apple) + // Unofficially, it seems to work on older Intel GPUs (but breaks other things on newer Intel GPUs, see GSMTLDeviceInfo.mm for details) + // We'll only enable for the officially supported GPUs here. We'll leave in the option of force-enabling it with OverrideGeometryShaders though. + m_features.primitive_id = features.geometryShader || GSConfig.OverrideGeometryShaders == 1 || g_vulkan_context->GetOptionalExtensions().vk_khr_fragment_shader_barycentric; m_features.prefer_new_textures = true; m_features.provoking_vertex_last = g_vulkan_context->GetOptionalExtensions().vk_ext_provoking_vertex; m_features.dual_source_blend = features.dualSrcBlend && !GSConfig.DisableDualSourceBlend;