Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
2 changes: 1 addition & 1 deletion crates/spirv-std/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Core functions, traits, and more that make up a “standard library” for SPIR-V for use in [rust-gpu](https://github.com/rust-gpu/rust-gpu#readme).

This crate gives a `rust-gpu` shader access to the required `#![spirv(..)]` attribute, as well as povide all kinds of APIs that allows a shader to access GPU resources such as textures and buffers. Optionally, through the use of the `"glam"` feature, it includes some boilerplate trait implementations to make `glam` vector types compatible with these APIs.
This crate gives a `rust-gpu` shader access to the required `#![spirv(..)]` attribute, as well as provide all kinds of APIs that allows a shader to access GPU resources such as textures and buffers. Optionally, through the use of the `"glam"` feature, it includes some boilerplate trait implementations to make `glam` vector types compatible with these APIs.

## Example

Expand Down
11 changes: 5 additions & 6 deletions crates/spirv-std/macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ use std::fmt::Write;
/// when set the image format is unknown.
/// Accepted values: `f32`, `f64`, `u8`, `u16`, `u32`, `u64`, `i8`, `i16`, `i32`, `i64`.
/// - `format` — The image format of the image, mutually exclusive with `type`.
/// Accepted values: Snake case versions of [`ImageFormat`].
/// Accepted values: Snake case versions of [`ImageFormat`] variants, e.g. `rgba32f`,
/// `rgba8_snorm`.
/// - `sampled` — Whether it is known that the image will be used with a sampler.
/// Accepted values: `true` or `false`. Default: `unknown`.
/// - `multisampled` — Whether the image contains multisampled content.
Expand Down Expand Up @@ -195,8 +196,6 @@ pub fn gpu_only(_attr: TokenStream, item: TokenStream) -> TokenStream {
block,
} = syn::parse_macro_input!(item as syn::ItemFn);

// FIXME(eddyb) this looks like a clippy false positive (`sig` is used below).
#[allow(clippy::redundant_clone)]
let fn_name = sig.ident.clone();

let sig_cpu = syn::Signature {
Expand All @@ -221,13 +220,13 @@ pub fn gpu_only(_attr: TokenStream, item: TokenStream) -> TokenStream {
output.into()
}

/// Print a formatted string with a newline using the debug printf extension.
/// Print a formatted string using the debug printf extension.
///
/// Examples:
///
/// ```rust,ignore
/// debug_printfln!("uv: %v2f", uv);
/// debug_printfln!("pos.x: %f, pos.z: %f, int: %i", pos.x, pos.z, int);
/// debug_printf!("uv: %v2f\n", uv);
/// debug_printf!("pos.x: %f, pos.z: %f, int: %i\n", pos.x, pos.z, int);
/// ```
///
/// See <https://github.com/KhronosGroup/Vulkan-ValidationLayers/blob/main/docs/debug_printf.md#debug-printf-format-string> for formatting rules.
Expand Down
4 changes: 2 additions & 2 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ channel = "nightly-2025-06-23"
components = ["rust-src", "rustc-dev", "llvm-tools"]
# commit_hash = be19eda0dc4c22c5cf5f1b48fd163acf9bd4b0a6

# Whenever changing the nightly channel, update the commit hash above, and make
# sure to change `REQUIRED_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` also.
# Whenever changing the nightly channel, update the commit hash above, and
# change `REQUIRED_RUST_TOOLCHAIN` in `crates/rustc_codegen_spirv/build.rs` too.
2 changes: 1 addition & 1 deletion tests/compiletests/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ full reference can be found in the
### Disassembly

All disassembly will be dumped to stderr, which makes the testing framework compare it to the
contents of `path/to/test.rs.stdout`.
contents of `path/to/test.rs.stderr`.

* `// compile-flags: -C llvm-args=--disassemble` disassemble the entire shader
* `// compile-flags: -C llvm-args=--disassemble-globals` disassemble only globals and function declarations, excludes function contents
Expand Down