Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor some descriptor set/allocation things #2357

Merged
merged 3 commits into from
Oct 13, 2023
Merged

Conversation

Rua
Copy link
Contributor

@Rua Rua commented Oct 10, 2023

Changelog:

### Breaking changes
Changes to descriptor sets:
- `DescriptorPool::allocate_descriptor_sets` is now validated, and returns `DescriptorPoolAlloc` objects.
- `DescriptorSetAllocator::allocate` returns `Validated<VulkanError>` as its error type.
- `UnsafeDescriptorSet::update` is now partially validated, and takes slices instead of iterators.
- `UnsafeDescriptorSet` now owns its allocation.

What started off as a simple doc fix got a bit bigger...

This PR makes descriptor set allocation behave a little more like command buffer allocation:

  • UnsafeDescriptorSet now holds onto the allocation, just like UnsafeCommandBuffer.
  • Descriptor pools allocate DescriptorPoolAlloc objects, in the same way that command pools allocate CommandPoolAlloc objects. Both of these types hold information that was passed to the allocate_* function (for descriptor sets, that means the layout and variable count).
  • UnsafeDescriptorSet now validates what it can, but without tracking any state or holding onto any resources, just like UnsafeCommandBufferBuilder.

The DescriptorSetInner type ended up superfluous and was removed altogether.

@marc0246 marc0246 merged commit e007514 into vulkano-rs:master Oct 13, 2023
3 checks passed
marc0246 added a commit that referenced this pull request Oct 13, 2023
@Rua Rua deleted the dpdoc branch October 25, 2023 14:24
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
* Fix the documentation for `DescriptorPool` methods

* Pool allocate validation

* Add `DescriptorPoolAlloc`, make `UnsafeDescriptorSet` more useful
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants