Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the polyfill for workgroup variable zero initialization #5521

Draft
wants to merge 12 commits into
base: trunk
Choose a base branch
from

Conversation

DJMcNab
Copy link
Contributor

@DJMcNab DJMcNab commented Apr 11, 2024

Connections
Fixes #4592

Description
Implements the suggestion in #4592 (comment)

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. Allow configuring whether workgroup memory is zero initialised #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

  • Run cargo fmt.
  • Run cargo clippy. If applicable, add:
    • --target wasm32-unknown-unknown N/A
    • --target wasm32-unknown-emscripten N/A
  • Run cargo xtask test to run tests.
  • Add change to CHANGELOG.md. See simple instructions inside file.

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.

Speed up zero initialization of workgroup memory
1 participant