yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
bd6306cda
master
1#version 450 2#extension GL_EXT_mesh_shader : require 3layout (row_major )uniform ; 4layout (row_major )buffer ; 5struct Texes_0 6{ 7vec2 tex1_0 ; 8vec4 tex2_0 ; 9}; 10 11struct Vertex_0 12{ 13vec4 pos_0 ; 14vec3 col_0 ; 15Texes_0 ts_0 ; 16}; 17 18void just_two_0 (out Vertex_0 v_0 ,out Vertex_0 w_0 ) 19{ 20const vec4 _S1 = vec4 (0.0 ); 21const vec3 _S2 = vec3 (1.0 ); 22Texes_0 _S3 = {vec2 (0.0 ,0.0 ),vec4 (0.0 ,0.0 ,0.0 ,0.0 ) }; 23v_0 .pos_0 = _S1 ; 24v_0 .col_0 = _S2 ; 25v_0 .ts_0 = _S3 ; 26w_0 .pos_0 = _S1 ; 27w_0 .col_0 = _S2 ; 28w_0 .ts_0 = _S3 ; 29return ; 30} 31 32void just_one_0 (out Vertex_0 v_1 ) 33{ 34const vec3 _S4 = vec3 (1.0 ); 35Texes_0 _S5 = {vec2 (0.0 ,0.0 ),vec4 (0.0 ,0.0 ,0.0 ,0.0 ) }; 36v_1 .pos_0 = vec4 (0.0 ); 37v_1 .col_0 = _S4 ; 38v_1 .ts_0 = _S5 ; 39return ; 40} 41 42void part_of_one_0 (out vec4 p_0 ) 43{ 44p_0 = vec4 (1.0 ,2.0 ,3.0 ,4.0 ); 45return ; 46} 47 48void write_struct_0 (out Texes_0 t_0 ) 49{ 50t_0 .tex1_0 = vec2 (0.0 ); 51t_0 .tex2_0 = vec4 (1.0 ); 52return ; 53} 54 55layout (location = 0 ) 56out vec3 _S6 [3 ]; 57 58layout (location = 1 ) 59out vec2 _S7 [3 ]; 60 61layout (location = 2 ) 62out vec4 _S8 [3 ]; 63 64out gl_MeshPerVertexEXT 65{ 66vec4 gl_Position ; 67}gl_MeshVerticesEXT [3 ]; 68 69out uvec3 gl_PrimitiveTriangleIndicesEXT [1 ]; 70void everything_0 () 71{ 72vec3 _S9 = vec3 (1.0 ); 73vec2 _S10 = vec2 (0.0 ,0.0 ); 74vec4 _S11 = vec4 (0.0 ,0.0 ,0.0 ,0.0 ); 75gl_MeshVerticesEXT [0U ].gl_Position = vec4 (0.0 ); 76_S6 [0U ]= _S9 ; 77_S7 [0U ]= _S10 ; 78_S8 [0U ]= _S11 ; 79return ; 80} 81 82void a_0 () 83{ 84everything_0 (); 85return ; 86} 87 88void b_0 () 89{ 90Vertex_0 _S12 ; 91Vertex_0 _S13 ; 92just_two_0 (_S13 ,_S12 ); 93Vertex_0 _S14 = _S13 ; 94gl_MeshVerticesEXT [0U ].gl_Position = _S13 .pos_0 ; 95_S6 [0U ]= _S14 .col_0 ; 96_S7 [0U ]= _S14 .ts_0 .tex1_0 ; 97_S8 [0U ]= _S14 .ts_0 .tex2_0 ; 98Vertex_0 _S15 = _S12 ; 99gl_MeshVerticesEXT [0U ].gl_Position = _S12 .pos_0 ; 100_S6 [0U ]= _S15 .col_0 ; 101_S7 [0U ]= _S15 .ts_0 .tex1_0 ; 102_S8 [0U ]= _S15 .ts_0 .tex2_0 ; 103return ; 104} 105 106void c_0 (uint _S16 ) 107{ 108Vertex_0 _S17 ; 109just_one_0 (_S17 ); 110Vertex_0 _S18 = _S17 ; 111gl_MeshVerticesEXT [_S16 ].gl_Position = _S17 .pos_0 ; 112_S6 [_S16 ]= _S18 .col_0 ; 113_S7 [_S16 ]= _S18 .ts_0 .tex1_0 ; 114_S8 [_S16 ]= _S18 .ts_0 .tex2_0 ; 115return ; 116} 117 118void d_0 (uint _S19 ) 119{ 120Vertex_0 _S20 ; 121Vertex_0 _S21 ; 122just_two_0 (_S21 ,_S20 ); 123Vertex_0 _S22 = _S21 ; 124gl_MeshVerticesEXT [_S19 ].gl_Position = _S21 .pos_0 ; 125_S6 [_S19 ]= _S22 .col_0 ; 126_S7 [_S19 ]= _S22 .ts_0 .tex1_0 ; 127_S8 [_S19 ]= _S22 .ts_0 .tex2_0 ; 128Vertex_0 _S23 = _S20 ; 129gl_MeshVerticesEXT [0U ].gl_Position = _S20 .pos_0 ; 130_S6 [0U ]= _S23 .col_0 ; 131_S7 [0U ]= _S23 .ts_0 .tex1_0 ; 132_S8 [0U ]= _S23 .ts_0 .tex2_0 ; 133return ; 134} 135 136void e_0 (uint _S24 ) 137{ 138part_of_one_0 (gl_MeshVerticesEXT [_S24 ].gl_Position ); 139Texes_0 _S25 ; 140write_struct_0 (_S25 ); 141Texes_0 _S26 = _S25 ; 142_S7 [_S24 ]= _S25 .tex1_0 ; 143_S8 [_S24 ]= _S26 .tex2_0 ; 144part_of_one_0 (_S8 [_S24 ]); 145return ; 146} 147 148layout (local_size_x = 3 ,local_size_y = 1 ,local_size_z = 1 )in ; 149layout (max_vertices = 3 )out ; 150layout (max_primitives = 1 )out ; 151layout (triangles )out ; 152void main () 153{ 154SetMeshOutputsEXT (3U ,1U ); 155if (gl_LocalInvocationIndex < 3U ) 156 { 157a_0 (); 158b_0 (); 159c_0 (gl_LocalInvocationIndex ); 160d_0 (gl_LocalInvocationIndex ); 161e_0 (gl_LocalInvocationIndex ); 162 } 163if (gl_LocalInvocationIndex < 1U ) 164 { 165gl_PrimitiveTriangleIndicesEXT [gl_LocalInvocationIndex ]= uvec3 (0U ,1U ,2U ); 166 } 167return ; 168} 169