yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
eb5648b41
master
1//DIAGNOSTIC_TEST:SIMPLE(filecheck=CHECK): -stage compute -entry computeMain -target spirv 2 3RWStructuredBuffer<vector<float, 8>> bufferIn1; 4RWStructuredBuffer<vector<float, 0>> bufferIn2; 5RWStructuredBuffer<float> resultOut; 6 7[shader("compute")] 8[numthreads(32,1,1)] 9void computeMain(uint3 threadId : SV_DispatchThreadID) 10{ 11 // CHECK: error 38203: vector has invalid element count '0', valid values are between '1' and '4' inclusive 12 // CHECK: error 38203: vector has invalid element count '8', valid values are between '1' and '4' inclusive 13 uint index = threadId.x; 14 resultOut[index] = bufferIn1[index][0] + bufferIn2[index][0]; 15}