build(windows): Mesa's spirv_to_dxil.dll in the third-party build tools, its licenses beside it #2362
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!2362
Loading…
Reference in a new issue
No description provided.
Delete branch "nyannoying/Longshot:build/mesa-third-party"
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?
Summary
The Direct3D 12 back end (#2040) translates the game's shaders with Mesa's
spirv_to_dxil.dll, which it loads at runtime from the game folder. Today a Windows builder has no copy of that DLL: whoever builds
longshot_d3d12.dllfetchesit by hand. This puts the DLL into the Windows builders'
third-partyarchive, with the licenses of the Mesa sources itis built from beside it, so every builder has the same bytes.
#2295 overlaps this. It is a WIP pull request that drops the
third-partyarchive andtools.py assemble. Tools arebuilt from their sources instead, and the release uploads them. This PR is for
mainas it is today. If #2295 landsfirst, Mesa becomes one more tool line in its scheme. The license file, headers and provenance note stay as they are,
and I will rebase onto it. If this lands first, #2295 carries the Mesa DLL along.
scripts/tools.py assemble third-party --mesa <dll>: the DLL goes in atthird_party/mesa-spirv-to-dxil/bin/onlywith the size and SHA-256 that
third_party/mesa-spirv-to-dxil/PROVENANCE.mdpins (mesa-dist-win's Mesa 26.2.6);other bytes are refused.
tools.lock:third-party hookshot-v2.1.0-mesa-26.2.6, the current archive's files with the DLL added. Assemblingis deterministic: the same command gives the same SHA-256 (
2d16ebe2…, 27,925,805 bytes).third_party/mesa-spirv-to-dxil/: the interface headers (spirv_to_dxil.h,dxil_versions.h), the provenance note,and
LICENSE: MIT for most of Mesa, Berkeley SoftFloat's BSD-3-Clause, xxHash's BSD-2-Clause, BSL-1.0, and twopublic-domain files, taken from the SPDX lines and notices of the sources the DLL is built from (
spirv_to_dxil,microsoft/compiler,nir,spirv,util,c11). The DLL imports onlyKERNEL32.docs/dev/reference/releases.md: the archive's new contents.A maintainer uploads the archive before this merges: the new
tools.lockline names a file that is not in the storeyet, and a Windows builder would fail to fetch it. I have the archive and can hand it over.
Read first:
scripts/tools.py(mesa_pinned,mesa_file), thentests/test_tools_mesa.py.Testing
Tested: Windows 11, on my own PC.
tests/test_tools_mesa.py: 7 checks pass. They cover four things:--mesa;LICENSEholds every license the note names.Two broken variants each fail one check:
mesa_file's size and hash test removed (test_other_bytes_refused), andthe SoftFloat notice taken out of
LICENSE(test_the_licenses_are_beside_it).Assembled the archive twice and got the same SHA-256. Compared it file by file with the current archive
(
hookshot-v2.1.0, 8 files): the 8 are byte for byte the same, and the DLL is the only new one. The licenses are inthe repository, not in the archive.
On the D3D12 branch, the Windows game build took the DLL from
third_party/mesa-spirv-to-dxil/bin/and put it, withspirv_to_dxil-LICENSE.txt, besidelongshot_d3d12.dll. That is the same DLL every D3D12 run uses.The game on
maindoes not load this DLL, so nothing here runs in the game.mise run test(Windows,--no-skip): 898 passed, 45 failed, 15 skipped. All but one also fail onmainat0e32bc10, from this PC's setup. The one istests/test_coverage_run.py:scripts/coverage/cover.pydecodestasklist's output as cp1252, which fails on this PC's German Windows depending on the processes running. It alsofails on another branch of mine, and this PR does not touch coverage.
The 44 that also fail on main
nx2/test_bc_storage_views.py,nx2/test_dll.py,nx2/test_insn.py,nx2/test_leaf.py,test_auto_handheld.py,test_build_long_paths.py,test_crash_dialog.py,test_dev_ab.py,test_dev_build.py,test_dev_migrate.py,test_dev_packs.py,test_discover.py,test_driver_cache_folder.py,test_driver_env_choose.py,test_game_layout.py,test_game_menu_mouse_buttons.py,test_input_movie.py,test_job_queue.py,test_lift_lookups.py,test_linux_deps_pins.py,test_linux_driver_fault_guard.py,test_linux_preflight.py,test_linux_tools.py,test_linux_update.py,test_log_open_failure.py,test_longshot_launch.py,test_longshot_saves.py,test_make_game_cache.py,test_menu_save_atomic.py,test_pads_after_menu.py,test_perf_report.py,test_pipeline_state_computes.py,test_pipeline_tour.py,test_posix_cv_wake.py,test_prompt_cache_errors.py,test_readback_wait_bounded.py,test_sampler_admission.py,test_saveload_warm_cache.py,test_sdiv_overflow.py,test_tracy_funcs.py,test_udmabuf_limit_unreadable.py,test_udmabuf_warning.py,test_walk.py,test_wayland_libdecor_hint.pyStill to test:
third-party hookshot-v2.1.0-mesa-26.2.6and builds as before.By hand: I run CI on this PR again after the upload and post the result.
Measurements
Nothing to measure: build tooling only. The game and the renderers are unchanged.
Risks
third-party. Upload first.maindoes not ship or load the DLL.tools.lockandscripts/tools.py. Whichever lands second carries Mesa along, as theSummary says.
Checklist
Ready for review
main; the title is a Conventional Commit.mise run testpasses (any failure that also fails onmainis named).main, or Measurements says why there is nothing to measure.third_party/untouched; nothing GPL-incompatible.No existing part changes: the 4 files are all new, in a new part
third_party/mesa-spirv-to-dxil/with its ownPROVENANCE.mdandtree-sha256, as XeSS (#459), Tracy (#1543) and ReShade (#1861) were added.scripts/check_third_party.py: 18 parts as their notes say.When it applies
tests/that reads changed source is updated, not weakened. The checks that readscripts/tools.pyandtools.lockpass unchanged.tests/test_tools_mesa.pyis new.Assisted-by:/Co-Authored-By:trailers.Ready to merge
main, measured again or a comment says why the numbers still hold.🤖 Generated with Claude Code
Tested in game: Not on main: main's game does not load it. The same DLL, byte for byte (Mesa 26.2.6, SHA-256 8c6e6f8e…, as PROVENANCE.md pins it), with these headers ran today in the Direct3D 12 back end (#2040): Intel Arc B580, driver 32.0.101.9175, Windows 11, a save's first load and Castle Town market, 6 runs, no device lost.
Possibly related, for context:
fd2c7090265e54525a22WIP: build(windows): Mesa's spirv_to_dxil.dll in the third-party build tools, its licenses beside itto build(windows): Mesa's spirv_to_dxil.dll in the third-party build tools, its licenses beside itSuperseded by #2040, which carries Mesa's
spirv_to_dxil.dllin the repository (third_party/mesa-spirv-to-dxil/bin, its bytes pinned by itsPROVENANCE.mdand checked), as asked. No archive upload needed.Pull request closed