yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
447b7e0e2
master
1//DISABLE_TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj 2 3/* A test around integer generic parameters. 4 5Fails with: 6 7.slang(7): error 30019: expected an expression of type 'int', got 'typeof(N)' 8 return N; 9 10This is like *fixed-array.slang*. It needs let. 11 */ 12 13//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer 14RWStructuredBuffer<int> outputBuffer; 15 16int getN<N : int>() 17{ 18 return N; 19} 20 21[numthreads(4, 1, 1)] 22void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 23{ 24 int index = dispatchThreadID.x; 25 26 float4 values = { 1, 2, 3, 4 }; 27 28 let val = getN<10>(); 29 30 outputBuffer[index] = val; 31} 32