yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
1562f98c0
master
1//TEST(compute):COMPARE_COMPUTE:-dx12 -compute -shaderobj 2//TEST(compute):COMPARE_COMPUTE:-vk -compute -shaderobj 3//TEST(compute):COMPARE_COMPUTE:-cuda -compute -shaderobj 4 5// Test doing vector comparisons 6 7//TEST_INPUT:ubuffer(data=[0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0], stride=4):out,name=outputBuffer 8RWStructuredBuffer<int> outputBuffer; 9 10[numthreads(4, 4, 1)] 11void computeMain(int3 dispatchThreadID : SV_DispatchThreadID) 12{ 13 int2 threadInGroup = dispatchThreadID.xy; 14 15 int r = 0; 16 if(all((threadInGroup & 1) == 0)) 17 { 18 r = 0; 19 } 20 else 21 { 22 r = 1; 23 } 24 25 int index = threadInGroup.x + threadInGroup.y * 4; 26 outputBuffer[index] = r; 27}