Skip to content

register binding applied to static variable declaration should be an error #7637

Open

Description

@llvm-beanz

Description
If a user declares a static variable of a resource type and assigns a register binding to it DXC ignores the register binding and compiles the code which can result in runtime failures or validation errors.

In Clang we correctly made this an error, see:
https://godbolt.org/z/9oWrxjs11

Steps to Reproduce
https://godbolt.org/z/xbTKd9rvq

Actual Behavior
This should produce a frontend error diagnostic, instead it may produce a validation error under SM 6.5, or fail at runtime under SM 6.6+.

Environment

  • DXC version: 1.6+
  • Host Operating System: All

Activity

  1. added
    bug
    needs-triage
    on Jul 10, 2025
  2. added
    incorrect-code
    and removed
    needs-triage
    on Oct 28, 2025
  3. damyanp commented on Oct 28, 2025

    @damyanp
    Member

    Set to dormant. If this is somehow important to help people migrate to clang we may want to reconsider.

  4. damyanp commented on Oct 28, 2025

    @damyanp
    Member

    On reflection: the "may" in the description of this implies that there may be people who have shaders do this, but are otherwise working correctly. So we should try get a version of DXC that catches this before they try to compile with clang and hit a new error.

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

    bugincorrect-code

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions