Skip to content

Conversation

@andyleiserson
Copy link
Contributor

@andyleiserson andyleiserson commented Dec 15, 2025

We were validating storage texture compatibility when creating bindings, not when creating BGLs, which is when the spec calls for it. Move the existing validation to BGL creation. binding creation already checked that the format matches the layout, so we don't need to re-validate the format when the binding is created.

I omitted a changelog entry since it seems unlikely that anybody could be accomplishing anything useful by creating such BGLs and not binding them, but, I'd be happy to add one if it seems appropriate. (Not specific to this change, but in general, stricter validation seems likely to break things and thus worth noting in the change log. On the other hand, we have a lot of missing validation so noting absolutely every change to validation could bloat the changelog quite a bit.)

Testing
By the CTS.

Squash or Rebase? Squash

Checklist

  • If this contains user-facing changes, add a CHANGELOG.md entry.

Copy link
Member

@teoxoy teoxoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The spec doesn't seem to require validating this twice. The format is validated when creating the BGL and when creating the BG, the format of the view is checked against the format of the BGL entry.

@andyleiserson andyleiserson marked this pull request as draft December 18, 2025 21:25
This moves existing validation from binding creation to BGL
creation. Binding creation already had a check that returns
`CreateBindGroupError::InvalidStorageTextureFormat` if the format
does not match the layout, so it is not necessary to revalidate
the format support at that point.
@andyleiserson andyleiserson marked this pull request as ready for review January 6, 2026 22:35
@andyleiserson
Copy link
Contributor Author

Updated to validate format support only on BGL creation. The existing check in binding creation that the format matches the layout remains.

@teoxoy teoxoy merged commit 376a36a into gfx-rs:trunk Jan 7, 2026
52 checks passed
@andyleiserson andyleiserson deleted the push-wllqoxxtontv branch January 7, 2026 16:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants