yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Jay KwakCheck the supported backends in CI (#7346)94215dcdc

master
511 B20 linesraw
1//TEST(compute):COMPARE_COMPUTE(filecheck-buffer=CHK): -shaderobj -output-using-type
2
3//TEST_INPUT:ubuffer(data=[1.0 2.0 3.0 4.0], stride=4):name=gInput
4RWStructuredBuffer<float> gInput;
5
6//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=gOutput
7RWStructuredBuffer<float> gOutput;
8
9//CHK:1
10//CHK-NEXT:2
11//CHK-NEXT:3
12//CHK-NEXT:4
13
14[Shader("compute")]
15[NumThreads(4, 1, 1)]
16void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
17{
18    uint tid = dispatchThreadID.x;
19    gOutput[tid] = gInput[tid];
20}