Skip to content

[SPIR-V] [outputcontrolpoints(0)] or missing outputcontrolpoints Hull stage attribute crash the compiler (works with DXIL backend) #3733

Closed

Description

Title

[SPIR-V] [outputcontrolpoints(0)] or missing outputcontrolpoints Hull stage attribute crash the compiler (works with DXIL backend)

Functional impact

Cannot produce hull shaders that don't have any control point output (e.g. when only patch data is needed for the domain stage)

Minimal repro steps

  1. Compile the following shader with dxc.exe -T hs_6_0 -E Hull -spirv repro_shader.txt:
    repro_shader.txt
    or do dxc.exe -T hs_6_0 -E Hull -spirv repro_shader_no_attribute.txt
    repro_shader_no_attribute.txt

Expected result

Compilation succeeds with control point output count being zero

Actual result

Compiler crashes with output:
Internal compiler error: access violation. Attempted to read from address 0x0000000000000020

Further technical details

Used DXC release v1.6.2104 (e09a454)

Activity

  1. changed the title [-][SPIR-V] [outputcontrolpoints(0)] Hull stage attribute crashes the compiler (works with DXIL backend)[/-] [+][SPIR-V] [outputcontrolpoints(0)] or missing outputcontrolpoints Hull stage attribute crash the compiler (works with DXIL backend)[/+] on May 3, 2021
  2. added
    spirv
    on May 3, 2021
  3. jaebaek commented on May 3, 2021

    @jaebaek
    Collaborator

    Lukas Taparauskas (@Dredhog), Thank you for reporting this issue. We will take a look.

  4. added a commit that references this issue on Jan 23, 2024
    a5ed8cd
  5. sudonatalie commented on Jan 23, 2024

    @sudonatalie
    Collaborator

    Lukas Taparauskas (@Dredhog) Do you happen to have any additional context on how you intend to use zero control points in hull shaders, or is this simply an issue to report a crash (never correct) and mismatch with the DXIL backend (undesirable)?

    Given that Vulkan doesn't allow zero as the number of output vertices (https://docs.vulkan.org/spec/latest/chapters/pipelines.html#VUID-VkPipelineShaderStageCreateInfo-stage-00713) and it looks like the D3D docs might also suggest it's invalid (https://learn.microsoft.com/en-us/windows/win32/direct3d11/direct3d-11-advanced-stages-tessellation#hull-shader-stage) I'm thinking the correct solution might be to fail gracefully for both backends.

  6. added 2 commits that reference this issue on Jan 23, 2024
    e217c75
    94559ae
  7. added a commit that references this issue on Feb 1, 2024
    4917105
  8. added a commit that references this issue on Feb 27, 2024
    86afe1e
  9. added a commit that references this issue on Mar 25, 2024
    122464a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

spirv

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions