-
Notifications
You must be signed in to change notification settings - Fork 1.1k
[naga spv-out] Add f16 io polyfill #7884
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 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.
Mostly LGTM, but I noticed some things that seem like potential issues.
I also think the API could use some work, but let's iterate on that in follow-up PRs.
pub fn register_variable(&mut self, variable_id: Word, f32_type_id: Word, f16_type_id: Word) { | ||
self.variable_map | ||
.insert(variable_id, (f32_type_id, f16_type_id)); | ||
} |
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.
question: I noticed that f16_type_id
is never used when recalled via get_polyfill_info
. Is this a bug, or just some data that can be eliminated?
converted, | ||
&mut prelude.body, | ||
); | ||
id = converted; |
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.
question: You have an id = converted;
statement here, but not in the other branch where we handle a Struct
case as fallback. Should that be there, too?
44c88df
to
ca906b2
Compare
ca906b2
to
a8cddd9
Compare
Connections
Extension of #7656
Description
Polyfills f16 I/O when storageInputOutput16 capability is missing on vulkan backend.
Emits these variables as f32 and inserts OpFConverts at loads/stores.
If capability is available, generated spirv is unaffected.
Testing
Added a snapshot test and some basic inspection of the spirv disassembly in spirv_capabilities.rs.
Generated spirv in snapshots look okay to me, but I haven't yet run any live correctness tests.
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.CHANGELOG.md
entry.