mirror of
https://github.com/love2d/love.git
synced 2026-08-14 01:20:56 +02:00
vulkan: correct usage of pNext chain for device
For systems where VK_EXT_extended_dynamic_state is not supported it is not valid to extend VkDeviceCreateInfo with an unknown struct. Todo: if more extensions are supported in the future this code probably needs adjustments to correctly build a pNext chain.
This commit is contained in:
@@ -1647,10 +1647,11 @@ void Graphics::createLogicalDevice()
|
||||
|
||||
VkPhysicalDeviceExtendedDynamicStateFeaturesEXT extendedDynamicStateFeatures{};
|
||||
extendedDynamicStateFeatures.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_EXTENDED_DYNAMIC_STATE_FEATURES_EXT;
|
||||
extendedDynamicStateFeatures.extendedDynamicState = Vulkan::getBool(optionalDeviceExtensions.extendedDynamicState);
|
||||
extendedDynamicStateFeatures.extendedDynamicState = VK_TRUE;
|
||||
extendedDynamicStateFeatures.pNext = nullptr;
|
||||
|
||||
createInfo.pNext = &extendedDynamicStateFeatures;
|
||||
if (optionalDeviceExtensions.extendedDynamicState)
|
||||
createInfo.pNext = &extendedDynamicStateFeatures;
|
||||
|
||||
if (vkCreateDevice(physicalDevice, &createInfo, nullptr, &device) != VK_SUCCESS)
|
||||
throw love::Exception("failed to create logical device");
|
||||
|
||||
Reference in New Issue
Block a user