Skip to content

Commit 51a816b

Browse files
Failing test: reading a builtin with an entry-point param and a getter yields a compiler error.
1 parent 63580b6 commit 51a816b

1 file changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// build-pass
2+
// compile-flags: -C llvm-args=--disassemble
3+
// normalize-stderr-test "OpLine .*\n" -> ""
4+
// normalize-stderr-test "OpSource .*\n" -> ""
5+
// normalize-stderr-test "%\d+ = OpString .*\n" -> ""
6+
// normalize-stderr-test "OpCapability VulkanMemoryModel\n" -> ""
7+
// normalize-stderr-test "OpMemoryModel Logical Vulkan" -> "OpMemoryModel Logical Simple"
8+
// normalize-stderr-test "; .*\n" -> ""
9+
10+
use spirv_std::{
11+
builtin::compute,
12+
glam::*,
13+
spirv,
14+
};
15+
16+
#[spirv(compute(threads(1)))]
17+
pub fn compute(
18+
// TODO: Compile error: duplicate builtin
19+
#[spirv(local_invocation_index)] local_idx: u32,
20+
) {
21+
let _local_invocation_index: u32 = compute::local_invocation_index();
22+
let _local_invocation_index: u32 = compute::local_invocation_index();
23+
let _local_invocation_index: u32 = f();
24+
}
25+
26+
#[inline(never)]
27+
fn f() -> u32 {
28+
compute::local_invocation_index()
29+
}

0 commit comments

Comments
 (0)