Skip to content

[D3D12] HLSL 6? #8164

@soufianekhiat

Description

@soufianekhiat

By reading old messages:
#7072 (comment)
And this message:

So, this seems to be a bug in the "old" HLSL compiler (FXC, `d3dcompiler_47.dll`, produces DXBC).
The bug does not happen in the "new" compiler (DXC, `dxcmpiler.dll`, produces DXIL).
Since FXC is being deprecated, it's unlikely we'll get enough traction to push for a fix.
Moving our d3d12 runtime to the new compiler is the best choice, but there are caveats:
- need to modify the HLSL code-gen: kernel arguments need to be relocated t global scope; since Halide packs multiple kernels into the same file, argument conflicts are prone to happen.
- need to have access to the new DXC compiler, which does not ship with the Microsoft D3D12 runtime yet
- need to jump to Shader Model 6, which could break some hardware compatibility (or maybe I'm too paranoid here)
- RenderDoc can't seem to be able to step-debug through DXIL; ~maybe PIX can do it?~, but PIX can.

Originally posted by @slomp in #7072 (comment)

Do we have a plan? How can I help?. I think we need to give more love of D3D12.

  • dxc is distributed with Windows SDK.
  • And the gap is pretty closed with LLVM.
  • Having HLSL 6 will allow us to have Atomic for 64 bits integers without that, multiple most of histogram test fail on D3D12 due to the lack of those atomic.

References:
https://github.com/microsoft/DirectXShaderCompiler/wiki/FAQ#how-does-the-new-compiler-integrate-into-the-windows-sdk
https://discourse.llvm.org/t/rfc-adding-hlsl-and-directx-support-to-clang-llvm/60783
https://github.com/microsoft/DirectXShaderCompiler/wiki/SPIR%E2%80%90V-CodeGen
https://github.com/Microsoft/DirectXShaderCompiler/blob/main/docs/SPIR-V.rst
https://microsoft.github.io/DirectX-Specs/d3d/HLSL_SM_6_6_Int64_and_Float_Atomics.html#integer-64-bit-capabilities

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions