summaryrefslogtreecommitdiff
path: root/tests/glsl/global-uniform-with-varyings.slang
blob: 174560840c7cffdd1928f39dbd995fb200594b38 (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
//TEST:SIMPLE(filecheck=CHECK_SPIRV): -target spirv -entry main -stage vertex
//TEST:SIMPLE(filecheck=CHECK_GLSL): -target glsl -entry main -stage vertex

// CHECK_SPIRV: OpEntryPoint
// CHECK_SPIRV: OpVariable {{.*}} Input {{.*}} Location 0
// CHECK_SPIRV-DAG: OpVariable {{.*}} Uniform
// CHECK_SPIRV-DAG: OpVariable {{.*}} Input {{.*}} Location 1
// CHECK_SPIRV-DAG: OpVariable {{.*}} Output {{.*}} Location 0

// CHECK_GLSL: layout(location = 0)
// CHECK_GLSL-NEXT: in
// CHECK_GLSL: layout(location = 1)
// CHECK_GLSL-NEXT: in
// CHECK_GLSL: layout(std140) uniform
// CHECK_GLSL: layout(location = 0)
// CHECK_GLSL-NEXT: out
// CHECK_GLSL: void main

#version 330 core
layout(location=0) in float3 a_position;
layout(location=1) in float4 a_color;

out float4 v_color;

uniform matrix<float,4,4> u_transform;

void main() {
    gl_Position = u_transform * vec4(a_position, 1.0);
    v_color = a_color;
}