vulkan_device: Use designated initializers for features

This commit is contained in:
ReinUsesLisp 2021-01-16 20:38:20 -03:00
parent 79afdeaf08
commit 1a987054c5

View File

@ -191,22 +191,17 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
const vk::InstanceDispatch& dld_)
: instance{instance_}, dld{dld_}, physical{physical_}, properties{physical.GetProperties()},
format_properties{GetFormatProperties(physical)} {
CheckSuitability();
CheckSuitability(surface != nullptr);
SetupFamilies(surface);
SetupFeatures();
const auto queue_cis = GetDeviceQueueCreateInfos();
const std::vector extensions = LoadExtensions();
const std::vector extensions = LoadExtensions(surface != nullptr);
VkPhysicalDeviceFeatures2 features2{
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_FEATURES_2,
.pNext = nullptr,
.features{},
};
const void* first_next = &features2;
void** next = &features2.pNext;
features2.features = {
.features{
.robustBufferAccess = false,
.fullDrawIndexUint32 = false,
.imageCubeArray = true,
@ -262,7 +257,11 @@ Device::Device(VkInstance instance_, vk::PhysicalDevice physical_, VkSurfaceKHR
.sparseResidencyAliased = false,
.variableMultisampleRate = false,
.inheritedQueries = false,
},
};
const void* first_next = &features2;
void** next = &features2.pNext;
VkPhysicalDeviceTimelineSemaphoreFeaturesKHR timeline_semaphore{
.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_TIMELINE_SEMAPHORE_FEATURES_KHR,
.pNext = nullptr,