yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
712ce653d
master
1// modern-syntax.slang 2//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj 3//TEST(compute):COMPARE_COMPUTE_EX:-cpu -slang -compute -shaderobj 4 5// This file exists to confirm that declarations using "modern" 6// syntax are handled correctly by the compiler front-end. 7 8typealias MyInt = int; 9 10func test(val: MyInt) -> MyInt 11{ 12 var tmp = val; 13 let c : MyInt = 16; 14 tmp += c; 15 return tmp; 16} 17 18//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 19RWStructuredBuffer<int> outputBuffer; 20 21[numthreads(4, 1, 1)] 22void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) 23{ 24 int tid = dispatchThreadID.x; 25 int val = test(tid); 26 outputBuffer[tid] = val; 27}