summaryrefslogtreecommitdiff
path: root/tests/bugs/split-nested-types.hlsl
blob: dc8756ba2051d4fb8ccebd73e01b4b8452a4aa6b (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
//TEST:COMPARE_HLSL:-no-mangle -profile ps_5_0 -target dxbc-assembly

#ifdef __SLANG__
import split_nested_types;
#else

#define A A_0
#define x x_0

#define B B_0
#define y y_0

#define M M_0
#define a a_0
#define b b_0

#define C C_0
#define m m_0

struct A { int x; };

struct B { float y; };

struct CC { Texture2D t; SamplerState s; };

struct M
{
	A a;
	B b;
};

#endif

cbuffer C
{
	M m;
}

float4 main() : SV_TARGET
{
	return m.b.y;
}