microsoft / microsoft/DirectXShaderCompiler

Allow unused registers to be output to reflection

Open
#5,105 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

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 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.