-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GL_EXT_mesh_shader/SPV_EXT_mesh_shader implementation #3014
Conversation
I dont know if its the right place to notice, but I managed to produce an access violation compiling an mesh shader: #version 460
#extension GL_EXT_mesh_shader : require
layout(local_size_x = 1) in;
layout(triangles, max_vertices = 3, max_primitives = 1) out;
layout(location = 0) out vec3[] outColors;
void main() {
SetMeshOutputsEXT(3, 1);
gl_PrimitiveTriangleIndicesEXT[0] = uvec3(0, 1, 2);
gl_MeshPerVertexEXT[0].gl_Position = vec4(-0.5, -0.5, 0.0, 1.0);
gl_MeshPerVertexEXT[1].gl_Position = vec4(0.5, -0.5, 0.0, 1.0);
gl_MeshPerVertexEXT[2].gl_Position = vec4(0.0, 0.5, 0.0, 1.0);
outColors[0] = vec3(1.0, 0.0, 0.0);
outColors[1] = vec3(0.0, 1.0, 0.0);
outColors[2] = vec3(0.0, 0.0, 1.0);
} The mistake in this shader code is that I tried to compile the shader with As far as I debugged, the problem is that |
I feel like this should have also be reflected in the C interface, which curiously did not get updated with KHR_ray_tracing: glslang/glslang/Include/glslang_c_shader_types.h Lines 39 to 55 in 69ae9e7
|
e9f59a2
to
2ed4c5a
Compare
Let me check it out |
|
I updated the commit to address this comment |
Thanks, I'm addressing the other enum values with #3015. |
Are there users of the interface that also need to be updated? I checked shaderc and there is no dependency |
Well, I don't think the old values should be removed completely. In my PR I kept them as aliases to retain backwards compatibility. That way nobody needs to update. And I don't know any library that uses the C interface, so I can't really tell you. |
2ed4c5a
to
d396a4d
Compare
I have pushed a fix for this as you have suggested. Thanks for pointing it out!!! |
I updated the change to keep those old enum id's. Have a look and let me know if now it looks ok? |
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
d396a4d
to
228c672
Compare
@greg-lunarg @johnkslang kindly review and merge |
Looking to implement EXT_mesh_shader in SPIRV-Cross. Waiting for this to be merged :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks for the code!
Added following updates to GL_EXT_mesh_shader implementation:
Added SPIRV and GLSL test cases
Added checks to ensure NV and EXT mesh shader builtins cannot be used interchangeably.
Updated the language name by removing the postfix "NV" to MeshShader and TaskShader.
Added checks for grammar checking to comply with the spec.
Added gl_NumWorkGroups builtin to Mesh shader
Fixed data type of gl_PrimitiveLineIndicesEXT and gl_PrimitiveTriangleIndicesEXT
Added new constants to the resources table
Updates to handle new storage qualifier "taskPayloadSharedEXT"
Updated test cases by replacing "taskEXT" with storage qualifier "taskPayloadSharedEXT"
Addressed Review comments
SPIRV 1.6 related build failure fixes
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