microsoft / microsoft/DirectXShaderCompiler
Compiling empty source file fails with cryptic error message
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.7k
- Forks
- 900
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 44
Description
Description
When compiling an empty source file, DXC fails with a cryptic error message, as opposed to an insightful error message. I thought I did something wrong with the compiler flags, but it turned out the source file was empty.
Steps to Reproduce
$ echo -n > empty.hlsl
$ dxc -T vs_6_0 empty.hlsl
Actual Behavior
DXC prints:
dxc failed : Invalid argument.
Environment
- DXC version: libdxcompiler.so: 1.7(dev;4006-69e54e29); libdxil.so: 1.7
- Host Operating System: NixOS GNU/Linux 23.11.928.50aa30a13c4a (Tapir)
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
Reproduce the failure with the dxc -T vs_6_0 empty.hlsl command and an empty empty.hlsl file. Trace the compiler's handling of an empty source to identify where the generic Invalid argument diagnostic is produced; done means the command reports an informative empty-source error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli, compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100