yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
2a5d5b323
master
1//TEST(smoke,compute):COMPARE_COMPUTE: -shaderobj 2//TEST(smoke,compute):COMPARE_COMPUTE:-cpu -shaderobj 3 4// Confirm that generics syntax can be used in user 5// code and generates valid output. 6 7//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer 8RWStructuredBuffer<float> outputBuffer; 9 10struct GenStruct<T> 11{ 12 T x; 13}; 14 15T test<T>(T val) 16{ 17 return val; 18} 19 20 21[numthreads(4, 1, 1)] 22void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 23{ 24 uint tid = dispatchThreadID.x; 25 26 float inVal = float(tid); 27 28 float outVal = test<float>(inVal); 29 30 outputBuffer[tid] = outVal; 31}