yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
8086adc90
master
1//TEST:SIMPLE(filecheck=METAL): -target metal 2 3//TEST(smoke,compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -mtl 4//TEST(smoke,compute):COMPARE_COMPUTE_EX(filecheck-buffer=BUF):-slang -compute -vk 5 6//TEST_INPUT:ubuffer(data=[0 0 0 0 0], stride=4):out,name=outputBuffer 7RWStructuredBuffer<int> outputBuffer; 8 9void modify(inout int v) 10{ 11 v = 2; 12} 13 14[numthreads(1,1,1)] 15void computeMain(int3 v : SV_DispatchThreadID) 16{ 17 int3 u = v; 18 // METAL: int [[TEMP:[a-zA-Z0-9_]+]] = [[OUT:[a-zA-Z0-9_]+]].x; 19 // METAL: modify{{.*}}(&[[TEMP]]) 20 // METAL: [[OUT]].x = [[TEMP]]; 21 22 modify(u.x); 23 // BUF: 2 24 outputBuffer[0] = u.x + u.y; 25}