-
Notifications
You must be signed in to change notification settings - Fork 1k
[naga] Write only the current entrypoint #7626
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
Conversation
+1 this for a different reason - it's less code to hand to the driver (for it to just throw out) and less for people looking in shader debuggers to wade through. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Entry points are uniquely identified by (name, stage)
, that's what the SPIR-V & GLSL backends use as well, I think the MSL & HLSL backends should follow that model to ensure only a single entry point is written.
@teoxoy Currently I have |
I think we should go with |
Changes the MSL and HLSL backends to support writing only a single entry point, and uses them that way in wgpu-hal. This is working towards a fix for gfx-rs#5885.
9cd815f
to
22ba4fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Looks like the msl test needs a bump in stack space? |
Yes, I assume this is because of the increase in the size of Although in the case of |
Changes the MSL and HLSL backends to support writing only a single entry point, and uses them that way in wgpu-hal. (The GLSL and SPIR-V backends already provide an entry point selector.)
This is working towards a fix for #5885, but this change doesn't alter override processing or validation, so we will still reject shaders for missing overrides whether or not they are used.
Testing
Both the write-one-entrypoint and write-all-entrypoints cases are exercised either by existing or changed code. Existing tests cover the change in behavior, in that the tests still work, even when no longer writing all entrypoints to the output. Additional partial-output test cases will be added with the complete fix for #5885.
Squash or Rebase? Squash
Checklist
cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.