yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
d046082c5
master
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK):-target spirv 2 3struct Light 4{ 5 float3 position; 6 float radius; 7 8 float3 color; 9 float intensity; 10}; 11 12[vk::binding(0, 0)] 13StructuredBuffer<Light> globalLightList; 14 15struct Lighting 16{ 17 //CHECK: ([[# @LINE+1]]): error 20102 18 float3 DoLighting(Light light); 19 { 20 // Not emitted 21 return float3(1.0, 1.0, 1.0); 22 } 23}; 24 25[shader("fragment")] 26float4 fragment(float4 color: COLOR0) 27{ 28 float4 albedo = color; 29 30 if (albedo.a < 0.025) 31 discard; 32 33 Lighting light = Lighting(); 34 albedo.xyz = light.DoLighting(globalLightList[0]); 35 36 return albedo; 37}