Enable the fault feature
This commit is contained in:
parent
c923ed233e
commit
af6ec41477
4 changed files with 14 additions and 1 deletions
|
|
@ -34,6 +34,7 @@ public:
|
|||
VkPhysicalDeviceAccelerationStructureFeaturesKHR AccelerationStructure = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_ACCELERATION_STRUCTURE_FEATURES_KHR };
|
||||
VkPhysicalDeviceRayQueryFeaturesKHR RayQuery = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_RAY_QUERY_FEATURES_KHR };
|
||||
VkPhysicalDeviceDescriptorIndexingFeatures DescriptorIndexing = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DESCRIPTOR_INDEXING_FEATURES_EXT };
|
||||
VkPhysicalDeviceFaultFeaturesEXT Fault = { VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FAULT_FEATURES_EXT };
|
||||
};
|
||||
|
||||
class VulkanDeviceProperties
|
||||
|
|
|
|||
|
|
@ -1783,6 +1783,7 @@ std::vector<VulkanCompatibleDevice> VulkanDeviceBuilder::FindDevices(const std::
|
|||
enabledFeatures.DescriptorIndexing.descriptorBindingSampledImageUpdateAfterBind = deviceFeatures.DescriptorIndexing.descriptorBindingSampledImageUpdateAfterBind;
|
||||
enabledFeatures.DescriptorIndexing.descriptorBindingVariableDescriptorCount = deviceFeatures.DescriptorIndexing.descriptorBindingVariableDescriptorCount;
|
||||
enabledFeatures.DescriptorIndexing.shaderSampledImageArrayNonUniformIndexing = deviceFeatures.DescriptorIndexing.shaderSampledImageArrayNonUniformIndexing;
|
||||
enabledFeatures.Fault.deviceFault = deviceFeatures.Fault.deviceFault;
|
||||
|
||||
// Figure out which queue can present
|
||||
if (surface)
|
||||
|
|
|
|||
|
|
@ -136,6 +136,11 @@ void VulkanDevice::CreateDevice()
|
|||
*next = &EnabledFeatures.DescriptorIndexing;
|
||||
next = &EnabledFeatures.DescriptorIndexing.pNext;
|
||||
}
|
||||
if (SupportsExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME))
|
||||
{
|
||||
*next = &EnabledFeatures.Fault;
|
||||
next = &EnabledFeatures.Fault.pNext;
|
||||
}
|
||||
|
||||
VkResult result = vkCreateDevice(PhysicalDevice.Device, &deviceCreateInfo, nullptr, &device);
|
||||
CheckVulkanError(result, "Could not create vulkan device");
|
||||
|
|
@ -174,7 +179,7 @@ void VulkanDevice::SetObjectName(const char* name, uint64_t handle, VkObjectType
|
|||
|
||||
VulkanDeviceFaultInfo VulkanDevice::GetDeviceFaultInfo()
|
||||
{
|
||||
if (!SupportsExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME))
|
||||
if (!SupportsExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME) || !EnabledFeatures.Fault.deviceFault)
|
||||
return {};
|
||||
|
||||
VkDeviceFaultCountsEXT counts = { VK_STRUCTURE_TYPE_DEVICE_FAULT_COUNTS_EXT };
|
||||
|
|
|
|||
|
|
@ -297,6 +297,11 @@ std::vector<VulkanPhysicalDevice> VulkanInstance::GetPhysicalDevices(VkInstance
|
|||
*next = &dev.Features.DescriptorIndexing;
|
||||
next = &dev.Features.DescriptorIndexing.pNext;
|
||||
}
|
||||
if (checkForExtension(VK_EXT_DEVICE_FAULT_EXTENSION_NAME))
|
||||
{
|
||||
*next = &dev.Features.Fault;
|
||||
next = &dev.Features.Fault.pNext;
|
||||
}
|
||||
|
||||
vkGetPhysicalDeviceFeatures2(dev.Device, &deviceFeatures2);
|
||||
dev.Features.Features = deviceFeatures2.features;
|
||||
|
|
@ -304,6 +309,7 @@ std::vector<VulkanPhysicalDevice> VulkanInstance::GetPhysicalDevices(VkInstance
|
|||
dev.Features.AccelerationStructure.pNext = nullptr;
|
||||
dev.Features.RayQuery.pNext = nullptr;
|
||||
dev.Features.DescriptorIndexing.pNext = nullptr;
|
||||
dev.Features.Fault.pNext = nullptr;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue