From 4504a5a67d2c47815b814a8c6c1e99cf0d6a6b2c Mon Sep 17 00:00:00 2001 From: iChris4 Date: Mon, 21 Sep 2026 02:55:28 +0200 Subject: [PATCH] Stage the DirectX shader compiler into the custom Dawn package Dawn's install produces only its own DLL, but this package replaces dawn_prebuilt wholesale and LocalBuild.ps1 copies dxcompiler.dll and dxil.dll out of it into the product. Dawn loads those at run time instead of importing them, so a package without them builds and installs cleanly and then fails to compile shaders on D3D12. Co-Authored-By: Claude Opus 5 --- Launcher/Build-DawnVulkan.ps1 | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Launcher/Build-DawnVulkan.ps1 b/Launcher/Build-DawnVulkan.ps1 index 3a78a75..6abca55 100644 --- a/Launcher/Build-DawnVulkan.ps1 +++ b/Launcher/Build-DawnVulkan.ps1 @@ -4,6 +4,8 @@ param( [string]$WorkDirectory = (Join-Path $PSScriptRoot 'artifacts\dawn-vulkan-build'), [string]$Destination = (Join-Path $PSScriptRoot 'artifacts\dawn-vulkan'), + # Source of the DirectX shader compiler DLLs, which Dawn's install does not produce. + [string]$StockDawnDirectory = (Join-Path $PSScriptRoot 'artifacts\dependencies\dawn_prebuilt'), [string]$Python = 'python', [int]$Jobs = 8 ) @@ -46,6 +48,18 @@ if ($LASTEXITCODE -ne 0) { throw 'Dawn build failed.' } if ($LASTEXITCODE -ne 0) { throw 'Dawn installation failed.' } $dll = Join-Path $Destination 'bin\webgpu_dawn.dll' if (-not (Test-Path -LiteralPath $dll)) { throw "Dawn DLL missing: $dll" } +# Dawn's own install stages only its DLL, but this package replaces dawn_prebuilt wholesale and +# LocalBuild.ps1 copies the DirectX shader compiler out of it into the product. Dawn loads those +# two at run time rather than importing them, so leaving them out breaks D3D12 shader compilation +# long after installation instead of failing here. +foreach ($name in @('dxcompiler.dll', 'dxil.dll')) { + if (Test-Path -LiteralPath (Join-Path $Destination "bin\$name")) { continue } + $stock = Join-Path $StockDawnDirectory "bin\$name" + if (-not (Test-Path -LiteralPath $stock)) { + throw "The pinned Dawn package has no $name; point -StockDawnDirectory at the prepared dawn_prebuilt." + } + Copy-Item -LiteralPath $stock -Destination (Join-Path $Destination 'bin') +} [ordered]@{ SourceRevision = $revision AuroraVulkanAbi = 1