wgpu
wgpu copied to clipboard
Improve the polyfill for workgroup variable zero initialization
Connections Fixes #4592
Description Implements the suggestion in https://github.com/gfx-rs/wgpu/issues/4592#issuecomment-1783348185
I have implemented this for Spir-v, GLSL and HLSL.
Having implemented this, I have found enough issues that I am unsure about continuing this:
- It is an overall performance regression on my laptop for Vulkan
- Therefore, deciding on when to apply the polyfill is non-trivial
- #5508 turned out to be quite clean, and better solves the issue for Vello in the near term
- Better heuristics are possible, but are not plausible in the current architecture, as they have to be implemented manually in each backend.
If someone else wants to take this on, feel free.
Testing I have added a new test which tests the worse case of the old initialisation.
Checklist
- [X] Run
cargo fmt. - [ ] Run
cargo clippy. If applicable, add:- [X]
--target wasm32-unknown-unknownN/A - [X]
--target wasm32-unknown-emscriptenN/A
- [X]
- [X] Run
cargo xtask testto run tests. - [ ] Add change to
CHANGELOG.md. See simple instructions inside file.