Skip to content

[SPIR-V] SV_CullPrimitive as a pixel shader input produces invalid SPIR-V #9084

Done

Description

Follow up from #9073, as Diego Novillo (@dnovillo) suggested.

DXIL accepts SV_CullPrimitive as a pixel shader input of any type and replaces it with a constant 0 (HLSignatureLower.cpp). The SPIR-V backend maps it to the CullPrimitiveEXT builtin instead, which needs MeshShadingEXT and isn't allowed in fragment shaders (VUID 07034), so the output is invalid:

float4 main(bool c : SV_CullPrimitive) : SV_Target { return c; }

dxc -T ps_6_5 -E main -spirv:

fatal error: generated SPIR-V is invalid: Operand 3 of Decorate requires one of these capabilities: MeshShadingEXT

Same with uint. DXIL compiles both.

The plan from the discussion is to mirror DXIL and replace the input with false. Thanks Jonathan Zakharov (@jzakharovnv) for tracking down how DXIL handles this. Happy to take this one if that helps :)

Activity

  1. jzakharovnv commented on Oct 30, 2026

    @jzakharovnv
    Collaborator

    Thanks for filing this. If you have any interest in implementing a fix, be our opensource guest and feel free to do so. Otherwise, I don't think this is too burning an issue any DXC users are running into and thus will likely be on maintainers' backburner for a while. If you do want to make a PR though, ping me and I'll be able to review it quicker, since context is fresh.

  2. added
    bug
    spirv
    on Oct 30, 2026
  3. added a commit that references this issue on Dec 2, 2026
    44867da
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugspirv

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions