mirror of
https://github.com/Rust-GPU/rust-gpu.git
synced 2026-06-08 10:39:50 +09:00
* Accept `#[rust_gpu::spirv()]` attributes rather than `#[spirv()]` in backend * Implemented `#[spirv(..)]` proc macro attribute for all platforms that conditionally translates to `#[rust_gpu::spirv()]` based on platform * Changed `SpirvBuilder` to always apply `register_tool(rust_gpu)` attribute to shader crates * Updated docs * Added changelog
18 lines
534 B
Rust
18 lines
534 B
Rust
// Test `OpVectorInsertDynamic`
|
|
// build-pass
|
|
|
|
use spirv_std::arch;
|
|
use spirv_std::spirv;
|
|
|
|
#[spirv(fragment)]
|
|
pub fn main() {
|
|
let vector = glam::Vec2::new(1.0, 2.0);
|
|
let expected = glam::Vec2::new(1.0, 3.0);
|
|
let new_vector = unsafe { arch::vector_insert_dynamic(vector, 1, 3.0) };
|
|
assert!(new_vector == expected);
|
|
let uvector = glam::UVec2::new(1, 2);
|
|
let uexpected = glam::UVec2::new(1, 3);
|
|
let unew_vector = unsafe { arch::vector_insert_dynamic(uvector, 1, 3) };
|
|
assert!(unew_vector == uexpected);
|
|
}
|