[clang] [HLSL] Don't invoke `dxv` from `clang-dxc` for text output (PR #135876)
Justin Bogner via cfe-commits
cfe-commits at lists.llvm.org
Tue Apr 15 18:25:42 PDT 2025
================
@@ -309,6 +309,9 @@ HLSLToolChain::TranslateArgs(const DerivedArgList &Args, StringRef BoundArch,
}
bool HLSLToolChain::requiresValidation(DerivedArgList &Args) const {
+ if (!Args.hasArg(options::OPT_dxc_Fo))
+ return false;
----------------
bogner wrote:
I'm not sure I understand what you mean. The validator runs on the binary dxil container - if we're just emitting textual dxil then there's nothing we can run the validator on. Currently what happens in that case is that we attempt to run the validator but it falls over because the input isn't something it understands.
that is,
```
$ ./bin/clang-dxc.exe -T cs_6_2 -Fc x.s e:/tmp/x.hlsl
shader: expected top-level entity
source_filename = "E:/tmp/x.hlsl"
^
clang-dxc: error: dxv command failed with exit code 1 (use -v to see invocation)
```
or if we just output to stdout:
```
$ ./bin/clang-dxc.exe -T cs_6_2 e:/tmp/x.hlsl >/dev/null
...
The system cannot find the file specified. -
clang-dxc: error: dxv command failed with exit code 1 (use -v to see invocation)
```
https://github.com/llvm/llvm-project/pull/135876
More information about the cfe-commits
mailing list