yum-mirror/slang

Making it easier to work with shaders

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

Yong HeFix anyvalue marshalling for matrix and 64 bit types. (#5827)f573c1586

master
587 B30 linesraw
1//TEST:COMPARE_COMPUTE(filecheck-buffer=CHECK): -output-using-type
2
3interface IFoo
4{
5    float getVal();
6}
7
8struct Foo : IFoo
9{
10    column_major float3x2 m;
11    float getVal()
12    {
13        return m[2][0];
14    }
15}
16
17//TEST_INPUT: type_conformance Foo:IFoo = 0
18
19//TEST_INPUT: set gFoo = ubuffer(data=[0 0 0 0 1.0 2.0 3.0 4.0 5.0 6.0], stride=4)
20RWStructuredBuffer<IFoo> gFoo;
21
22//TEST_INPUT: set outputBuffer = out ubuffer(data=[0 0 0 0], stride=4)
23RWStructuredBuffer<float> outputBuffer;
24
25[numthreads(1,1,1)]
26void computeMain()
27{
28    // CHECK: 3.0
29    outputBuffer[0] = gFoo[0].getVal();
30}