VK: Fixed VRS feature detection. Issue #3549. (#3555)

This commit is contained in:
Branimir Karadžić
2026-01-18 08:26:03 -08:00
committed by GitHub
parent 717475d615
commit 780ef58e97

View File

@@ -1631,6 +1631,25 @@ VK_IMPORT_INSTANCE
}
if (s_extension[Extension::KHR_fragment_shading_rate].m_supported)
{
VkPhysicalDeviceFeatures2KHR deviceFeatures2;
deviceFeatures2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2_KHR;
deviceFeatures2.pNext = NULL;
VkBaseOutStructure* next = (VkBaseOutStructure*)&deviceFeatures2;
next->pNext = (VkBaseOutStructure*)&fragmentShadingRate;
fragmentShadingRate.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR;
fragmentShadingRate.pNext = NULL;
vkGetPhysicalDeviceFeatures2KHR(m_physicalDevice, &deviceFeatures2);
if (!fragmentShadingRate.pipelineFragmentShadingRate
|| !fragmentShadingRate.primitiveFragmentShadingRate)
{
s_extension[Extension::KHR_fragment_shading_rate].m_supported = false;
}
else
{
fragmentShadingRate.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FRAGMENT_SHADING_RATE_FEATURES_KHR;
fragmentShadingRate.pNext = (VkBaseOutStructure*)nextFeatures;
@@ -1640,6 +1659,7 @@ VK_IMPORT_INSTANCE
nextFeatures = &fragmentShadingRate;
}
}
bx::memSet(&m_deviceFeatures, 0, sizeof(m_deviceFeatures) );