-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCompileShaders.bat
26 lines (22 loc) · 1.41 KB
/
CompileShaders.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
@echo off
SETLOCAL enabledelayedexpansion
set sourcePath=application\sandbox\src\sandbox\resources\shaders\bgfx
set destinationPathOGL=application\sandbox\src\sandbox\resources\shaders\bgfx\ogl
set destinationPathDX11=application\sandbox\src\sandbox\resources\shaders\bgfx\dx11
set includePath=application\sandbox\src\sandbox\resources\shaders\bgfx\include
set oglProfile=420
set dx11Profile=s_5_0
for %%i in (%sourcePath%\*.sc) do (
echo %%~ni | find /i "FS">nul
if !errorlevel! equ 0 (
"resources\tools\shader compiler\shaderc.exe" -f %sourcePath%\%%~ni.sc --profile %oglProfile% --type fragment -o %destinationPathOGL%\%%~ni.shader --varyingdef %includePath%\varying.def.sc --v -i %includePath%
"resources\tools\shader compiler\shaderc.exe" -f %sourcePath%\%%~ni.sc --profile %dx11Profile% --type fragment -o %destinationPathDX11%\%%~ni.shader --varyingdef %includePath%\varying.def.sc --v -i %includePath%
)
echo %%~ni| find /i "VS">nul
if !errorlevel! equ 0 (
"resources\tools\shader compiler\shaderc.exe" -f %sourcePath%\%%~ni.sc --profile %oglProfile% --type vertex -o %destinationPathOGL%\%%~ni.shader --varyingdef %includePath%\varying.def.sc --v -i %includePath%
"resources\tools\shader compiler\shaderc.exe" -f %sourcePath%\%%~ni.sc --profile %dx11Profile% --type vertex -o %destinationPathDX11%\%%~ni.shader --varyingdef %includePath%\varying.def.sc --v -i %includePath%
)
)
ENDLOCAL
pause