rust-gpu/tests/ui/image/fetch.rs
XAMPPRocky f88ae5b28a
Add Const Generic Image Type (#359)
* Add parameterized Image type

* nits

* Update crates/spirv-std/src/lib.rs

* Update crates/rustc_codegen_spirv/src/symbols.rs

* Update crates/rustc_codegen_spirv/src/symbols.rs

* Update symbols.rs
2021-04-28 09:47:40 +02:00

13 lines
272 B
Rust

// build-pass
use spirv_std::{arch, Image};
#[spirv(fragment)]
pub fn main(
#[spirv(descriptor_set = 0, binding = 0)] image: &Image!(2D, type=f32, sampled),
output: &mut glam::Vec4,
) {
let texel = image.fetch(glam::IVec2::new(0, 1));
*output = texel;
}