yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
c2dc1a86e
master
1// shader-cache-graphics-vertex.slang 2 3// Per-vertex attributes to be assembled from bound vertex buffers. 4struct AssembledVertex 5{ 6 float3 position : POSITION; 7}; 8 9// Output of the vertex shader, and input to the fragment shader. 10struct CoarseVertex 11{ 12 float3 color; 13}; 14 15// Vertex Shader 16 17struct VertexStageOutput 18{ 19 CoarseVertex coarseVertex : CoarseVertex; 20 float4 sv_position : SV_Position; 21}; 22 23[shader("vertex")] 24VertexStageOutput main( 25 AssembledVertex assembledVertex) 26{ 27 VertexStageOutput output; 28 29 float3 position = assembledVertex.position; 30 float3 color = float3(1.0, 0.0, 0.0); 31 32 output.coarseVertex.color = color; 33 output.sv_position = float4(position, 1.0); 34 35 return output; 36}