Add pNext as optional last argument to constructors of structs that hold a pNext.

This commit is contained in:
asuessenbach
2022-03-23 17:08:19 +01:00
parent efcb07a591
commit d90c6cbbfc
7 changed files with 3307 additions and 1744 deletions

View File

@@ -52,7 +52,7 @@ int main( int /*argc*/, char ** /*argv*/ )
<< "subsetAllocation = " << !!groupProperties[i].subsetAllocation << "\n";
std::cout << "\n";
if ( 1 < groupProperties[i].physicalDeviceCount )
if ( 0 < groupProperties[i].physicalDeviceCount )
{
vk::PhysicalDevice physicalDevice = groupProperties[i].physicalDevices[0];
@@ -69,12 +69,10 @@ int main( int /*argc*/, char ** /*argv*/ )
// create a Device
float queuePriority = 0.0f;
vk::DeviceQueueCreateInfo deviceQueueCreateInfo( vk::DeviceQueueCreateFlags(), static_cast<uint32_t>( graphicsQueueFamilyIndex ), 1, &queuePriority );
vk::DeviceCreateInfo deviceCreateInfo( vk::DeviceCreateFlags(), deviceQueueCreateInfo );
vk::StructureChain<vk::DeviceCreateInfo, vk::DeviceGroupDeviceCreateInfo> deviceCreateInfoChain(
{ {}, deviceQueueCreateInfo }, { groupProperties[i].physicalDeviceCount, groupProperties[i].physicalDevices } );
vk::DeviceGroupDeviceCreateInfo deviceGroupDeviceCreateInfo( groupProperties[i].physicalDeviceCount, groupProperties[i].physicalDevices );
deviceCreateInfo.pNext = &deviceGroupDeviceCreateInfo;
vk::Device device = physicalDevice.createDevice( deviceCreateInfo );
vk::Device device = physicalDevice.createDevice( deviceCreateInfoChain.get<vk::DeviceCreateInfo>() );
// ... and destroy it again
device.destroy();