[Build] Generate shaders on build instead of having them checked in

This commit is contained in:
Herman S.
2026-01-14 23:54:27 +09:00
parent 2eea146b1b
commit f2ac39cfd9
241 changed files with 443 additions and 311614 deletions

View File

@@ -82,6 +82,12 @@ jobs:
with:
key: ${{ hashFiles('tools/build/bin/premake5.exe') }}
path: tools/build/bin/premake5
- name: Cache Vulkan SDK
id: cache-vulkan-sdk-linux
uses: actions/cache@v4
with:
path: ~/vulkan-sdk
key: ${{ runner.os }}-vulkan-sdk-latest
- name: Setup
env:
UBUNTU_BASE: ${{ needs.lint.outputs.UBUNTU_BASE }}
@@ -89,8 +95,24 @@ jobs:
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
sudo apt-add-repository "deb http://apt.llvm.org/${UBUNTU_BASE}/ llvm-toolchain-${UBUNTU_BASE}-${{ matrix.LLVM_VERSION }} main"
sudo apt-get -y update
sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev clang-${{ matrix.LLVM_VERSION }} ninja-build
git submodule update --init --depth=1 -j$(getconf _NPROCESSORS_ONLN) $(grep -oP '(?<=path = )(?!third_party\/(DirectXShaderCompiler|FidelityFX-(CAS|FSR)|premake-(androidndk|export-compile-commands))).+' .gitmodules)
sudo apt-get -y install mesa-vulkan-drivers valgrind libc++-dev libc++abi-dev libgtk-3-dev libsdl2-dev libvulkan-dev libx11-xcb-dev clang-${{ matrix.LLVM_VERSION }} ninja-build spirv-tools
# Install Vulkan SDK
if [ '${{ steps.cache-vulkan-sdk-linux.outputs.cache-hit }}' != 'true' ]; then
wget -qO vulkan-sdk.tar.xz https://sdk.lunarg.com/sdk/download/latest/linux/vulkan-sdk.tar.xz
mkdir -p ~/vulkan-sdk
tar -xf vulkan-sdk.tar.xz -C ~/vulkan-sdk
fi
VULKAN_SDK_VERSION=$(ls ~/vulkan-sdk)
echo "VULKAN_SDK=$HOME/vulkan-sdk/$VULKAN_SDK_VERSION/x86_64" >> $GITHUB_ENV
echo "$HOME/vulkan-sdk/$VULKAN_SDK_VERSION/x86_64/bin" >> $GITHUB_PATH
# Verify shader tools are available
which glslangValidator && glslangValidator --version || echo "Warning: glslangValidator not found"
which spirv-opt && spirv-opt --version || echo "Warning: spirv-opt not found"
which spirv-dis || echo "Warning: spirv-dis not found"
git submodule update --init --depth=1 -j$(getconf _NPROCESSORS_ONLN) $(grep -oP '(?<=path = )(?!third_party\/(DirectXShaderCompiler|premake-(androidndk|export-compile-commands))).+' .gitmodules)
if [ '${{ steps.cache.outputs.cache-hit }}' != 'true' ]; then
./xenia-build.py premake
cp third_party/premake-core/bin/release/premake5 tools/build/bin

View File

@@ -68,8 +68,62 @@ jobs:
- uses: actions/checkout@main
with:
fetch-depth: 0
- name: Cache Vulkan SDK
id: cache-vulkan-sdk
uses: actions/cache@v4
with:
path: C:\VulkanSDK
key: ${{ runner.os }}-vulkan-sdk-${{ hashFiles('**/vulkan-sdk.exe') }}
restore-keys: |
${{ runner.os }}-vulkan-sdk-
- name: Setup
run: git submodule update --init --depth=1 -j $env:NUMBER_OF_PROCESSORS (Select-String -CaseSensitive '(?<=path = )(?!third_party\/(FidelityFX-(CAS|FSR)|premake-(androidndk|cmake|export-compile-commands))).+' .gitmodules).Matches.Value
run: |
# Install Vulkan SDK which includes spirv-tools
if (Test-Path -Path "C:\VulkanSDK") {
echo "Vulkan SDK found in cache."
} else {
Invoke-WebRequest -Uri "https://sdk.lunarg.com/sdk/download/latest/windows/vulkan-sdk.exe" -OutFile "vulkan-sdk.exe"
Start-Process -FilePath "vulkan-sdk.exe" -ArgumentList "--accept-licenses", "--default-answer", "--confirm-command", "install" -Wait
}
$env:VULKAN_SDK = "C:\VulkanSDK\$(Get-ChildItem -Path 'C:\VulkanSDK' -Directory | Select-Object -First 1 -ExpandProperty Name)"
$env:PATH = "$env:VULKAN_SDK\Bin;$env:PATH"
echo "VULKAN_SDK=$env:VULKAN_SDK" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
echo "$env:VULKAN_SDK\Bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
# Verify shader tools are available
$spirvOptPath = "$env:VULKAN_SDK\Bin\spirv-opt.exe"
if (Test-Path $spirvOptPath) {
& $spirvOptPath --version
echo "spirv-opt found at: $spirvOptPath"
} else {
echo "Warning: spirv-opt.exe not found at expected location"
}
$glslangPath = "$env:VULKAN_SDK\Bin\glslangValidator.exe"
if (Test-Path $glslangPath) {
& $glslangPath --version
echo "glslangValidator found at: $glslangPath"
} else {
echo "Warning: glslangValidator.exe not found at expected location"
}
$spirvDisPath = "$env:VULKAN_SDK\Bin\spirv-dis.exe"
if (Test-Path $spirvDisPath) {
echo "spirv-dis found at: $spirvDisPath"
} else {
echo "Warning: spirv-dis.exe not found at expected location"
}
# Verify FXC is available (from Windows SDK)
$fxcPaths = Get-ChildItem -Path "${env:ProgramFiles(x86)}\Windows Kits\10\bin\*\x64\fxc.exe" -ErrorAction SilentlyContinue | Sort-Object FullName
if ($fxcPaths) {
$fxcPath = $fxcPaths[-1].FullName
echo "FXC found at: $fxcPath"
} else {
echo "Warning: fxc.exe not found in Windows SDK"
}
git submodule update --init --depth=1 -j $env:NUMBER_OF_PROCESSORS (Select-String -CaseSensitive '(?<=path = )(?!third_party\/(premake-(androidndk|cmake|export-compile-commands))).+' .gitmodules).Matches.Value
- name: Build
run: python xenia-build.py build --config=Release --target=src\xenia-app
- name: Prepare artifacts