Skip to content

Add dxcapi.h to Win32 metadata - #5279

Merged
Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
dxcapi
Oct 30, 2026
Merged

Kenny Kerr (kennykerr) merged 1 commit into
masterfrom
dxcapi

Conversation

@kennykerr

@kennykerr Kenny Kerr (kennykerr) commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Adds dxcapi.h and dxcompiler.lib to tool-win32 so the DXC compiler APIs are available under the new dxcapi feature. Fixes #5191

Omitted due to header bugs:

  • IDxcLinker and IDxcResult - some methods (RegisterLibrary, GetNumOutputs, GetOutputByIndex, PrimaryOutput) are missing STDMETHODCALLTYPE, so they're thiscall on x86 rather than stdcall like the rest of the interface. These will appear once the header is fixed. IDxcResult can still be reached by passing its IID to Compile.
  • IDxcPdbUtils - depends on IDxcResult.
  • CLSID_DxcUtils - defined as a dynamic copy of CLSID_DxcLibrary rather than a constant initializer, see Support additional GUID/CLSID declarations #5190.

DxcCreateInstance uses _Out_ LPVOID* rather than _COM_Outptr_ in the header so it returns HRESULT with a raw out pointer - as the issue mentions, the annotation change can be tracked separately.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the DXC API bindings and feature integration.

No open issues 🎉

What changed in this PR

Adds DXC shader compiler APIs to the Win32 metadata pipeline and exposes them through the
dxcapi feature in windows and windows-sys, addressing #5191.

Changes:

  • Includes dxcapi.h and dxcompiler.lib in the Win32 scrape inputs.
  • Adds DXC metadata and generated bindings for compiler, blob, utility, and related APIs.
  • Wires up feature dependencies and module exports, retaining the documented header-related omissions
    and raw output-pointer signatures.
File Description
metadata/​win32/​dxcapi.rdl Adds DXC constants, types, functions, and COM interfaces.
crates/​tools/​win32/​src/​import_policy.rs Adds dxcompiler.lib for import resolution.
crates/​tools/​win32/​src/​headers.rs Includes dxcapi.h in header scraping.
crates/​libs/​windows/​src/​Windows/​Win32/​mod.rs Exports the feature-gated DXC module.
crates/​libs/​windows/​src/​Windows/​Win32/​dxcapi/​mod.rs Adds generated DXC bindings and COM implementation support.
crates/​libs/​windows/​Cargo.toml Defines the dxcapi feature and dependencies.
crates/​libs/​sys/​src/​Windows/​Win32/​mod.rs Exports the feature-gated raw DXC module.
crates/​libs/​sys/​src/​Windows/​Win32/​dxcapi/​mod.rs Adds raw DXC imports, constants, and data types.
crates/​libs/​sys/​Cargo.toml Defines the dxcapi feature and dependencies.

Review effort: Balanced

@ghost

Copy link
Copy Markdown

Are the problematic headers related to win32metadata? Have you already created an issue or informed the person responsible for the headers?

@kennykerr

Copy link
Copy Markdown
Collaborator Author

No, these headers come from the Windows SDK directly. I suspect they may originate in this project:

https://github.com/microsoft/DirectXShaderCompiler

...but that's just a guess. Damyan Pepper (@damyanp) may know.

@kennykerr
Kenny Kerr (kennykerr) merged commit 54fa0cd into master Oct 30, 2026
47 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add dxcapi.h to header scrape

2 participants