Add max_color_attachments and max_color_attachment_bytes_per_sample #5218
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.
Connections
Description
This PR adds the two limits.
max_color_attachment
was already partially implemented via a constant inwgpu-hal
. The render bundle code still uses that instead of the device limit so there is followup work to do.For
max_color_attachment_bytes_per_sample
This does a best effort to pick reasonable defaults since the limit is largely undocumented for most platforms (See the linked gpuweb discussion). The general idea is that in doubt, 32 bytes is a safe assumption, and the limit is mostly to cater to tiled GPUs so on non-tiled ones we could increase the limits (for example d3d12 does not target non-tiled GPUs today).Testing
The CTS covers these.
Checklist
cargo fmt
.cargo clippy
.cargo xtask test
to run tests.