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

Atomics and Scalars are collapsed to the same LocalType #5569

Closed
atlv24 opened this issue Apr 20, 2024 · 2 comments · Fixed by #5590
Closed

Atomics and Scalars are collapsed to the same LocalType #5569

atlv24 opened this issue Apr 20, 2024 · 2 comments · Fixed by #5590

Comments

@atlv24
Copy link
Contributor

atlv24 commented Apr 20, 2024

Atomics and Scalars are collapsed to the same LocalType
https://github.com/gfx-rs/wgpu/blob/trunk/naga/src/back/spv/mod.rs#L360
Type capability requests are based on TypeInner
https://github.com/gfx-rs/wgpu/blob/trunk/naga/src/back/spv/writer.rs#L835
But deduplicated by LocalType
https://github.com/gfx-rs/wgpu/blob/trunk/naga/src/back/spv/writer.rs#L977

This means if an atomic<u64> is seen after u64, then the necessary Int64Atomics capability doesn't get requested.

LocalType should represent Atomic and non-Atomic types with distinct values, but I'm not sure how. Do we want a atomic: bool or an Atomic {} variant?

@atlv24
Copy link
Contributor Author

atlv24 commented Apr 21, 2024

Neither solution works, because type declarations must be unique. I'm going to lift the capability request call out of the lookup so it happens on every type instead

@teoxoy
Copy link
Member

teoxoy commented Apr 23, 2024

I'm going to lift the capability request call out of the lookup so it happens on every type instead

Sounds good, not sure why it was nested.

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 a pull request may close this issue.

2 participants