mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-09 20:10:06 +00:00
42 lines
700 B
Plaintext
42 lines
700 B
Plaintext
|
#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;
|
||
|
}
|