|
| 1 | +name: "Dep: Build spirv_to_dxil (Mesa)" |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + inputs: |
| 6 | + repository: |
| 7 | + description: Mesa repository to build (fork or upstream) |
| 8 | + default: stride3d/mesa |
| 9 | + required: false |
| 10 | + branch: |
| 11 | + description: Mesa branch/ref to build |
| 12 | + default: main |
| 13 | + required: false |
| 14 | + |
| 15 | +jobs: |
| 16 | + build-windows: |
| 17 | + name: Build spirv_to_dxil (Windows x64) |
| 18 | + runs-on: windows-2025-vs2026 |
| 19 | + steps: |
| 20 | + - name: Checkout Mesa |
| 21 | + uses: actions/checkout@v4 |
| 22 | + with: |
| 23 | + repository: ${{ github.event.inputs.repository || 'stride3d/mesa' }} |
| 24 | + ref: ${{ github.event.inputs.branch || 'main' }} |
| 25 | + path: mesa-src |
| 26 | + |
| 27 | + - name: Install build dependencies |
| 28 | + shell: pwsh |
| 29 | + run: | |
| 30 | + python -m pip install --upgrade pip |
| 31 | + python -m pip install meson ninja mako |
| 32 | +
|
| 33 | + - name: Setup MSVC environment |
| 34 | + uses: ilammy/msvc-dev-cmd@v1 |
| 35 | + with: |
| 36 | + arch: x64 |
| 37 | + |
| 38 | + - name: Configure Mesa |
| 39 | + shell: cmd |
| 40 | + working-directory: mesa-src |
| 41 | + run: | |
| 42 | + set PYTHONUTF8=1 |
| 43 | + meson setup _build ^ |
| 44 | + --default-library=shared ^ |
| 45 | + --buildtype=release ^ |
| 46 | + --wrap-mode=default ^ |
| 47 | + -Dshared-glapi=disabled ^ |
| 48 | + -Dgles1=disabled ^ |
| 49 | + -Dgles2=disabled ^ |
| 50 | + -Dopengl=false ^ |
| 51 | + -Degl=disabled ^ |
| 52 | + -Dglx=disabled ^ |
| 53 | + -Dvulkan-drivers= ^ |
| 54 | + -Dgallium-drivers= ^ |
| 55 | + -Dplatforms= ^ |
| 56 | + -Dmicrosoft-clc=disabled ^ |
| 57 | + -Dspirv-to-dxil=true ^ |
| 58 | + -Dbuild-tests=false ^ |
| 59 | + -Dllvm=disabled |
| 60 | +
|
| 61 | + - name: Build |
| 62 | + shell: cmd |
| 63 | + working-directory: mesa-src |
| 64 | + run: | |
| 65 | + set PYTHONUTF8=1 |
| 66 | + meson compile -C _build spirv_to_dxil |
| 67 | +
|
| 68 | + - name: Collect DLL |
| 69 | + shell: pwsh |
| 70 | + run: | |
| 71 | + New-Item -ItemType Directory -Force -Path out | Out-Null |
| 72 | + $dll = Get-ChildItem -Recurse mesa-src/_build -Filter spirv_to_dxil.dll | Select-Object -First 1 |
| 73 | + Copy-Item $dll.FullName out/spirv_to_dxil.dll |
| 74 | + $pdb = Get-ChildItem -Recurse mesa-src/_build -Filter spirv_to_dxil.pdb -ErrorAction SilentlyContinue | Select-Object -First 1 |
| 75 | + if ($pdb) { Copy-Item $pdb.FullName out/spirv_to_dxil.pdb } |
| 76 | + # Record commit for traceability |
| 77 | + $commitHash = git -C mesa-src rev-parse HEAD |
| 78 | + "Mesa commit: $commitHash" | Out-File out/VERSION.txt |
| 79 | + Get-ChildItem out |
| 80 | +
|
| 81 | + - name: Upload artifact |
| 82 | + uses: actions/upload-artifact@v4 |
| 83 | + with: |
| 84 | + name: spirv_to_dxil-win-x64 |
| 85 | + path: out/ |
0 commit comments