Repository navigation
Refactor chaining of DeviceCreateInfo - #1588
asuessenbach wants to merge 1 commit into
Conversation
6cdbddf to
251d24c
Compare
|
Apple builds are failing because several |
| ApiVulkanSample::submit_frame(); | ||
| } | ||
|
|
||
| void BufferDeviceAddress::extend_device_create_info(vkb::StructureChainBuilderC<VkDeviceCreateInfo> &scb) |
There was a problem hiding this comment.
This reads much harder then the old code :/
E.g. why is that assert(create_info) needed now?
There was a problem hiding this comment.
E.g. why is that assert(create_info) needed now?
I think I don't get what you're asking for...
Before I use a pointer, I tend to check its validity. If it's allowed to be a nullptr, I'm using a runtime-check. Otherwise, when a nullptr would be a hint for a programming error, I'm using an assert.
This reads much harder then the old code :/
That may be true. But I think this way is safer.
Previously, the structure chain was controlled by vkb::core::PhysicalDevice just to create the vkb::core::Device. Now this chain is built as needed, making its handling more localized. And there’s now exactly one place in the code where you can extend it. This way, there’s no room for ambiguity.
And as a side effect—but this is exactly why I initiated this PR—vkb::core::PhysicalDevice is now a bit less complex.
251d24c to
2b3d208
Compare
2b3d208 to
6fd5496
Compare
Description
Analogous to the structure chain handling for instance creation on InstanceCreateInfo, this PR uses the StructureChainBuilder to chain the handling for device creation on DeviceCreateInfo, introducing a dedicated function where and when to do that:
vkb::VulkanSample::extend_device_create_infovkb::core::Deviceconstructorvkb::core::PhysicalDevice, as it's not used any more to gather and store that structure chainrequest_optional_featureandrequest_required_featureof thevkb::core::PhysicalDevicehave changed and renamed toenable_optional_featureandenable_required_feature, respectivelyREQUEST_OPTIONAL_FEATUREandREQUEST_REQUIRED_FEATUREare renamed toENABLE_OPTIONAL_FEATUREandENABLE_REQUIRED_FEATUREvkb::PhysicalDevice::get_featuresis renamed tovkb::PhysicalDevice::get_supported_features, being a better companion tovkb::PhysicalDevice::get_requested_featuresvkb::StructureChainBuilder::set_feature_flagis added that handles setting a specific flag in a specific class in the structure chain, potentially adding that struct if needed.Build tested on Win11 with VS2026. Run tested on Win11 with NVidia GPU.
General Checklist:
Please ensure the following points are checked:
Note: The Samples CI runs a number of checks including:
If this PR contains framework changes:
batchcommand line argument to make sure all samples still work properlySample Checklist
If your PR contains a new or modified sample, these further checks must be carried out in addition to the General Checklist: