Skip to content

Reading from Mesh Shader output should be rejected by compiler #4170

@ClemensX

Description

@ClemensX

The fllowing code is compiled ok by glslc, but later rejected by the optimizer:

layout(location = 1) out PBRVertexOut outVert[];
outVert[v].worldPos = worldPos;
gl_MeshVerticesEXT[v].gl_Position =  ubo.proj * ubo.view * vec4(outVert[v].worldPos, 1.0);

Optimizer error is [VUID-StandaloneSpirv-MeshEXT-07107] The Output Storage Class in a Mesh Execution Model must not be read from

Probably the compiler should reject this kind of code, if it is not allowed.

I attached a very simple mesh shader source to test this. Please use this command after extracting the source from the zip:
glslc --target-env=vulkan1.4 -O pbr.mesh -o pbr.mesh.spv

pbr.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions