build(d3d12_x): compile the libraries with MSVC again #38
No reviewers
Labels
No labels
accessibility
bug
ci
docs
documentation
duplicate
enhancement
fixes issue
good first issue
help wanted
invalid
library request
libs
needs rebase
question
relinker
stale
tools
unblocks title
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Dark3581--AnyBox!38
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/38/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@CaseReed on GitHub · 2026-11-22 17:23 UTC · original
CaseReed:fix/msvc-d3d12x→main· +18 −5 · 4 files · 1 commits · merged 2026-11-22 20:48 UTCWhat
mainno longer builds with MSVC 2022, whichdocs/dev/BUILD.mdlists as supported. Three causes, all in code added since #8:vulkan/PipelineCompiler.cppandvulkan/TitleBufferWindow.cppcallstd::max(/std::min(after<windows.h>, whosemin/maxmacros expand them (C2589). They now use the(std::min)(...)form already used inruntime/src/Runtime.cpp.tests/ShaderStoreProbe.cpphas a local namedsmall. The Windows SDK'srpcndr.hdefinessmallaschar; mingw-w64 only does so for the resource compiler. Renamed toundersized.d3d12_x/include/Exports.hppdeclares six exports that<d3d12.h>already declares withoutdllexport(D3D12CreateDevice,D3D12GetDebugInterface, the two serializers and the two deserializer creators). GCC merges the attributes; MSVC refuses the second declaration (C2375, "redefinition; different linkage"). The header now defines those six names toAbxSdk<Name>while it includes<d3d12.h>and undefines them right after, so the SDK's prototypes get another name and each export keeps its singleABX_APIdeclaration. ThePFN_D3D12_*types and everything else in the header are untouched, and__func__inRootSignature.cppstill gives the real name forGetProcAddress.No behaviour change. One thing to know about the rename: it relies on
Exports.hppbeing the first to include<d3d12.h>in a translation unit, which holds today (Inventory.cpp,RootSignature.cpp). If that stops holding, MSVC fails to compile again; nothing breaks silently.Suggestion, your call: CI only builds with MSYS2 GCC, so this can come back with any PR. An MSVC job would be the same three
cmake/cteststeps afterilammy/msvc-dev-cmd, withsetup-python. I can send it as a separate PR if you want it.Tested
Windows 11, MSVC 19.38 (VS 2022), Windows SDK 10.0.26100, Ninja, Release, clean build directory:
pipeline_probeskipped ("the Khronos validation layer is not installed" on this machine).dumpbin /exports ab_d3d12_x.dll: the seven expected names, undecorated.python tools/check_conventions.pyandpython tools/debt_fold.py --checkpass.Exports.hppwith definitions of three of the exports compiles with MinGW-w64 GCC 15.2 (UCRT) on Compiler Explorer, labels undecorated.Not tested: a full MinGW build (no GCC on this machine); the Windows CI job is the check for it. Before the change, the same tree failed with the errors above.
Self-review: an independent pass over the diff (mingw-w64 and SDK headers, the tools that parse
Exports.hpp, other barestd::min/std::maxand macro-colliding names in the tree) found nothing blocking.vulkan/DescriptorTable.cpphas a barestd::max(that is fine today because that file never sees<windows.h>.Checklist
main; no other open PR implements the same functionspython tools/check_conventions.pypasses (no comments in code, one declaration per export, Conventional Commit subjects)AbxNotImplemented/AbxUnsupported); silent stubs are listed under Silent stubs through a debt fragmentdocs/dev/debt/changes/<branch>.md(none changed)🤖 Generated with Claude Code
@Dark3581 on GitHub · 2026-11-22 20:48 UTC · original · approved these changes
Reviewed — looks good
All three causes are real and the fixes are the right shape; merging.
What I ran
Head
87b0f65, merged onto currentmain(with #41, #43 and #44). Windows 10, Release, Ninja, clean build directories:Results
ab_gameinput.dllgameinput.lib, which SDK 22621 does not ship; unrelated to this PRcheck_conventions.pydebt_fold.py --checkFindings
Blocking
None.
Non-blocking
mainmoved after this was opened: #43 added three more bare calls (std::mintwice invulkan/PipelineCompiler.cpp,std::maxintests/PsoProbe.cpp) that break MSVC the same way. That is my code, so I fix it in a follow-up commit onmainwith the(std::min)(...)form you used.Not verified
The
Exports.hpprename with the Windows SDK 26100 headers (this machine has 22621).Thanks — clear write-up, and the note about
Exports.hpphaving to be the first to include<d3d12.h>is exactly the kind of constraint that saves someone an hour later.@Dark3581 on GitHub · 2026-11-22 20:57 UTC · original
Follow-up for the code that landed after this PR was opened: #45 puts the remaining bare
std::min/std::maxcalls in the(std::min)(...)form, somainbuilds with MSVC 2022 again (all butab_gameinput.dll, which needs a newer Windows SDK than my machine has) and passes 61/61.