/ widgets / src / shaders / tiled_button.vert
tiled_button.vert
 1  #version 450
 2  
 3  layout (location = 0) in vec2 position;
 4  layout (location = 1) in vec2 texture_uv;
 5  
 6  layout (location = 0) out vec2 frag_position;
 7  layout (location = 1) out flat uint layer;
 8  
 9  layout (set = 0, binding = 0) readonly uniform ViewProj {
10  	mat4 view;
11  	mat4 proj;
12  };
13  
14  layout (push_constant) uniform pc {
15  	mat4 model;
16  };
17  
18  void main() {
19  	frag_position = texture_uv * 0.5 + 0.5;
20      layer = min(gl_VertexIndex / 16u, 2u);
21  
22      gl_Position = proj * view * model * vec4(position, 0.0, 1.0);
23  }