Repository navigation
build: apply the shader-compiler /W4 /WX ratchet to MSVC only - #3855
Conversation
CMake sets MSVC for clang-cl, because clang-cl presents the MSVC command line, so the ratchet d654ad8 added reached a compiler it was not written for: clang warns where MSVC does not, and src/gfx1013_vertex_id.cpp fails at /WX with -Wmissing-field-initializers (7 sites). That broke the clang-cl cross-compile documented in docs/non-windows-hosts.md for any target that depends on x2w_shader_compiler. Guard the block with CMAKE_CXX_COMPILER_ID so real MSVC keeps /W4 /permissive- and /WX unchanged, and clang-cl builds the target again. Verified on Debian with clang-cl 19.1.1 and an xwin SDK 10.0.26100 splat, Release: before: cmake --build out/build/clang --target d3d12_xs_shim -> FAILED on x2w_shader_compiler.dir/src/gfx1013_vertex_id.cpp.obj, 7 x 'missing field value initializer [-Werror,-Wmissing-field-initializers]' after: same target -> builds; x2w_shader_compiler.lib (20 MB) and d3d12_xs.dll (15.4 MB) link. The MSVC side is unchanged by inspection only: no MSVC or Windows host here.
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Windows CI on this PR failed, but not because of this change — the only failing test is This change only moves a Codex reviewed at |
R0Y00
left a comment
There was a problem hiding this comment.
Reviewed 4f299d4b. The CMake-only change gates the shader compiler and CLI warning options together, keeping the per-source /WX list and MSVC options intact while excluding the Clang frontend used by the documented clang-cl/xwin build. The author tested that build with clang-cl 19.1.1. I checked the exact diff and verified the hosted Windows log reaches CTest, where the only failed test is the shared native_direct_mesh fixture (+0x34: unmapped graphics export, #3851). I did not rerun the clang-cl/xwin build locally.
…opped 5545de9 moved the sibling container cases onto tests/native_direct_container_check.mesh(), which writes the attribute count at io+0x188, but left the packed-row case on the old pack(body + code, ...) path and dropped the 'struct.pack_into("<I", body, io + 0x188, 1)' line that path needed. The shared body bytearray stayed zero-filled, so the container declared no output attributes. read_guest_shader_container then produced stage.outputs empty with three OSG1 signature rows (SV_Position, COLOR, TEXCOORD), and the export row at target 32 had nothing to map: native compute +0x34: unmapped graphics export at src/gfx1013_direct_graphics.inl:456. This made native_direct_mesh fail on every PR, because the Windows job runs the pr preset and the check is required (R0Y00#3856). No translator change is involved: git diff e387678 5545de9 -- src/gfx1013_direct_graphics.inl src/guest_shader_container.cpp is empty. The fixture was the only thing that changed. Verified on Debian with clang-cl 19.1.1 and the Windows CPython in Wine, against a compile_dxil built at 5770f14 (the failing tree): before: native_direct_mesh_check.py aborting at the integer-row case with 'unmapped graphics export', stage.outputs=0 after: exit 0, 'mesh allocation, indexed outputs, group exchange and negative controls passed' The Windows job itself is the check for the MSVC side.
|
Noting why this is still blocked after your approval, so it does not look like the change is failing on its own merits. The required PR #3861 fixes it and is green on all checks (Windows 9m4s, gfx1013 3m50s, Linux Python 5m26s). It is a one-line fixture restore. One-step path to unblock this one: merge #3861, then I merge current
|
|
Merged the #3861 fixture fix into this branch so the approved change is no longer stuck behind an unrelated failure. Head is now Why here and not "wait for #3861 to merge". You approved this PR, and it was blocked only by the required Windows check failing on What is in the branch now, relative to current Verified on this head:
If #3861 merges first, this merge becomes a no-op — the fixture commit is already in I have not merged anything, and I am not asking you to skip the check — it should now run green on its own. |
Fixes #3853.
What changed. The
/W4 /permissive-+/WXratchetd654ad80added for the shader compiler is now insideMSVCis true for clang-cl as well, because clang-cl presents the MSVC command line, so the ratchet reached a compiler with a different warning set and madesrc/gfx1013_vertex_id.cppfail at/WX(7 ×-Wmissing-field-initializers). Real MSVC keeps exactly the flags and the per-source/WXit had before; nothing else in the block moved.Why this and not a suppression. The commit's own message is "raise MSVC warnings for the shader compiler", so applying it to MSVC matches the stated intent, and it leaves
docs/non-windows-hosts.md's clang-cl route working instead of needing a clang-specific exemption for one warning class. If you would rather keep/W4 /WXactive for clang-cl, the alternative is-Wno-missing-field-initializersfor clang only — say so and I will switch; either way the 7 initializers in that file stay as they are, since they are your file and not this change's subject.Verification — Debian, clang-cl 19.1.1, xwin SDK 10.0.26100 splat, Release, the toolchain file from the clang-cl section of
docs/non-windows-hosts.md:Not established. No MSVC, no Windows host and no GPU here, so the MSVC side is unchanged-by-inspection, not re-measured. The Windows CI job is the check for that. The pure-Python checks are unaffected — this touches only a CMake condition.