https://learn.microsoft.com/en-us/windows/win32/direct3dhlsl/dx-graphics-hlsl-part1:
This topic covers the FXC.EXE compiler used for Shader Models 2 through 5.1. For Shader Model 6, you use DXC.EXE instead, which is documented in Using dxc.exe and dxcompiler.dll. Visual Studio will use DXC.EXE automatically when Shader Model 6 is selected for the HLSL Property Page configuration.
I have an hlsl file, which visual studio is compiling at build time to a .cso file. As per the docs, Visual studio is automatically using fxc if I specify shader model 5 /T cs_5_0 in the file's properties.
But I need to use /HV 2021 which requires dxc. How can I get visual studio to use dxc with /T cs_5_0? Are there properties I can set?
ChatGPT want's be to use a Custom Build Step.
I tried changing Item Type from HLSL Compiler to Custom Build Tool but this caused CreateComputePipelineState to fail with 0x80004005 : 'Unspecified error'...
Seems like DXC is not compatible with shader models < 6. Would have been nice if they gave a warning...