Repository navigation
Conversation
tests/desktop_gpu.cpp (the two d3d12x list checks), src/startup_stubs/audio_sink.cpp, tests/startup_stream_setup.cpp and tests/d3d12x_device_check.cpp were each compiled once per executable that links them, with the same standard, include directories and definitions. They are now OBJECT libraries whose objects the executables take with $<TARGET_OBJECTS:...>. No target, test or file name changes; the shared-library and control variants that differ in definitions or runtime are left as they are. Four compiles fewer per configuration.
Collaborator
Author
|
Closing this draft for now to help keep the open PR queue manageable; the branch stays preserved on the fork so it can be reopened once the queue clears. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Build-time only. No target, CTest name, source file or test behavior changes.
What
Four sources were compiled once per executable that links them, with the same C++ standard, include directories (same order), definitions and runtime. Each is now an
OBJECTlibrary whose objects the executables take with$<TARGET_OBJECTS:...>, the pattern the file already uses forera_physical_lenient.tests/d3d12x_device_check.cppd3d12x_device_check,d3d12x_device_struct_return_controltests/startup_stream_setup.cppstartup_stream_consumer,startup_stream_depthsrc/startup_stubs/audio_sink.cppstartup_audio_output,startup_audio_pacingtests/desktop_gpu.cppd3d12x_compute_list_check,d3d12x_graphics_list_checkFour compiles fewer in each configuration, out of about 800. The saving is a few seconds of compiler time at most (D3D12, DXGI and WASAPI headers are the cost). I did not measure it, and I am not claiming a wall-clock number.
What I left alone, and why
tests/desktop_gpu.cppinstartup_dump_fence_check,startup_nv12_drawandstartup_plane_refreshwould save two more compiles. Their lines sit next to additions in startup: cache translated graphics pipelines #1641 and startup: clear depth and stencil views (command-list slot 51) #1806, which conflicted when I tried it, so they are unchanged.src/startup_stubs/d3d12_xs_device.cppis in build: share the D3D12 device object across two test targets #1752.xmem_shim,d3d12_xs_shim,cpu_*providers, the archive codec) get a different<target>_EXPORTSdefinition per target, so their command lines are not identical.startup_gamesave_lock_errors_keep,cpu_startup_exe_*,xmem_shim_test_controls,d3d12_xs_rangewith different include directories) are not shared.Checks
git merge-treeof this branch against all 88 open PRs that touchCMakeLists.txt, and against ci: save main sccache right after build; pull requests only read it #1740. For every PR the set of conflicting files and the number of conflict hunks inCMakeLists.txtmatch what the same PR already has againstorigin/mainalone (56 merge cleanly, 32 already conflict withmain). No new conflict, including ci: run the full Windows suites with CTest in parallel #1173, build: share the D3D12 device object across two test targets #1752 and build: write the variants of each x87 fixture in one Python process #1789. The PRs that edittests/startup_stream_setup.cpportests/desktop_gpu.h(startup: invalidate cached constants when the graphics root changes #1808, startup: record SetGraphicsRoot32BitConstant (slot 38) #1726, shader: translate mesh allocations with several vertices and triangles #1779, shader: lower gfx1030 comparison sample LOD and bias #1568, shader: lower paired 16-bit attr0 interpolation under round toward zero in pixel_aot (experiment) #713) change source content only, not compile flags.$<TARGET_OBJECTS:...>in executables, same include-directory order) configured and built with CMake 3.31 and Ninja on Linux: 24 compiles before this change, 20 after, all 11 executables link. The Ninja compile lines for each shared source were identical across their targets before the change.git diff --check origin/main...HEAD,python3 -B tests/docs_links_check.pyandpython3 -B tests/bidi_controls_check.pypass.Not verified
OBJECTlibrary's own; I expect no difference but have not seen it on MSVC.AI-assisted; commands listed were executed locally.