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.4 KiB56 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
9//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
10RWStructuredBuffer<int> outputBuffer;
11
12static int myTwo = 2;
13static int myThree = 1+2;
14
15struct DefaultStruct_bottom
16{
17    int data0 = 1;
18};
19struct DefaultStruct_middle1 : DefaultStruct_bottom
20{
21    int data1 = 1;
22};
23struct DefaultStruct_middle2 : DefaultStruct_middle1
24{
25    int data2 = 1;
26};
27struct DefaultStruct_top : DefaultStruct_middle2
28{
29    int data3 = 1;
30};
31
32[numthreads(1, 1, 1)]
33void computeMain(uint3 dispatchThreadID: SV_DispatchThreadID)
34{
35    DefaultStruct_bottom s1 = {};
36    DefaultStruct_middle1 s2 = {};
37    DefaultStruct_middle2 s3 = {};
38    DefaultStruct_top s4 = {};
39
40    // BUF: 1
41    outputBuffer[0] = true
42        && s1.data0 == 1
43
44        && s2.data0 == 1
45        && s2.data1 == 1
46
47        && s3.data0 == 1
48        && s3.data1 == 1
49        && s3.data2 == 1
50
51        && s4.data0 == 1
52        && s4.data1 == 1
53        && s4.data2 == 1
54        && s4.data3 == 1
55        ;
56}