yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
6437f2d37
master
1//TEST:SIMPLE(filecheck=CHK): -target spirv -entry computeMain 2 3struct TangentSpace 4{ 5 static const float3 localNormal = {0, 1, 0}; 6 7 float4x4 tangentTransform; 8 float3 geometryNormal; 9 10 __init(in float3 normal, in float3 inRay) 11 { 12 // Should not warn here 13 tangentTransform = getMatrix(normal, inRay); 14 geometryNormal = localNormal; 15 } 16 17 float4x4 getMatrix(in float3 normal, in float3 inRay) 18 { 19 return float4x4(0.0f); 20 } 21} 22 23//CHK-NOT: warning 41020 24//CHK-NOT: warning 41021 25 26[Shader("compute")] 27[NumThreads(4, 1, 1)] 28void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) 29{ 30} 31