yum-mirror/slang

Making it easier to work with shaders

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

Harsh Aggarwal (NVIDIA)Fix#8083: Batch-7: Enable cuda tests (#8267)7b4d02803

master
624 B28 linesraw
1//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute
2//TEST(compute):COMPARE_COMPUTE_EX:-slang -cuda -compute
3
4interface IGetter
5{
6    int get(int x);
7}
8
9//TEST_INPUT:set gOutputBuffer = out ubuffer(data=[0 0 0 0], stride=4)
10RWStructuredBuffer<int> gOutputBuffer;
11
12//TEST_INPUT: globalSpecializationArg MyGetter
13//TEST_INPUT: set gGetter = new MyGetter{}
14uniform IGetter gGetter;
15
16[numthreads(4, 1, 1)]
17void computeMain(int3 dispatchThreadID : SV_DispatchThreadID)
18{
19    gOutputBuffer[dispatchThreadID.x] = gGetter.get(dispatchThreadID.x);
20}
21
22struct MyGetter : IGetter
23{
24    int get(int x)
25    {
26        return x + 1;
27    }
28}