-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Improve bindgroup layout entry docs to document PARTIALLY_BOUND_BINDING_ARRAY #8795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: trunk
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -327,14 +327,15 @@ pub struct BindGroupLayoutEntry { | |
| /// If the binding is an array of multiple resources. Corresponds to `binding_array<T>` in the shader. | ||
| /// | ||
| /// When this is `Some` the following validation applies: | ||
| /// - Size must be of value 1 or greater. | ||
| /// - Count must be of value 1 or greater, this corresponds to the length of the array of resources that will be bound. | ||
| /// - When `ty == BindingType::Texture`, [`Features::TEXTURE_BINDING_ARRAY`] must be supported. | ||
| /// - When `ty == BindingType::Sampler`, [`Features::TEXTURE_BINDING_ARRAY`] must be supported. | ||
| /// - When `ty == BindingType::Buffer`, [`Features::BUFFER_BINDING_ARRAY`] must be supported. | ||
| /// - When `ty == BindingType::Buffer` and `ty.ty == BufferBindingType::Storage`, [`Features::STORAGE_RESOURCE_BINDING_ARRAY`] must be supported. | ||
| /// - When `ty == BindingType::StorageTexture`, [`Features::STORAGE_RESOURCE_BINDING_ARRAY`] must be supported. | ||
| /// - When any binding in the group is an array, no `BindingType::Buffer` in the group may have `has_dynamic_offset == true` | ||
| /// - When any binding in the group is an array, no `BindingType::Buffer` in the group may have `ty.ty == BufferBindingType::Uniform`. | ||
| /// - If [`Features::PARTIALLY_BOUND_BINDING_ARRAY`] is enabled, the specified count becomes the upper bound instead. | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is very helpful!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah... I hear you, it's a small change and a lot of overhead, but this extra bit of information would've saved me much quite a bit of time trying to understand & use a variable length array :) |
||
| /// | ||
| #[cfg_attr(feature = "serde", serde(default))] | ||
| pub count: Option<NonZeroU32>, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this to
Countto match the name of the field and made it explicit that this conveys the length of the array, which helps clarify howPARTIALLY_BOUND_BINDING_ARRAYaffects the validation rules.