• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#version 450
2
3#define MAX_VER  81
4#define MAX_PRIM 32
5
6#define BARRIER() \
7    memoryBarrierShared(); \
8    barrier();
9
10#extension GL_NV_mesh_shader : enable
11
12layout(local_size_x = 32) in;
13
14layout(max_vertices=MAX_VER) out;
15layout(max_primitives=MAX_PRIM) out;
16layout(triangles) out;
17
18// test use of task memory in mesh shaders:
19
20taskNV in taskBlock {
21    float gid1[2];
22    vec4 gid2;
23} mytask;
24
25buffer bufferBlock {
26    float gid3[2];
27    vec4 gid4;
28} mybuf;
29
30layout(location=0) out outBlock {
31    float gid5;
32    vec4 gid6;
33} myblk[];
34
35void main()
36{
37    uint iid = gl_LocalInvocationID.x;
38
39    myblk[iid].gid5 = mytask.gid1[1] + mybuf.gid3[1];
40    myblk[iid].gid6 = mytask.gid2    + mybuf.gid4;
41}
42