-
Notifications
You must be signed in to change notification settings - Fork 105
Expand file tree
/
Copy pathimage.rs
More file actions
32 lines (30 loc) · 1018 Bytes
/
image.rs
File metadata and controls
32 lines (30 loc) · 1018 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// build-pass
// compile-flags: -C llvm-args=--disassemble
// compile-flags: -C target-feature=+RuntimeDescriptorArray,+SampledImageArrayDynamicIndexing
// compile-flags: -C target-feature=+ShaderNonUniform,+SampledImageArrayNonUniformIndexing
// normalize-stderr-test "OpSource .*\n" -> ""
// normalize-stderr-test "OpLine .*\n" -> ""
// normalize-stderr-test "%\d+ = OpString .*\n" -> ""
// normalize-stderr-test "; .*\n" -> ""
// normalize-stderr-test "OpCapability VulkanMemoryModel\n" -> ""
// normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple"
// ignore-spv1.0
// ignore-spv1.1
// ignore-spv1.2
// ignore-spv1.3
// ignore-spv1.4
// ignore-vulkan1.0
// ignore-vulkan1.1
use spirv_std::glam::*;
use spirv_std::image::*;
use spirv_std::*;
#[spirv(vertex)]
pub fn main(
index: u32,
#[spirv(descriptor_set = 0, binding = 0)] images: &RuntimeArray<Image2d>,
out: &mut Vec4,
) {
unsafe {
*out = images.index(index as usize).fetch(UVec2::new(1, 2));
}
}