<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/112044>112044</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[DirectX] Collect shader flags based on module properties, target shader stage or validator version
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
bharadwajy
</td>
</tr>
</table>
<pre>
Add support to collect following flags not dependent on instructions but on validator version, module properties or target shader stage
- [ ] `m_bDisableOptimizations`
Set if optimizations are disabled (`-O0`)
- [ ] `m_bAllResourcesBound`
Set if command-line option `-all-resources-bound` is specified
NOTE: To be added only if the command-line option `-all-resources-bound` of `dxc` is supported in `clang`
- [ ] `m_bUseNativeLowPrecision`
Set if command-line option `-enable-16bit-types` is specified and Shader Model is 6.2 or later
NOTE: If this is set, min-precision mode (`m_bUseMinPrecision`) is not set.
- [ ] `m_bResMayNotAlias`
Set if command-line option `-res-may-alias` is *NOT* specified AND either
- DXIL Version > 1.7 AND function uses UAVs OR
- DXIL Version <= 1.7 AND UAVs present globally
NOTE: To be added only if the command-line option `-res-may-alias` of `dxc` is supported in `clang`
- [ ] `m_UAVsAtEveryStage`
Set if Validator Ver < 1.8, has UAVs and shader is not cs or ps.
Set if Validator Ver > 1.8, has UAVs and shader is vs, hs, ds or ds
- [ ] `m_bCSRawAndStructuredViaShader4X`
Set if shader uses Raw or Structured buffers, SM Major is > 4 and is a compute shader
AC:
- Decide if the command-line options `-enable-16bit-types` and `-all-resources-bound` of `dxc` need
to be supported in `clang`. Add support if so.
- Add tests for each of the above 6 flags.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykVV9P67gT_TTuyyhR4pb-echDoCBd6QI_US7i7ScnnjRGrh15nHa7n35lJ4Vb4N5ld3kIUu0zZ47nzIwgUluDWLCLS3axnojet9YVVSuckAfxcpxUVh4LKKUE6rvOOg_eQm21xtpDY7W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