5 #define MAX_VIEWS gl_MaxMeshViewCountNV
8 memoryBarrierShared(); \
11 #extension GL_NV_mesh_shader : enable
13 layout(local_size_x = 32) in;
15 layout(max_vertices=MAX_VER) out;
16 layout(max_primitives=MAX_PRIM) out;
17 layout(triangles) out;
19 // test use of per-view builtin attributes
23 uint iid = gl_LocalInvocationID.x;
24 uint viewID = gl_MeshViewIndicesNV[gl_MeshViewCountNV%MAX_VIEWS];
26 gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID] = vec4(1.0, 2.0, 3.0, 4.0);
27 gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2] = 5.0;
28 gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3] = 6.0;
29 gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID] = 7;
30 gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0] = 8;
34 gl_MeshVerticesNV[iid+1].gl_PositionPerViewNV[viewID] = gl_MeshVerticesNV[iid].gl_PositionPerViewNV[viewID];
35 gl_MeshVerticesNV[iid+1].gl_ClipDistancePerViewNV[viewID][2] = gl_MeshVerticesNV[iid].gl_ClipDistancePerViewNV[viewID][2];
36 gl_MeshVerticesNV[iid+1].gl_CullDistancePerViewNV[viewID][3] = gl_MeshVerticesNV[iid].gl_CullDistancePerViewNV[viewID][3];
37 gl_MeshPrimitivesNV[iid+1].gl_LayerPerViewNV[viewID] = gl_MeshPrimitivesNV[iid].gl_LayerPerViewNV[viewID];
38 gl_MeshPrimitivesNV[iid+1].gl_ViewportMaskPerViewNV[viewID][0] = gl_MeshPrimitivesNV[iid].gl_ViewportMaskPerViewNV[viewID][0];