Skip to content

[naga] Always compact the module in process_overrides #7795

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

Merged
merged 1 commit into from
Jun 16, 2025

Conversation

andyleiserson
Copy link
Contributor

This should fix #7638, but I don't have a Windows system, so I can't 100% confirm that.

This change mostly avoids the issues in #7793 by only compacting (not attempting override resolution) if the module doesn't have any overrides. I've also optimized the case where there is only one entry point, although I'm not sure that's a good idea -- it may be possible to write a module with one entry point and a problematic global that is not used by the entry point, and we'd need to compact that module to get rid of the problematic global.

Testing
I'm open to suggestions what tests make sense here. I considered writing a test in naga::validation that verifies compaction has taken place, but it doesn't feel like it adds a lot of value. Possibly there are some tests that can be added with #7734, although it will be difficult to distinguish the effects of this change vs. #7626. We could also create a test based on the test case in #7638, but I don't have a windows machine to work on that.

Squash or Rebase? Squash

Checklist

  • Run cargo fmt.
  • Run taplo format.
  • Run cargo clippy --tests. If applicable, add:
    • --target wasm32-unknown-unknown
  • Run cargo xtask test to run tests.
  • If this contains user-facing changes, add a CHANGELOG.md entry.

@jimblandy
Copy link
Member

For testing, I'm fuzzy on the details, but couldn't we adopt the test case from #7793 for this?

@jimblandy jimblandy merged commit 45ebc73 into gfx-rs:trunk Jun 16, 2025
40 checks passed
@andyleiserson andyleiserson deleted the compact-always branch June 17, 2025 16:08
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.

Sampler buffer of group SamplerIndexBufferKey { group: 0 } not bound to a register for unused and unbound sampler buffer on DX12
2 participants