GS/Vulkan: Make primid not require barycentric extension

This commit is contained in:
Stenzek 2023-04-29 16:01:12 +10:00 committed by refractionpcsx2
parent a5ed24ca88
commit ec41af760a

View File

@ -692,12 +692,14 @@ bool GSDeviceVK::CheckFeatures()
m_features.framebuffer_fetch = g_vulkan_context->GetOptionalExtensions().vk_ext_rasterization_order_attachment_access && !GSConfig.DisableFramebufferFetch;
m_features.texture_barrier = GSConfig.OverrideTextureBarriers != 0;
m_features.broken_point_sampler = isAMD;
// Usually, geometry shader indicates primid support
// However on Metal (MoltenVK), geometry shader is never available, but primid sometimes is
#ifdef __APPLE__
// On Metal (MoltenVK), primid is sometimes available, but broken on some older GPUs and MacOS versions.
// 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 || g_vulkan_context->GetOptionalExtensions().vk_khr_fragment_shader_barycentric;
m_features.primitive_id = g_vulkan_context->GetOptionalExtensions().vk_khr_fragment_shader_barycentric;
#else
m_features.primitive_id = true;
#endif
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;