yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
4eef0424a
master
1// sv-clip-distance-out-param.slang 2 3//TEST:SIMPLE(filecheck=CHECK): -profile sm_5_0 -stage vertex -entry mainVertex -target glsl 4 5//CHECK: out float gl_ClipDistance[2]; 6//CHECK: gl_ClipDistance[0] = 7//CHECK: gl_ClipDistance[1] = 8 9struct VertexInput 10{ 11 float3 position : POSITION; 12}; 13 14struct VertexOutput 15{ 16 float4 position : SV_Position; 17 18 float clip0 : SV_ClipDistance0; 19 float clip1 : SV_ClipDistance1; 20}; 21 22void mainVertex(VertexInput vi, out VertexOutput vo) 23{ 24 vo.position = float4(vi.position, 1); 25 vo.clip0 = vi.position.x / 10; 26 vo.clip1 = vi.position.z * 2; 27} 28