microsoft / microsoft/DirectXShaderCompiler
Allow unused registers to be output to reflection
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
When compiling, the compiler will detect unused registers and kick them. This is great to be able to check what is actually used by the shader, but unfortunately that also prevents us from having stable shader reflection. If the shader artist connects a variable that is now compiled out, it would break their workflow. And if another variable is now not compiled out they'll have to connect it again. It would be great if O0 or a flag to avoid stripping this is available. Because right now we rely on manually tokenizing and parsing the entire file.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the compiler's unused-register elimination and shader reflection paths described in the issue, then identify how an O0 mode or preservation flag would affect both. Done means reflection can expose unused registers consistently without requiring manual tokenization and parsing of the source file.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100