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
940 B44 linesraw
1//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -dx12  -profile cs_6_1 -output-using-type
2//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -vk -output-using-type
3
4interface IFoo
5{
6    float getVal();
7    uint64_t getPtrVal();
8}
9
10struct Foo : IFoo
11{
12    column_major float3x2 m;
13    int x;
14    uint64_t ptr;
15    float getVal()
16    {
17        return m[2][0];
18    }
19    uint64_t getPtrVal()
20    {
21        return ptr;
22    }
23}
24
25//TEST_INPUT: type_conformance Foo:IFoo = 0
26
27//TEST_INPUT: set gFoo = ubuffer(data=[0 0 0 0 1.0 2.0 3.0 4.0 5.0 6.0 0 0 1 2], stride=4)
28RWStructuredBuffer<IFoo> gFoo;
29
30//TEST_INPUT: set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4)
31RWStructuredBuffer<float> outputBuffer;
32
33[numthreads(1,1,1)]
34void computeMain()
35{
36    // CHECK: 3.0
37    outputBuffer[0] = gFoo[0].getVal();
38
39    // CHECK: 1.0
40    outputBuffer[1] = gFoo[0].getPtrVal()&0xFFFFFFFF;
41
42    // CHECK: 2.0
43    outputBuffer[2] = gFoo[0].getPtrVal()>>32;
44}