]> git.tdb.fi Git - libs/gl.git/blob - tests/glsl/struct_in_anonymous_block.glsl
Fix GLSL test cases so they pass the basic tests
[libs/gl.git] / tests / glsl / struct_in_anonymous_block.glsl
1 struct MaterialParameters
2 {
3         vec4 color;
4 };
5 uniform Material
6 {
7         MaterialParameters material;
8 };
9 uniform Transform
10 {
11         mat4 mvp;
12 };
13
14 #pragma MSP stage(vertex)
15 layout(location=0) in vec4 position;
16 void main()
17 {
18         gl_Position = mvp*position;
19 }
20
21 #pragma MSP stage(fragment)
22 layout(location=0) out vec4 frag_color;
23 void main()
24 {
25         frag_color = material.color;
26 }
27
28 // Target API: Vulkan
29
30 /* Expected output: vertex
31 layout(set=0, binding=24) uniform Transform
32 {
33         mat4 mvp;
34 };
35 layout(location=0) in vec4 position;
36 void main()
37 {
38         gl_Position = mvp*position;
39 }
40 */
41
42 /* Expected output: fragment
43 struct MaterialParameters
44 {
45         vec4 color;
46 };
47 layout(set=0, binding=16) uniform Material
48 {
49         MaterialParameters material;
50 };
51 layout(location=0) out vec4 frag_color;
52 void main()
53 {
54         frag_color = material.color;
55 }
56 */