-
Notifications
You must be signed in to change notification settings - Fork 46
/
3-Prepare NRD SDK.bat
89 lines (64 loc) · 2.07 KB
/
3-Prepare NRD SDK.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
@echo off
set NRD_DIR=.
set "copy_shaders="
set "no_copy_shaders="
set "copy_integration="
set "no_copy_integration="
:PARSE
if "%~1"=="" goto :MAIN
if /i "%~1"=="-h" goto :HELP
if /i "%~1"=="--help" goto :HELP
if /i "%~1"=="--shaders" set "copy_shaders=y"
if /i "%~1"=="--no-shaders" set "no_copy_shaders=y"
if /i "%~1"=="--integration" set "copy_integration=y"
if /i "%~1"=="--no-integration" set "no_copy_integration=y"
shift
goto :PARSE
:MAIN
rd /q /s "_NRD_SDK"
mkdir "_NRD_SDK\Include"
mkdir "_NRD_SDK\Lib\Debug"
mkdir "_NRD_SDK\Lib\Release"
mkdir "_NRD_SDK\Shaders"
mkdir "_NRD_SDK\Shaders\Include"
cd "_NRD_SDK"
copy "..\%NRD_DIR%\Include\*" "Include"
copy "..\_Bin\Debug\NRD.dll" "Lib\Debug"
copy "..\_Bin\Debug\NRD.lib" "Lib\Debug"
copy "..\_Bin\Debug\NRD.pdb" "Lib\Debug"
copy "..\_Bin\Release\NRD.dll" "Lib\Release"
copy "..\_Bin\Release\NRD.lib" "Lib\Release"
copy "..\_Bin\Release\NRD.pdb" "Lib\Release"
copy "..\%NRD_DIR%\Shaders\Include\NRD.hlsli" "Shaders\Include"
copy "..\%NRD_DIR%\Shaders\Include\NRDEncoding.hlsli" "Shaders\Include"
copy "..\%NRD_DIR%\LICENSE.txt" "."
copy "..\%NRD_DIR%\README.md" "."
echo.
if defined copy_shaders goto :SHADERS
if defined no_copy_shaders goto :PRE_INTEGRATION
set /P M=Do you need the shader source code for a white-box integration? [y/n]
if /I "%M%" neq "y" goto :PRE_INTEGRATION
:SHADERS
mkdir "Shaders"
xcopy "..\%NRD_DIR%\Shaders\" "Shaders" /s /y
copy "..\%NRD_DIR%\External\MathLib\*.hlsli" "Shaders\Source"
:PRE_INTEGRATION
echo.
if defined copy_integration goto :INTEGRATION
if defined no_copy_integration goto :END
set /P M=Do you need NRD integration layer? [y/n]
if /I "%M%" neq "y" goto :END
:INTEGRATION
mkdir "Integration"
copy "..\%NRD_DIR%\Integration\*" "Integration"
cd ..
:END
cd ..
exit /b %errorlevel%
:HELP
echo. -h, --help show help message
echo. --shaders copy shaders for a white-box integration
echo. --no-shaders do not copy shaders for a white-box integration
echo. --integration copy NRD integration layer
echo. --no-integration do not copy NRD integration layer
exit