blob: 687148add248509c3d8ccea026e181283bc08c6f (
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
|
// attribute.slang
// Tests reflection of user defined attributes.
//TEST:REFLECTION:-stage compute -entry main -target hlsl
[__AttributeUsage(_AttributeTargets.Struct)]
struct MyStructAttribute
{
int iParam;
float fParam;
};
[__AttributeUsage(_AttributeTargets.Var)]
struct DefaultValueAttribute
{
int iParam;
};
[MyStruct(0, 1.0)]
struct A
{
float x;
[DefaultValue(1)]
float y;
};
[MyStruct(0, 2.0)]
struct B
{
float x;
[DefaultValue(1+1)]
float z;
};
ParameterBlock<A> param;
ParameterBlock<B> param2;
[numthreads(1, 1, 1)]
void main(
uint3 dispatchThreadID : SV_DispatchThreadID)
{
}
|