Manager: forward optional VkPhysicalDeviceFeatures2 pNext chain to VkDeviceCreateInfo#457
Open
mgajda wants to merge 1 commit intoKomputeProject:masterfrom
Open
Manager: forward optional VkPhysicalDeviceFeatures2 pNext chain to VkDeviceCreateInfo#457mgajda wants to merge 1 commit intoKomputeProject:masterfrom
mgajda wants to merge 1 commit intoKomputeProject:masterfrom
Conversation
Author
This was referenced Apr 20, 2026
Author
|
Superseded by #462 — same fix in 16 lines instead of 92, no API change. |
Author
|
Sorry — closed by mistake, this PR is about forwarding the features2 pNext chain, not the queue-family fix. Reopening. |
4298b7d to
7064d72
Compare
Add an optional `desiredFeaturesChain` pointer to `Manager`'s configured constructor and `createDevice`. When non-null it is forwarded to `VkDeviceCreateInfo::pNext`, so callers can enable extension-gated features such as `VkPhysicalDeviceShaderAtomicFloatFeaturesEXT::shaderBufferFloat32AtomicAdd` without bypassing Manager. Backward compatible: the new parameter defaults to `nullptr`, so existing call sites are unaffected. Caller owns the struct(s) and must keep them alive for the duration of the Manager constructor.
7064d72 to
4c760da
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Extends
kp::Manager's configured constructor (and the internalcreateDevice) with an optionalconst void* desiredFeaturesChainparameter. When non-null it is forwarded to
VkDeviceCreateInfo::pNext, enabling callers to opt in toextension-gated features such as
VkPhysicalDeviceShaderAtomicFloatFeaturesEXT::shaderBufferFloat32AtomicAddor any other feature struct chain the application needs.
Without this, even if
VK_EXT_shader_atomic_floatis passed throughthe existing
desiredExtensionslist, pipeline creation rejectsSPIR-V that uses
OpAtomicFAddon storage buffers because thecorresponding feature bit is never enabled.
The parameter defaults to
nullptr, so all existing call sitescompile and behave exactly as before. Ownership remains with the
caller — Manager only reads the pointer during
VkDeviceCreateInfoconfiguration and does not store it.
Motivation
Kompute currently requires
subclassing
Manageror reaching directly into the sharedvk::Deviceto reconfigure it, which defeats the point of theManager abstraction. This small hook lets those workloads stay on
the stock Manager.
Notes
Happy to add a small example under
examples/showing the feature-chainidiom if that's desired — didn't include one here to keep the diff
minimal and reviewable. Also happy to narrow the API to a typed
vk::PhysicalDeviceFeatures2*if the maintainers prefer that over araw
const void*; I chose the latter so callers can supply anypNext-chainable struct without Manager having to know about it.