wgpu icon indicating copy to clipboard operation
wgpu copied to clipboard

Improve the polyfill for workgroup variable zero initialization

Open DJMcNab opened this issue 1 year ago • 0 comments

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:

  1. It is an overall performance regression on my laptop for Vulkan
  2. Therefore, deciding on when to apply the polyfill is non-trivial
  3. #5508 turned out to be quite clean, and better solves the issue for Vello in the near term
  4. 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-unknown N/A
    • [X] --target wasm32-unknown-emscripten N/A
  • [X] Run cargo xtask test to run tests.
  • [ ] Add change to CHANGELOG.md. See simple instructions inside file.

DJMcNab avatar Apr 11 '24 14:04 DJMcNab