microsoft / microsoft/DirectXShaderCompiler

Resources in groupshared memory causes internal compiler error

Open
#6,631 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug incorrect-code
Dominant language
C++
Stars
3.7k
Forks
900
Avg merge
2d 11h
Merged PRs (30d)
44

Description

Description
Applying the groupshared qualifier onto resource globals results in an internal compiler error. This shouldn't be allowed, but it should produce a useful user error and not an internal casting failure.

Steps to Reproduce

Declare a texture and/or sampler with the groupshared qualifier and make use of them so they don't get eliminated.

https://godbolt.org/z/cbcq74x31

Actual Behavior
results in the error: "Internal Compiler error: cast() argument of incompatible type!"

Environment

  • DXC version 1.8.2405
  • Host Operating System win11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the linked Godbolt reproducer with DXC 1.8.2405, using a texture or sampler declared with groupshared and referenced so it is not eliminated. Trace the compiler path that produces the incompatible cast failure; done means the invalid declaration receives a useful user-facing diagnostic instead of an internal compiler error.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.