Preserve full precision for shadow rays #14
Workflow file for this run
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
| name: Build | |
| on: | |
| push: | |
| tags: | |
| # CalVer release tags: v2026.5, v2026.6, v2026.6.1, ... | |
| - 'v[0-9][0-9][0-9][0-9].[0-9]*' | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| env: | |
| # 1.4.341 is the first SDK that ships VK_EXT_descriptor_heap, which | |
| # nvpro_core2/nvvk/descriptor_heap_writer.hpp requires. Bump as needed | |
| # when nvpro_core2 starts using newer Vulkan symbols. | |
| VULKAN_SDK_VERSION: 1.4.341.1 | |
| # nvpro_core2 is checked out as a sibling so FindNvproCore2.cmake picks it up. | |
| # Head is fine; bump this if you ever need to pin to a specific tag/SHA. | |
| NVPRO_CORE2_REF: main | |
| jobs: | |
| build: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - os: windows-latest | |
| platform: windows-x64 | |
| - os: ubuntu-latest | |
| platform: linux-x64 | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: Checkout vk_gltf_renderer | |
| uses: actions/checkout@v4 | |
| with: | |
| path: vk_gltf_renderer | |
| # Full history so `git describe --tags` works on workflow_dispatch. | |
| fetch-depth: 0 | |
| # Place nvpro_core2 as a SIBLING of vk_gltf_renderer. | |
| # FindNvproCore2.cmake searches ${CMAKE_SOURCE_DIR}/.. and will pick this up. | |
| # No submodule needed; this also keeps the repo dual-remote (GitHub + GitLab) clean. | |
| - name: Checkout nvpro_core2 | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: nvpro-samples/nvpro_core2 | |
| ref: ${{ env.NVPRO_CORE2_REF }} | |
| path: nvpro_core2 | |
| - name: Determine version | |
| id: version | |
| shell: bash | |
| working-directory: vk_gltf_renderer | |
| run: | | |
| if [[ "${GITHUB_REF}" == refs/tags/v* ]]; then | |
| tag="${GITHUB_REF#refs/tags/v}" | |
| echo "release_version=${tag}" >> "${GITHUB_OUTPUT}" | |
| echo "artifact_version=${tag}" >> "${GITHUB_OUTPUT}" | |
| echo "Building tagged release: ${tag}" | |
| else | |
| short_sha="$(git rev-parse --short HEAD)" | |
| # Leave release_version empty so CMake's git-describe fallback runs. | |
| echo "release_version=" >> "${GITHUB_OUTPUT}" | |
| echo "artifact_version=dispatch-${short_sha}" >> "${GITHUB_OUTPUT}" | |
| echo "Building untagged dispatch: dispatch-${short_sha}" | |
| fi | |
| - name: Install Vulkan SDK (Windows) | |
| if: runner.os == 'Windows' | |
| shell: pwsh | |
| run: | | |
| $url = "https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/windows/vulkan_sdk.exe" | |
| Write-Host "Downloading Vulkan SDK from $url" | |
| Invoke-WebRequest -Uri $url -OutFile vulkan_sdk.exe | |
| Write-Host "Installing Vulkan SDK..." | |
| Start-Process -FilePath .\vulkan_sdk.exe -ArgumentList "--accept-licenses --default-answer --confirm-command install" -Wait | |
| $sdkPath = "C:\VulkanSDK\${{ env.VULKAN_SDK_VERSION }}" | |
| echo "VULKAN_SDK=$sdkPath" >> $env:GITHUB_ENV | |
| echo "$sdkPath\Bin" >> $env:GITHUB_PATH | |
| - name: Install Vulkan SDK (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| SDK_URL="https://sdk.lunarg.com/sdk/download/${{ env.VULKAN_SDK_VERSION }}/linux/vulkan_sdk.tar.xz" | |
| echo "Downloading Vulkan SDK from $SDK_URL" | |
| mkdir -p "$HOME/vulkan_sdk" | |
| cd "$HOME/vulkan_sdk" | |
| wget -q -O vulkan_sdk.tar.xz "$SDK_URL" | |
| tar -xf vulkan_sdk.tar.xz | |
| rm vulkan_sdk.tar.xz | |
| SDK_ROOT="$HOME/vulkan_sdk/${{ env.VULKAN_SDK_VERSION }}/x86_64" | |
| if [ ! -d "$SDK_ROOT" ]; then | |
| echo "ERROR: expected SDK root not found at $SDK_ROOT" >&2 | |
| ls "$HOME/vulkan_sdk/${{ env.VULKAN_SDK_VERSION }}" >&2 || true | |
| exit 1 | |
| fi | |
| echo "VULKAN_SDK=$SDK_ROOT" >> "$GITHUB_ENV" | |
| echo "$SDK_ROOT/bin" >> "$GITHUB_PATH" | |
| echo "LD_LIBRARY_PATH=$SDK_ROOT/lib:${LD_LIBRARY_PATH:-}" >> "$GITHUB_ENV" | |
| echo "VK_LAYER_PATH=$SDK_ROOT/share/vulkan/explicit_layer.d" >> "$GITHUB_ENV" | |
| echo "Installed Vulkan SDK at: $SDK_ROOT" | |
| - name: Install Linux build dependencies | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo apt-get install -y \ | |
| libx11-dev libxcb1-dev libxcb-keysyms1-dev libxcursor-dev \ | |
| libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev libtbb-dev \ | |
| libgl-dev | |
| # CUDA Toolkit is required at link time for OptiX denoiser interop. | |
| # cudart is delay-loaded on Windows and bundled at install on Linux, | |
| # so the resulting binary still runs on machines without CUDA installed. | |
| - name: Install CUDA Toolkit | |
| uses: Jimver/cuda-toolkit@v0.2.19 | |
| with: | |
| cuda: '12.6.0' | |
| method: 'network' | |
| sub-packages: '["cudart", "nvcc"]' | |
| - name: Configure (Windows) | |
| if: runner.os == 'Windows' | |
| working-directory: vk_gltf_renderer | |
| run: > | |
| cmake -S . -B build -G "Visual Studio 17 2022" -A x64 | |
| -DUSE_DEFAULT_SCENE=OFF | |
| -DUSE_OPTIX_DENOISER=ON | |
| -DUSE_DLSS=ON | |
| -DUSE_DRACO=ON | |
| -DBUILD_TESTING=OFF | |
| -DRELEASE_VERSION="${{ steps.version.outputs.release_version }}" | |
| # Note: we use Unix Makefiles instead of Ninja because nvpro_core2's | |
| # FindWebP.cmake sets CMAKE_BUILD_TYPE to a junk string containing | |
| # angle brackets ("<any string works here ...>") to work around libwebp's | |
| # CMake. Ninja's lexer rejects '<' / '>' in rule names; Make and the | |
| # Visual Studio generator are not affected. Switch back to Ninja once | |
| # the upstream FindWebP.cmake guards that hack on multi-config only. | |
| - name: Configure (Linux) | |
| if: runner.os == 'Linux' | |
| working-directory: vk_gltf_renderer | |
| run: > | |
| cmake -S . -B build -G "Unix Makefiles" | |
| -DCMAKE_BUILD_TYPE=Release | |
| -DUSE_DEFAULT_SCENE=OFF | |
| -DUSE_OPTIX_DENOISER=ON | |
| -DUSE_DLSS=ON | |
| -DUSE_DRACO=ON | |
| -DBUILD_TESTING=OFF | |
| -DRELEASE_VERSION="${{ steps.version.outputs.release_version }}" | |
| - name: Build | |
| working-directory: vk_gltf_renderer | |
| run: cmake --build build --config Release --parallel | |
| # CMake's install(TARGETS ... RUNTIME_DEPENDENCIES) resolves every shared | |
| # library the binary links against. libcuda.so.1 lives in the NVIDIA | |
| # driver (not the CUDA Toolkit) and isn't on a GPU-less CI runner, so | |
| # resolution fails. Symlink the CUDA Toolkit's linker stub at a system | |
| # path; the path matches POST_EXCLUDE_REGEXES "^/usr/lib" inside | |
| # nvpro_core2's copy_to_runtime_and_install, so the stub is found by | |
| # the resolver but NOT copied into the install tree -- libcuda.so.1 | |
| # will come from the end user's NVIDIA driver at runtime. | |
| - name: Provide CUDA driver stub for install resolution | |
| if: runner.os == 'Linux' | |
| run: sudo ln -sf "$CUDA_PATH/lib64/stubs/libcuda.so" /usr/lib/x86_64-linux-gnu/libcuda.so.1 | |
| - name: Install | |
| working-directory: vk_gltf_renderer | |
| run: cmake --install build --config Release --prefix _install | |
| - name: Prepare package | |
| shell: bash | |
| working-directory: vk_gltf_renderer | |
| run: | | |
| folder="vk_gltf_renderer-${{ steps.version.outputs.artifact_version }}-${{ matrix.platform }}" | |
| mkdir staging | |
| mv _install "staging/${folder}" | |
| if [ "$RUNNER_OS" = "Linux" ]; then | |
| chmod +x "staging/${folder}/vk_gltf_renderer" | |
| fi | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: vk_gltf_renderer-${{ steps.version.outputs.artifact_version }}-${{ matrix.platform }} | |
| path: vk_gltf_renderer/staging | |
| if-no-files-found: error | |
| release: | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Determine version | |
| id: version | |
| run: echo "version=${GITHUB_REF#refs/tags/v}" >> "${GITHUB_OUTPUT}" | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| merge-multiple: true | |
| - name: Create release archives | |
| shell: bash | |
| run: | | |
| v="${{ steps.version.outputs.version }}" | |
| cd artifacts | |
| zip -r "../vk_gltf_renderer-${v}-windows-x64.zip" "vk_gltf_renderer-${v}-windows-x64" | |
| tar -czf "../vk_gltf_renderer-${v}-linux-x64.tar.gz" "vk_gltf_renderer-${v}-linux-x64" | |
| - name: Create draft release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| draft: true | |
| generate_release_notes: true | |
| files: | | |
| vk_gltf_renderer-*.zip | |
| vk_gltf_renderer-*.tar.gz |