-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[naga] Remove non-essential override references via compaction #7703
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
base: trunk
Are you sure you want to change the base?
Conversation
There is a question what to do about the
I have listed in my order of preference, but I don't have all the context about use cases and build size concerns that might justify one of my non-preferred options. |
let (module, info) = naga::back::pipeline_constants::process_overrides( | ||
module, | ||
info, | ||
None, |
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.
It already came in useful to be able to pass the actual entry point here, and I have the changes to do that, but unless there's a desire to have them in this PR, I'll hold them for a follow-up so that this one doesn't get any bigger.
Some performance data: compacting all of the wgsl snapshot tests, with the reachability changes (#7674), before this change:
After this change, with
Without the reachability changes, after this change, with
Performance of other stages (with this change; wgsl-in includes a compaction and is ~1% slower, validation and hlsl-out are unchanged):
|
Adds a mode to compaction that removes unused functions, global variables, and named types and overrides. This mode is used everywhere except the compaction at the end of lowering, where it is important to preserve unused items for type checking and other validation of the module. Pruning all but the active entry point and then compacting makes `process_overrides` tolerant of missing values for overrides that are not used by the active entry point. Fixes gfx-rs#5885
Adds a mode to compaction that removes unused functions, global variables, and named types and overrides. This mode is used everywhere except the compaction at the end of lowering, where it is important to preserve unused items for type checking and other validation of the module.
Pruning all but the active entry point and then compacting makes
process_overrides
tolerant of missing values for overrides that are not used by the active entry point.Fixes #5885
Testing
Adds several cases in the
validation
test to verify that compaction removes references to non-essential overrides. Also enables the relevant CTS tests, which are now passing.Squash or Rebase? Squash
Checklist
compact
within the benchmark needs to updated with the 2nd argument in this PR.cargo fmt
.taplo format
.cargo clippy --tests
. If applicable, add:--target wasm32-unknown-unknown
cargo xtask test
to run tests.CHANGELOG.md
entry.