File: pointer_in_struct.slang

package info (click to toggle)
spirv-reflect 1.4.328.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,260 kB
  • sloc: ansic: 13,975; cpp: 5,963; python: 140; sh: 76; makefile: 12
file content (15 lines) | stat: -rw-r--r-- 242 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
RWStructuredBuffer<int> result;

struct Data{
   int a;
   int* b;
   int c;
};
[[vk::push_constant]] Data pc;

[shader("compute")]
[numthreads(1,1,1)]
void computeMain(uint3 threadId : SV_DispatchThreadID)
{
    result[0] = pc.b[2] + pc.c;
}