-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Allow Naga spv-in
and spv-out
in no_std
#7760
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.
Some notes
naga/src/front/spv/mod.rs
Outdated
/// Abstraction over `PathBuf` which falls back to [`String`] for `no_std` compatibility. | ||
#[derive(Clone)] | ||
pub struct DumpPrefix { | ||
#[cfg(std)] | ||
inner: PathBuf, | ||
#[cfg(no_std)] | ||
inner: String, | ||
} |
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.
Both this and the other struct should be in a common place in naga so it can be re-used throughout the codebase, instead of isolated to spv frontend/backend.
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.
Agreed. I've moved these into naga::path_like
(which is a rename of naga::as_diagnostic_file_path
). I've kept the types public in a private module as we don't intend for other crates to rely on these types. But I'm happy to move this whole module into wgpu-types
and make it public if you'd prefer.
Connections
Description
spv-in
andspv-out
from thestd
configuration of Naga.fs
feature to Naga for integration withstd::fs
(currently only used to write block context dumps in SPIR-V)Path
andPathBuf
to add one layer of indirection, allowing Naga to choose eitherPath/Buf
orstr/String
for internal storage based onstd
availability. This is only required inspv::Options
andspv::DebugInfo
, but the technique may be suitable to extract intowgpu-types
if required in other areas.spv-in
andspv-out
to the Naga component of theno_std
CI task.Testing
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.