yum-mirror/slang

Making it easier to work with shaders

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

ArielG-NV[CBP] Pointer frontend changes + groupshared pointer support (#7848)7758625d3

master
649 B31 linesraw
1//TEST(compute, vulkan):SIMPLE(filecheck=SPV): -stage compute -entry computeMain -target spirv -emit-spirv-directly
2
3// This test is to verify the example on the user guide
4// and prevent any regressions.
5
6//TEST_INPUT:ubuffer(data=[0], stride=4):out,name=outputBuffer
7RWStructuredBuffer<float> outputBuffer;
8
9struct MyType
10{
11    float a;
12};
13
14float test(MyType* pObj)
15{
16    //SPV: OpTypePointer
17    MyType* pNext = pObj + 1;
18    MyType* pNext2 = __getAddress(pNext[1]);
19    return pNext.a + pNext->a + (*pNext2).a + pNext2[0].a;
20}
21
22cbuffer Constants
23{
24    MyType *ptr;
25};
26
27[numthreads(1,1,1)]
28void computeMain()
29{
30    outputBuffer[0] = test(ptr);
31}