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 use of an array like container. 4 5Has error: 6 7.slang(5): error 30019: expected an expression of type 'int', got 'typeof(SIZE)' 8 T elements[SIZE]; 9 10Problem here is SIZE doesn't have *let* in front. The error doesn't provide any useful insight into that. It's also not entirely clear *why* let is needed. Presumably because it's not a type? 11*/ 12 13//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer 14RWStructuredBuffer<float> outputBuffer; 15 16struct FixedArray<T, SIZE : int> 17{ 18 T elements[SIZE]; 19}; 20 21[numthreads(4, 1, 1)] 22void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID) 23{ 24 int index = dispatchThreadID.x; 25 26 FixedArray<int, 8> arr; 27 28 outputBuffer[index] = 1; 29} 30