-
Notifications
You must be signed in to change notification settings - Fork 1k
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
[naga] compaction may miss used constants' types #7072
Comments
We have this comment: // Constants' initializers are taken care of already, because
// expression tracing sees through constants. But we still need to
// note type usage. I'm not sure it's right. |
jimblandy
added a commit
to jimblandy/wgpu
that referenced
this issue
Feb 7, 2025
Ensure that unnamed overrides' types are retained, even when the overrides are used only by global expressions. Add a test case. Fixes gfx-rs#7072.
jimblandy
added a commit
to jimblandy/wgpu
that referenced
this issue
Feb 7, 2025
Ensure that unnamed overrides' types are retained, even when the overrides are used only by global expressions. Add a test case. Fixes gfx-rs#7072.
jimblandy
added a commit
to jimblandy/wgpu
that referenced
this issue
Feb 7, 2025
Ensure that unnamed overrides' types are retained, even when the overrides are used only by global expressions. Add a test case. Fixes gfx-rs#7072.
davnotdev
pushed a commit
to davnotdev/wgpu
that referenced
this issue
Mar 4, 2025
Ensure that unnamed overrides' types are retained, even when the overrides are used only by global expressions. Add a test case. Fixes gfx-rs#7072.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think part of the compaction code is either wrong or redundant.
When
compact::compact
marks a name constants as used by definition, it also marks its initialization expression as used. But then later in that function, it marks the types of all used constants as used. I'm not sure why these two cases, type and initialization expression, should be handled differently. It seems to me that either the type marking can be moved up (removing that entire loop altogether) or the initializer marking must be moved down, because new constants are getting marked and we'd better include their initialization expressions.Whatever the case, overrides deserve similar scrutiny.
(I'm not sure this is actually a bug, but there's an asymmetry to
naga::compact::compact
that seems wrong, and I'm afraid I'll forget about this doubt if I don't write it down.)The text was updated successfully, but these errors were encountered: