-
Notifications
You must be signed in to change notification settings - Fork 92
/
BuildSamplesSolutionVK.bat
165 lines (150 loc) · 5.28 KB
/
BuildSamplesSolutionVK.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
:: This file is part of the FidelityFX SDK.
::
:: Copyright (C) 2024 Advanced Micro Devices, Inc.
::
:: Permission is hereby granted, free of charge, to any person obtaining a copy
:: of this software and associated documentation files(the "Software"), to deal
:: in the Software without restriction, including without limitation the rights
:: to use, copy, modify, merge, publish, distribute, sublicense, and /or sell
:: copies of the Software, and to permit persons to whom the Software is
:: furnished to do so, subject to the following conditions :
::
:: The above copyright notice and this permission notice shall be included in
:: all copies or substantial portions of the Software.
::
:: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
:: IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
:: FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
:: AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
:: LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
:: OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
:: THE SOFTWARE.
@echo off
echo ===============================================================
echo.
echo FidelityFX Samples Build System
echo.
echo ===============================================================
echo.
set samples_build_options=-DRUNTIME_SHADER_RECOMPILE=0
set sdk_build_options=-DFFX_AUTO_COMPILE_SHADERS=1
set build_as_dll=
set /P build_as_dll=Build the SDK as DLL [y/n]?
if /i "%build_as_dll%" == "Y" (
set sdk_build_options=-DFFX_AUTO_COMPILE_SHADERS=1 -DFFX_BUILD_AS_DLL=1
set samples_build_options=-DFFX_BUILD_AS_DLL=1
)
:select_component
ECHO 1. ALL
ECHO 2. BLUR
ECHO 3. BREADCRUMBS
ECHO 4. BRIXELIZER GI
ECHO 5. CACAO
ECHO 6. CAS
ECHO 7. DOF
ECHO 8. FSR
ECHO 9. HYBRID REFLECTIONS
ECHO 10. HYBRID SHADOWS
ECHO 11. LENS
ECHO 12. LPM
ECHO 13. PARALLEL SORT
ECHO 14. SPD
ECHO 15. SSSR
ECHO 16. VRS
ECHO.
set /P samples=Enter numbers of which samples to build [space delimitted]:
:loop
for /f "tokens=1*" %%a in ("%samples%") do (
if %%a == 1 (
set samples_build_options=-DFFX_ALL=ON %samples_build_options%
set sdk_build_options=-DFFX_ALL=ON %sdk_build_options%
)
if %%a == 2 (
set samples_build_options=-DFFX_BLUR=ON %samples_build_options%
set sdk_build_options=-DFFX_BLUR=ON %sdk_build_options%
)
if %%a == 3 (
set samples_build_options=-DFFX_BREADCRUMBS=ON %samples_build_options%
set sdk_build_options=-DFFX_BREADCRUMBS=ON %sdk_build_options%
)
if %%a == 4 (
set samples_build_options=-DFFX_BRIXELIZER_GI=ON %samples_build_options%
set sdk_build_options=-DFFX_BRIXELIZER=ON -DFFX_BRIXELIZER_GI=ON %sdk_build_options%
)
if %%a == 5 (
set samples_build_options=-DFFX_CACAO=ON %samples_build_options%
set sdk_build_options=-DFFX_CACAO=ON %sdk_build_options%
)
if %%a == 6 (
set samples_build_options=-DFFX_CAS=ON %samples_build_options%
set sdk_build_options=-DFFX_CAS=ON %sdk_build_options%
)
if %%a == 7 (
set samples_build_options=-DFFX_DOF=ON %samples_build_options%
set sdk_build_options=-DFFX_DOF=ON %sdk_build_options%
)
if %%a == 8 (
set samples_build_options=-DFFX_FSR=ON %samples_build_options%
set sdk_build_options=-DFFX_FSR1=ON %sdk_build_options%
)
if %%a == 9 (
set samples_build_options=-DFFX_HYBRIDREFLECTIONS=ON %samples_build_options%
set sdk_build_options=-DFFX_CLASSIFIER=ON -DFFX_DENOISER=ON -DFFX_SPD=ON %sdk_build_options%
)
if %%a == 10 (
set samples_build_options=-DFFX_HYBRIDSHADOWS=ON %samples_build_options%
set sdk_build_options=-DFFX_CLASSIFIER=ON -DFFX_DENOISER=ON %sdk_build_options%
)
if %%a == 11 (
set samples_build_options=-DFFX_LENS=ON %samples_build_options%
set sdk_build_options=-DFFX_LENS=ON %sdk_build_options%
)
if %%a == 12 (
set samples_build_options=-DFFX_LPM=ON %samples_build_options%
set sdk_build_options=-DFFX_LPM=ON %sdk_build_options%
)
if %%a == 13 (
set samples_build_options=-DFFX_PARALLEL_SORT=ON %samples_build_options%
set sdk_build_options=-DFFX_PARALLEL_SORT=ON %sdk_build_options%
)
if %%a == 14 (
set samples_build_options=-DFFX_SPD=ON %samples_build_options%
set sdk_build_options=-DFFX_SPD=ON %sdk_build_options%
)
if %%a == 15 (
set samples_build_options=-DFFX_SSSR=ON %samples_build_options%
set sdk_build_options=-DFFX_SSSR=ON -DFFX_DENOISER=ON %sdk_build_options%
)
if %%a == 16 (
set samples_build_options=-DFFX_VRS=ON %samples_build_options%
set sdk_build_options=-DFFX_VRS=ON %sdk_build_options%
)
set samples=%%b
)
if defined samples goto :loop
set build_type=-DBUILD_TYPE=SAMPLES_VK
set sdk_build_options=-DFFX_API_BACKEND=VK_X64 %sdk_build_options%
:: Start by building the backend SDK
echo Building native x64 backends: %sdk_build_options%
cd sdk
call BuildFidelityFXSDK.bat %sdk_build_options%
cd ..
:: Check directories exist and create if not
if not exist build\ (
mkdir build
)
cd build
:: Clear out CMakeCache
if exist CMakeFiles\ (
rmdir /S /Q CMakeFiles
)
if exist CMakeCache.txt (
del /S /Q CMakeCache.txt
)
echo.
echo Building SDK sample solutions %samples_build_options%
echo.
cmake -A x64 .. %build_type% %samples_build_options%
:: Come back to root level
cd ..
pause