Debian Codegraph @

tests/auto/qshaderbaker/data/color_pertarget.vert

raw
1 #version 440
2
3 layout(location = 0) in vec4 position;
4 layout(location = 1) in vec3 color;
5 layout(location = 0) out vec3 v_color;
6
7 layout(std140, binding = 0) uniform buf {
8 mat4 mvp;
9 float opacity;
10 } ubuf;
11
12 out gl_PerVertex { vec4 gl_Position; };
13
14 void main()
15 {
16 // ensure that the manually defined macro still works
17 #ifdef MY_MACRO
18 #if MY_VALUE == 321
19 v_color = color;
20 #else
21 broken MY_VALUE
22 #endif
23 #else
24 broken MY_MACRO
25 #endif
26
27 // fail in non-per-target mode
28 #if !defined(QSHADER_SPIRV) && !defined(QSHADER_GLSL) && !defined(QSHADER_HLSL) && !defined(QSHADER_MSL)
29 macros not present?!
30 #endif
31
32 gl_Position = ubuf.mvp * position;
33 }