mirror of
https://github.com/storytold/wgpu.git
synced 2026-11-21 06:50:59 +01:00
769: Implement and Validate all WebGPU Limits r=kvark a=cwfitzgerald **Connections** None? **Description** This adds all the limits that webgpu has currently. It also validates the values. The main piece of code here is `BindingTypeMaxCountValidator` and `PerStageBindingTypeCounter` which provides the interface for figuring out the maximum per-stage counts in the pipeline. For each `BindGroupLayout` a `BindingTypeMaxCountValidator`is put together during creation using all of the bindings. Then the `BindingTypeMaxCountValidator`s are combined into a single max. This is then validated against the max limits. Each commit should be independently testable and are grouped by responsibility. **Testing** I modified the wgpu-rs example framework to ask for extremely reduced limits and then tested various examples to verify it properly accepted/rejected based on the actual limit. Co-authored-by: Connor Fitzgerald <connorwadefitzgerald@gmail.com>