yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NVError if super-type capabilities are a super-set of sub-type (#7452)07f21ee31

master
1.2 KiB77 linesraw
1//TEST:SIMPLE(filecheck=CHECK): -target hlsl -entry computeMain -stage compute
2
3// Test if InheritanceDecl fail to conform to parent capabilities
4
5// mismatch of target abstract atoms
6[require(hlsl)]
7interface IFoo0
8{
9}
10[require(hlsl)]
11[require(spirv)]
12// CHECK-DAG: ([[# @LINE+1]]): error 36108{{.*}}spirv
13struct Foo0 : IFoo0
14{
15}
16
17// mismatch of target abstract atoms
18[require(hlsl)]
19[require(spirv)]
20interface IFoo1
21{
22}
23[require(hlsl)]
24// CHECK-DAG: ([[# @LINE+1]]): error 36118{{.*}}spirv
25struct Foo1 : IFoo1
26{
27}
28
29// subtype is superset
30[require(sm_4_0)]
31interface IFoo2
32{
33}
34[require(sm_5_0)]
35// CHECK-DAG: ([[# @LINE+1]]): error 36104{{.*}}sm_5_0
36struct Foo2 : IFoo2
37{
38}
39
40// subtype is subset, no error
41[require(sm_5_0)]
42interface IFoo3
43{
44}
45[require(sm_4_0)]
46struct Foo3 : IFoo3
47{
48}
49
50// mismatch of stage abstract atoms
51[require(hlsl, compute)]
52interface IFoo4
53{
54}
55[require(hlsl, fragment)]
56// CHECK-DAG: ([[# @LINE+1]]): error 36118{{.*}}compute
57struct Foo4 : IFoo4
58{
59}
60
61// mismatch of stage abstract atoms
62[require(fragment)]
63[require(vertex)]
64interface IFoo5
65{
66}
67[require(fragment)]
68// CHECK-DAG: ([[# @LINE+1]]): error 36118{{.*}}vertex
69struct Foo5 : IFoo5
70{
71}
72
73[require(hlsl)]
74[numthreads(1,1,1)]
75void computeMain()
76{
77}