yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Yong HeAdd `target_switch` and `intrinsic_asm` statement. (#3154)c787c4b82

master
562 B18 linesraw
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):
2
3RWStructuredBuffer<float> buf;
4
5//
6// This test checks that we correctly diagnose trying to use the address of
7// something without one
8//
9int foo(const int constParam)
10{
11    return spirv_asm
12    {
13        OpLoad $$int %foo &buf;
14        // CHECK: bad-addr.slang([[#@LINE-1]]): note {{.*}}: unable to take the address of this address-of asm operand
15        OpLoad $$int result &constParam;
16        // CHECK: bad-addr.slang([[#@LINE-1]]): note {{.*}}: unable to take the address of this address-of asm operand
17    };
18}