Skip to content

Commit

Permalink
Integrate FSR2 automatic building to the project
Browse files Browse the repository at this point in the history
  • Loading branch information
CompulsiveComputing committed Jul 1, 2023
1 parent bfe95a1 commit ed26913
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions BuildFSR2.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
@echo off
setlocal
set "origin=%cd%\"
set "buildPath=..\external\FidelityFX-FSR2\build"
set "slnDX12=FSR2_Sample_DX12.sln"
set "slnVK=FSR2_Sample_VK.sln"

echo Current working directory: %origin%

REM Clear old artifacts
echo Clearing old artifacts...
cd /d "%origin%%buildPath%"
if exist "DX12" (
echo Removing old DX12 artifacts...
rd /s /q "DX12" > nul 2>&1
)
if exist "VK" (
echo Removing old VK artifacts...
rd /s /q "VK" > nul 2>&1
)

REM Regenerate artifacts
echo Regenerating artifacts...
cd /d "%origin%%buildPath%"
call GenerateSolutions.bat > nul 2>&1

REM Build FSR2_Sample_DX12.sln
call :BuildSolution "%origin%%buildPath%\DX12\%slnDX12%" "Debug" "DX12"
call :BuildSolution "%origin%%buildPath%\DX12\%slnDX12%" "Release" "DX12"

REM Build FSR2_Sample_VK.sln
call :BuildSolution "%origin%%buildPath%\VK\%slnVK%" "Debug" "VK"
call :BuildSolution "%origin%%buildPath%\VK\%slnVK%" "Release" "VK"

cd /d "%origin%"
goto :endofBuildFSR2

REM Function to build a solution file
:BuildSolution
set "solutionPath=%~1"
set "configuration=%~2"
if exist "%solutionPath%" (
echo Building %solutionPath%...
cd /d "%origin%%buildPath%\%~3"
MSBUILD.exe "%solutionPath%" /t:Build /p:Configuration=%configuration%
) else (
echo %solutionPath% not found. Skipping build.
)
exit /b

:endofBuildFSR2
endlocal

0 comments on commit ed26913

Please sign in to comment.