yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Ellie HermaszewskaMesh shader support (#2464)1643471da

master
922 B35 linesraw
1#version 450
2#extension GL_EXT_mesh_shader : require
3layout(row_major) uniform;
4layout(row_major) buffer;
5out gl_MeshPerVertexEXT
6{
7    vec4 gl_Position;
8} gl_MeshVerticesEXT[3];
9
10layout(local_size_x = 3, local_size_y = 1, local_size_z = 1) in;
11layout(max_vertices = 3) out;
12layout(max_primitives = 1) out;
13layout(triangles) out;
14void main()
15{
16    SetMeshOutputsEXT(3U, 1U);
17    if(gl_LocalInvocationIndex < 3U)
18    {
19        gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.wz = vec2(1.00000000000000000000, 0.00000000000000000000);
20        gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.x = 0.00000000000000000000;
21        gl_MeshVerticesEXT[gl_LocalInvocationIndex].gl_Position.y = 0.00000000000000000000;
22    }
23    else
24    {
25    }
26    if(gl_LocalInvocationIndex < 1U)
27    {
28        gl_PrimitiveTriangleIndicesEXT[gl_LocalInvocationIndex] = uvec3(0U, 1U, 2U);
29    }
30    else
31    {
32    }
33    return;
34}
35