summaryrefslogtreecommitdiff
path: root/tests/language-feature/capability/capabilitySimplification1.slang
blob: 440ac1cedfa9ca7d8443b3a03d8297ce86fb08ae (plain)
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
33
34
//TEST:SIMPLE(filecheck=CHECK): -target glsl -entry computeMain -stage compute -profile sm_5_0
//TEST:SIMPLE(filecheck=CHECK_IGNORE_CAPS): -target glsl -emit-spirv-directly -entry computeMain -stage compute  -profile sm_5_0 -ignore-capabilities


// CHECK_IGNORE_CAPS-NOT: error 36107

// CHECK: error 36107
// CHECK-SAME: entrypoint 'computeMain' uses features that are not available in 'compute' stage for 'glsl' target.
// CHECK: capabilitySimplification1.slang(21): note: see using of 'WaveMultiPrefixCountBits'
// CHECK-NOT: see using of 'WaveMultiPrefixCountBits'
// CHECK: {{.*}}.meta.slang({{.*}}): note: see definition of 'WaveMultiPrefixCountBits'
// CHECK: {{.*}}.meta.slang({{.*}}): note: see declaration of 'require'

void nestedSafeCall()
{
    AllMemoryBarrier();
}

void nestedBadCall()
{
    WaveMultiPrefixCountBits(true, 0);
}

void nestedCall()
{
    nestedSafeCall();
    nestedBadCall();
}

[numthreads(1,1,1)]
void computeMain()
{
    nestedCall();
}