File: spv.meshShaderTaskMem.mesh

package info (click to toggle)
glslang 16.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 51,720 kB
  • sloc: cpp: 92,305; yacc: 4,320; sh: 603; python: 305; ansic: 94; javascript: 74; makefile: 17
file content (41 lines) | stat: -rw-r--r-- 700 bytes parent folder | download | duplicates (17)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#version 450

#define MAX_VER  81
#define MAX_PRIM 32

#define BARRIER() \
    memoryBarrierShared(); \
    barrier();

#extension GL_NV_mesh_shader : enable

layout(local_size_x = 32) in;

layout(max_vertices=MAX_VER) out;
layout(max_primitives=MAX_PRIM) out;
layout(triangles) out;

// test use of task memory in mesh shaders:

taskNV in taskBlock {
    float gid1[2];
    vec4 gid2;
} mytask;

buffer bufferBlock {
    float gid3[2];
    vec4 gid4;
} mybuf;

layout(location=0) out outBlock {
    float gid5;
    vec4 gid6;
} myblk[];

void main()
{
    uint iid = gl_LocalInvocationID.x;

    myblk[iid].gid5 = mytask.gid1[1] + mybuf.gid3[1];
    myblk[iid].gid6 = mytask.gid2    + mybuf.gid4;
}