yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
8395acfa0
master
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-shaderobj -output-using-type 2//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHECK):-shaderobj -vk -output-using-type 3 4struct Foo {float v;}; 5 6namespace foo { 7 typedef ::Foo Foo; // unexpected '::', expected identifier; works in dxc/hlsl 8 9 float test(Foo f) 10 { 11 return f.v; 12 } 13} 14 15//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer 16RWStructuredBuffer<float> outputBuffer; 17 18[numthreads(4, 1, 1)] 19[shader("compute")] 20void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID) 21{ 22 Foo f; 23 f.v = 1.0; 24 // CHECK: 1.0 25 outputBuffer[0] = foo.test(f); 26}