summaryrefslogtreecommitdiffstats
path: root/tests/language-feature/capability/capability7.slang
blob: 79749f201e73b260e1ef0410078b273c6c22f418 (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//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 -skip-spirv-validation

// Test that we diagnose simplified capabilities
// CHECK_IGNORE_CAPS-NOT: error 36104
// CHECK-NOT: sm_4_0
// CHECK-NOT: sm_5_0
// CHECK-NOT: sm_5_1
// CHECK: error 36104: 'processDataBad' uses undeclared capability 'sm_6_0'
// CHECK: capability7.slang(28): note: see using of 'processDataBadNested'
// CHECK: capability7.slang(20): note: see definition of 'processDataBadNested'


[require(glsl_hlsl_metal_spirv)]
void processDataGood()
{
}

[require(hlsl, sm_6_0)]
void processDataBadNested()
{
    AllMemoryBarrier();
}

[require(hlsl)]
void processDataBad()
{
    processDataBadNested();
}

void myNestedNestedSafeCall()
{
    processDataGood();
}

void myNestedNestedBadCall()
{
    processDataGood();
    processDataBad();
}

void myNestedCall()
{
    myNestedNestedSafeCall();
    myNestedNestedBadCall();
}

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