yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
89bf795f1
master
1//TEST:SIMPLE(filecheck=CHECK): -target spirv -I $dirname 2 3//CHECK: OpEntryPoint 4 5// shaders.slang 6 7// 8// This file provides a simple vertex and fragment shader that can be compiled 9// using Slang. This code should also be valid as HLSL, and thus it does not 10// use any of the new language features supported by Slang. 11// 12 13import Scene.Scene; 14 15// Output of the vertex shader, and input to the fragment shader. 16struct CoarseVertex 17{ 18 float3 color; 19}; 20 21// Output of the fragment shader 22struct Fragment 23{ 24 float4 color; 25}; 26 27 28// Fragment Shader 29 30[shader("fragment")] 31float4 main( 32 CoarseVertex coarseVertex : CoarseVertex) : SV_Target 33{ 34 float3 fragColor = coarseVertex.color; 35 36 return float4(fragColor, 1.0); 37}