yum-mirror/slang

Making it easier to work with shaders

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

James Helferty (NVIDIA)render-test: Change D3D12 default to sm_6_5 (#8320)f02b08490

master
1.2 KiB59 linesraw
1//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain 
2//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-vk -compute -entry computeMain -emit-spirv-directly
3//TEST(compute, vulkan):COMPARE_COMPUTE(filecheck-buffer=BUF):-cpu -compute -entry computeMain
4//TEST(smoke,compute):COMPARE_COMPUTE(filecheck-buffer=BUF):-dx12 -compute -entry computeMain
5
6#pragma warning(disable:30816)
7
8//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
9RWStructuredBuffer<int> outputBuffer;
10
11static int myTwo = 2;
12static int myThree = 1+2;
13
14struct DefaultStruct_base
15{
16    int data0 = 1;
17    int data1;
18
19    __init()
20    {
21        data0 = 2;
22        data1 = 3;
23    }
24};
25
26struct DefaultStruct1 : DefaultStruct_base
27{
28    int data2 = 1;
29    __init()
30    {
31        if (data0 == 2)
32        {
33            data2 = 4;
34        }
35    }
36};
37
38struct DefaultStruct2 : DefaultStruct_base
39{
40    __init()
41    {
42    }
43};
44
45[numthreads(1, 1, 1)]
46void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
47{
48    DefaultStruct1 s1;
49    DefaultStruct2 s2;
50
51    // BUF: 1
52    outputBuffer[0] = true
53        && s1.data0 == 2
54        && s1.data1 == 3
55        && s1.data2 == 4
56        && s2.data0 == 2
57        && s2.data1 == 3
58        ;
59}