microsoft / microsoft/DirectXShaderCompiler
How to remove unused cbuffer?
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Hi, I used IDxcRewriter2::RewriteWithOptions rewrite my shader.
The options set with L"-E", L"vsMain", L"-remove-unused-globals", L"-remove-unused-functions", L"-extract-entry-uniforms".
I expected the result code not contain the "psMain" entry used cbuffer.
Actually, the code contain.
Entry "vsMain" & "psMain" in the same file.
How to remove it? I cann't find the options.
Thanks.
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 reproducing the issue through IDxcRewriter2::RewriteWithOptions using the listed options, with vsMain and psMain in the same shader. Trace how -remove-unused-globals, -remove-unused-functions, and -extract-entry-uniforms handle the cbuffer used by psMain. Done means confirming whether the cbuffer is removed for the selected entry point or documenting the supported behavior.
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
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100