Add-support-for-SPV_NV_mesh_shader

This commit is contained in:
Chao Chen
2018-09-19 11:41:59 -07:00
parent 3a1379667d
commit 3c3669904c
41 changed files with 6976 additions and 4237 deletions

View File

@@ -0,0 +1,39 @@
#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 shared memory in mesh shaders:
writeonly uniform image2D uni_image;
uniform block0 {
uint uni_value;
};
shared vec4 mem[10];
void main()
{
uint iid = gl_LocalInvocationID.x;
uint gid = gl_WorkGroupID.x;
for (uint i = 0; i < 10; ++i) {
mem[i] = vec4(i+uni_value);
}
imageStore(uni_image, ivec2(iid), mem[gid]);
imageStore(uni_image, ivec2(iid), mem[gid+1]);
BARRIER();
}