DirectXShaderCompiler icon indicating copy to clipboard operation
DirectXShaderCompiler copied to clipboard

Revise DXC help text: "(must be used with /Fo <file>)"

Open tex3d opened this issue 1 year ago • 1 comments

Description Several of DXC's tool options, such as /Qstrip_debug have help text like this added to the end: "(must be used with /Fo <file>)" However, these options do not technically require /Fo to be used for dxc. This text may be confusing, so perhaps it should be removed. These options may not do much without /Fo, since they impact what's included in the output specified by /Fo, but it's not invalid.

I think the text was added in relation to container modification. When you load a shader container from file with /dumpbin these options only apply to the new container output specified by /Fo, not the original loaded container file. It might make sense to emit a warning in a case where the option does nothing because you aren't outputting a container, but this text in the option isn't necessary.

These are the affected options:

  • -extractrootsignature - It probably makes sense to leave the text on this option, since the only scenario this is used for is the /dumpbin container modification scenario.
  • -Qstrip_debug
  • -Qstrip_priv
  • -Qstrip_reflect
  • -Qstrip_rootsignature

Additionally, the /Qstrip_debug option says "Strip debug information from 4_0+ shader bytecode", which was inherited directly from FXC. Since DXC never produced 4_0 or 5_0 bytecode (only 6_0+), this is odd. FXC had it because of differences in functionality between DX9 and DX10 shader targets. The "4_0+" should probably be removed for DXC.

https://github.com/microsoft/DirectXShaderCompiler/blob/130877392c263888ef06bab768856d3dab1f1c9a/include/dxc/Support/HLSLOptions.td#L495-L496

Environment

  • DXC version: any
  • Host Operating System: any

tex3d avatar Mar 12 '24 01:03 tex3d

If this is just rewording help text, that's trivial, if it makes the text more complicated based on other flags, that gets more error-prone.

pow2clk avatar Mar 12 '24 15:03 pow2clk