[Vulkan] Builtin shaders and shaders offline compilation script
[platform/core/uifw/dali-core.git] / dali / graphics / vulkan / shaders / border-visual-shader.vert
1 #version 430
2
3 // in variables
4 layout( location = 0 ) in vec2 aPosition;
5 layout( location = 0 ) in vec2 aDrift;
6   
7 layout( set = 0, binding = 0, std140 )uniform VertexData
8 {
9   mat4 uMvpMatrix;
10   vec3 uSize;
11   float borderSize;
12   
13   // Visual size and offset
14   vec2 offset;
15   vec2 size;
16   vec4 offsetSizeMode;
17   vec2 origin;
18   vec2 anchorPoint;
19 };
20
21 vec2 ComputeVertexPosition()
22 {
23   vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
24   vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
25   return (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy;
26 }
27
28 void main()
29 {
30   vec2 position = ComputeVertexPosition() + aDrift*borderSize;
31   gl_Position = uMvpMatrix * vec4(position, 0.0, 1.0);
32 }