mirror of
https://github.com/KhronosGroup/glslang
synced 2024-11-14 13:51:04 +00:00
228c67228a
Added following updates to GL_EXT_mesh_shader implementation: 1. Added SPIRV and GLSL test cases 2. Added checks to ensure NV and EXT mesh shader builtins cannot be used interchangeably. 3. Updated the language name by removing the postfix "NV" to MeshShader and TaskShader. 4. Added checks for grammar checking to comply with the spec. 5. Added gl_NumWorkGroups builtin to Mesh shader 6. Fixed data type of gl_PrimitiveLineIndicesEXT and gl_PrimitiveTriangleIndicesEXT 7. Added new constants to the resources table 8. Updates to handle new storage qualifier "taskPayloadSharedEXT" 9. Updated test cases by replacing "taskEXT" with storage qualifier "taskPayloadSharedEXT" Addressed Review comments 1. Fixed instruction description used by glslang disassembly. 2. Updated OpEmitMeshTasksEXT as per spec update 3. Fixed implementation that errors out if there are more then one taskPayloadSharedEXT varjables. 4. Fixed miscellaneous error logs and removed unwanted code. SPIRV 1.6 related build failure fixes - Update SPIRV header to 1.6 - Fix conflict wiht SPIRV 1.6 change, where localSizeId is used for execution mode for mesh/task shaders Enable SPIRV generated for EXT_mesh_shader to be version 1.4 GL_EXT_mesh_shader: Add checks for atomic support and corresponding test cases
60 lines
1.3 KiB
Plaintext
60 lines
1.3 KiB
Plaintext
#version 450
|
|
|
|
#define MAX_VER 81
|
|
#define MAX_PRIM 32
|
|
|
|
#define BARRIER() \
|
|
memoryBarrierShared(); \
|
|
barrier();
|
|
|
|
#extension GL_EXT_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 user defined interface out blocks:
|
|
|
|
// per-primitive block
|
|
perprimitiveEXT layout(location=0) out myblock {
|
|
float f;
|
|
float fArr[4];
|
|
vec3 pos;
|
|
vec4 posArr[4];
|
|
mat4 m;
|
|
mat3 mArr[2];
|
|
} blk[];
|
|
|
|
// per-vertex block
|
|
layout(location=20) out myblock2 {
|
|
float f;
|
|
vec4 pos;
|
|
mat4 m;
|
|
} blk2[];
|
|
|
|
void main()
|
|
{
|
|
uint iid = gl_LocalInvocationID.x;
|
|
uint gid = gl_WorkGroupID.x;
|
|
|
|
blk[iid].f = 11.0;
|
|
blk[iid+1].fArr[gid] = blk[iid].f;
|
|
blk[iid/2].pos.yzx = vec3(14.0, 15.0, 13.0);
|
|
blk[iid*2].posArr[1].yzw = blk[iid/2].pos;
|
|
blk[iid/4].m[2].wzyx = vec4(13.0, 14.0, 15.0, 16.0);
|
|
blk[iid].mArr[0][1][1] = blk[iid/4].m[2].w;
|
|
blk[iid*4].mArr[1][gid] = vec3(17.0, 18.0, 19.0);
|
|
|
|
BARRIER();
|
|
|
|
blk2[iid].f = blk2[iid-1].f + 20.0;
|
|
blk2[iid].pos = vec4(21.0, 22.0, 23.0, 24.0);
|
|
blk2[iid+1].m[gid] = blk2[iid].pos;
|
|
blk2[iid+1].m[gid][2] = 29.0;
|
|
blk2[iid+2].m[3] = blk2[iid+1].m[gid];
|
|
|
|
BARRIER();
|
|
}
|