yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
4c4826d47
master
1#pragma pack_matrix(column_major) 2#ifdef SLANG_HLSL_ENABLE_NVAPI 3#include "nvHLSLExtns.h" 4#endif 5#pragma warning(disable: 3557) 6 7static const float2 positions_0 [ int ( 3 )] = { float2 ( 0.0 , -0.5 ), float2 ( 0.5 , 0.5 ), float2 ( -0.5 , 0.5 ) }; 8static const float3 colors_0 [ int ( 3 )] = { float3 ( 1.0 , 1.0 , 0.0 ), float3 ( 0.0 , 1.0 , 1.0 ), float3 ( 1.0 , 0.0 , 1.0 ) }; 9struct Vertex_0 10{ 11float4 pos_0 : SV_Position ; 12float3 color_0 : Color ; 13}; 14 15[ shader ( "mesh" )][ numthreads ( 3 , 1 , 1 )] 16[ outputtopology ( "triangle" )] 17void main ( uint tig_0 : SV_GROUPINDEX , vertices vertices out Vertex_0 verts_0 [ int ( 3 )], indices indices out uint3 triangles_0 [ int ( 1 )]) 18{ 19SetMeshOutputCounts ( 3U , 1U ); 20if ( tig_0 < 3U ) 21{ 22verts_0 [ tig_0 ]. pos_0 = float4 ( positions_0 [ tig_0 ], 0.0 , 1.0 ); 23verts_0 [ tig_0 ]. color_0 = colors_0 [ tig_0 ]; 24} 25else 26{ 27} 28 29if ( tig_0 < 1U ) 30{ 31triangles_0 [ tig_0 ] = uint3 ( 0U , 1U , 2U ); 32} 33else 34{ 35} 36 37return ; 38}