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

Replace ImageAccess::descriptor_layouts() #2197

Merged
merged 6 commits into from
May 3, 2023

Conversation

Rua
Copy link
Contributor

@Rua Rua commented May 1, 2023

Changelog

### Breaking changes
- The `buffer_with_range(_array)` constructor of `WriteDescriptorSet` now takes `DescriptorBufferInfo` structs.
- Removed the `descriptor_layouts` method on the `ImageAccess` trait. All images by default now use the `General` layout for storage image descriptors, and `ShaderReadOnlyOptimal` for all other image descriptors.

### Additions
- Added `image_view_with_layout(_array)` and `image_view_with_layout_sampler(_array)` constructors to `WriteDescriptorSet`, which let you control the image layouts used for image views bound to a descriptor.

This gets rid of one of the last methods of ImageAccess, to help with the image unification. The image layout is now included in the WriteDescriptorSet element definitions, and there's new constructors to specify it.

@Rua Rua requested a review from marc0246 May 1, 2023 19:10
@Rua Rua marked this pull request as ready for review May 2, 2023 17:49
@marc0246
Copy link
Contributor

marc0246 commented May 3, 2023

The issue with trying stay close to Vulkan is that VkDescriptorImageInfo is a union in disguise. So we can't model it after the original API, at least not in any idiomatic capacity. There's a lot of inconsistency now with when info-structs are used and when not. I've been thinking about it for a while but I'm not sure what the best approach is.

@Rua
Copy link
Contributor Author

Rua commented May 3, 2023

I solved it in the end by making image + sampler a tuple of DescriptorImageViewInfo and Arc<Sampler>.

@marc0246
Copy link
Contributor

marc0246 commented May 3, 2023

Yes, but that's the inconsistency I'm talking about. :p

@marc0246 marc0246 merged commit 93babbe into vulkano-rs:master May 3, 2023
marc0246 added a commit that referenced this pull request May 3, 2023
@Rua Rua deleted the descriptor-layouts branch October 25, 2023 14:25
hakolao pushed a commit to hakolao/vulkano that referenced this pull request Feb 20, 2024
* Replace `ImageAccess::descriptor_layouts()`

* Add `WriteDescriptorSet` constructors for image views with layout

* Replace `descriptor_layouts` for real

* Small changes

* More improvements
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