Closed Bug 1903302 (webgpu-dxc) Opened 1 year ago Closed 1 year ago

Switch to DXC on Windows

Categories

(Core :: Graphics: WebGPU, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
135 Branch
Tracking Status
firefox135 --- fixed

People

(Reporter: nical, Assigned: nical)

References

Details

Attachments

(1 file)

We have a lot of issues with fxc which is what we use to compile HLSL shaders on windows. Dxc can be assumed to be present on the system, however it is very buggy, unmaintained and does not support some of the features we need in WebGPU.

dxc unfortunately cannot be assumed to be present on the OS. It is part of the windows SDK or releases can be downloaded on github: https://github.com/microsoft/DirectXShaderCompiler/releases

To use dxc we need two DLLs:

  • d3dcompiler.dll which is in the order of 18MB, is open source and we could build it ourselves should we want to.
  • dxil.dll is in the order of 2MB, is not open source and is necessary to sign the shaders produced by the former.

Both have official builds available for x86, x64 and arm64.

With upcoming versions of the windows SDK we'll be able to get rid of dxil.dll as its functionality will be merged into dxcompiler.dll.

Chrome ships dxc (They make their own builds of d3dcompiler.dll, probably so that they can patch bugs quickly).

TODO

  • [x] Make the build system pull and package dxcompiler.dll and dxc.dll.
  • [x] Remove the dependency on hassle-rs from wgpu-hal (it brings a lot of extra non-trivial code to audit and contains incompatible dependency versions).
  • [x] enable the dxc_shader_compiler feature in wgpu-hal.
  • [x] Add the llvm release license to the list of licenses we depend on.
Summary: Swicth to DXC on windows → Switch to DXC on Windows
Assignee: nobody → nical.bugzilla
Status: NEW → ASSIGNED
Attachment #9412263 - Attachment description: WIP: Bug 1903302 - WIP - Ship dxcompiler.dll and dxil.dll → WIP: Bug 1903302 - Ship dxcompiler.dll and dxil.dll
Attachment #9412263 - Attachment description: WIP: Bug 1903302 - Ship dxcompiler.dll and dxil.dll → Bug 1903302 - Ship dxcompiler.dll and dxil.dll. r=sylvestre,sergesanspaille,#webgpu-reviewers
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/113850da1f80 Ship dxcompiler.dll and dxil.dll. r=sylvestre,glandium,firefox-build-system-reviewers
Flags: needinfo?(nical.bugzilla)
Pushed by nsilva@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/abc609e97895 Ship dxcompiler.dll and dxil.dll. r=sylvestre,glandium,firefox-build-system-reviewers
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 135 Branch
Regressions: 1936146
Depends on: 1940700
Alias: webgpu-dxc
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: