Files
Seele/res/shaders/vertex.glsl
T

114 lines
2.0 KiB
GLSL
Raw Normal View History

2022-04-15 11:19:30 +02:00
#version 450
layout(row_major) uniform;
layout(row_major) buffer;
2022-04-15 23:45:44 +02:00
#line 2 0
2022-04-15 11:19:30 +02:00
struct GlyphData_0
{
vec2 bearing_0;
vec2 size_0;
};
2022-04-15 23:45:44 +02:00
#line 16
layout(std430, binding = 0, set = 1) readonly buffer _S1 {
2022-04-15 11:19:30 +02:00
GlyphData_0 _data[];
} glyphData_0;
2022-04-15 23:45:44 +02:00
layout(push_constant)
layout(std140) uniform _S2
{
float _data;
} scale_0;
#line 7
struct ViewData_0
2022-04-15 11:19:30 +02:00
{
mat4x4 projectionMatrix_0;
};
layout(binding = 0)
2022-04-15 23:45:44 +02:00
layout(std140) uniform _S3
2022-04-15 11:19:30 +02:00
{
2022-04-15 23:45:44 +02:00
ViewData_0 _data;
} viewData_0;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 12
2022-04-15 11:19:30 +02:00
layout(location = 0)
2022-04-15 23:45:44 +02:00
out vec2 _S4;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 12
2022-04-15 11:19:30 +02:00
layout(location = 1)
2022-04-15 23:45:44 +02:00
out uint _S5;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 12
2022-04-15 11:19:30 +02:00
layout(location = 0)
2022-04-15 23:45:44 +02:00
in uint _S6;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 12
2022-04-15 11:19:30 +02:00
layout(location = 1)
2022-04-15 23:45:44 +02:00
in vec2 _S7;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 22
2022-04-15 11:19:30 +02:00
struct VertexStageInput_0
{
uint glyphIndex_0;
vec2 position_0;
uint vertexId_0;
};
struct VertexStageOutput_0
{
vec4 position_1;
vec2 uvCoords_0;
uint glyphIndex_1;
};
void main()
{
2022-04-15 23:45:44 +02:00
#line 37
VertexStageInput_0 _S8 = VertexStageInput_0(_S6, _S7, uint(gl_VertexIndex));
2022-04-15 11:19:30 +02:00
GlyphData_0 glyph_0 = ((glyphData_0)._data[(_S8.glyphIndex_0)]);
2022-04-15 23:45:44 +02:00
float xpos_0 = _S8.position_0.x + glyph_0.bearing_0.x * scale_0._data;
float ypos_0 = _S8.position_0.y - (glyph_0.size_0.y - glyph_0.bearing_0.y) * scale_0._data;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
float w_0 = glyph_0.size_0.x * scale_0._data;
float h_0 = glyph_0.size_0.y * scale_0._data;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
vec4 coordinates_0[4] = { vec4(xpos_0, ypos_0 + h_0, float(0), float(0)), vec4(xpos_0, ypos_0, float(0), float(1)), vec4(xpos_0 + w_0, ypos_0, float(1), float(0)), vec4(xpos_0 + w_0, ypos_0 + h_0, float(1), float(1)) };
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 47
2022-04-15 11:19:30 +02:00
vec4 vertex_0 = coordinates_0[_S8.vertexId_0];
2022-04-15 23:45:44 +02:00
#line 54
2022-04-15 11:19:30 +02:00
VertexStageOutput_0 output_0;
output_0.uvCoords_0 = vertex_0.zw;
2022-04-15 23:45:44 +02:00
vec4 _S9 = (((vec4(vertex_0.xy, float(0), float(1))) * (viewData_0._data.projectionMatrix_0)));
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 56
2022-04-15 11:19:30 +02:00
output_0.position_1 = _S9;
output_0.glyphIndex_1 = _S8.glyphIndex_0;
VertexStageOutput_0 _S10 = output_0;
2022-04-15 23:45:44 +02:00
#line 58
2022-04-15 11:19:30 +02:00
gl_Position = _S10.position_1;
2022-04-15 23:45:44 +02:00
#line 58
_S4 = _S10.uvCoords_0;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 58
_S5 = _S10.glyphIndex_1;
2022-04-15 11:19:30 +02:00
2022-04-15 23:45:44 +02:00
#line 58
2022-04-15 11:19:30 +02:00
return;
}