Skip to content

Hull shader has issues with Dead Code Ellimination #6956

Closed as not planned
Closed as not planned

Description

@sd20134

Description
We have a hull shader which takes a lot of time.
One coworker discovered that this was due to static and global variable initalizations.
This happens only for Hull Shader which is empty. Same issue does not happen on a vertex or pixel shader.
Where in the compiler codebase is the DCE passes and what may be the reason so we can track this out.

Environment

  • DXC later than 2021
  • Host Operating System Windows 11

Activity

  1. added
    bug
    needs-triage
    on Oct 11, 2024
  2. damyanp commented on Oct 15, 2024

    @damyanp
    Member

    We need more information (such as a repro, and clear details on what the issue is) in order to be able to start thinking about investigating this. Marking this as closed for now, please do reopen if you are able to provide more information.

  3. sd20134 commented on Oct 16, 2024

    @sd20134
    Author

    Damyan Pepper (@damyanp)
    Hello,
    This is a question about the compiler itself so we can figure it out, It adds around 2ms on an intel gpu, on nvidia and amd it does not happen, since they tend to do DCE by themselves also and intel drivers do not.
    We have a repro, but we are under NDA for now, so no code.

  4. sd20134 commented on Oct 16, 2024

    @sd20134
    Author

    Damyan Pepper (@damyanp) i have no rights to reopen the issue

  5. damyanp commented on Oct 16, 2024

    @damyanp
    Member

    Reopening - OP is asking for a pointer to where to start debugging this in DXC themselves.

  6. moved this from Triaged to No status in HLSL Triageon Oct 16, 2024
  7. damyanp commented on Oct 16, 2024

    @damyanp
    Member

    Guidance I have here is that this is likely due to hull shaders having two entry points and so confusing the code that tries to inlines these initializations into a single entry point. A fix for this would likely be involved (and isn't something that we'd be able to invest in for DXC).

    This might be a place to start looking: https://github.com/microsoft/DirectXShaderCompiler/blob/main/lib/Transforms/Scalar/ScalarReplAggregatesHLSL.cpp

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

    bugneeds-triage

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions