Geoff Lang | d47e0fc | 2013-08-29 11:40:43 -0400 | [diff] [blame] | 1 | @ECHO OFF |
| 2 | REM |
| 3 | REM Copyright (c) 2013 The ANGLE Project Authors. All rights reserved. |
| 4 | REM Use of this source code is governed by a BSD-style license that can be |
| 5 | REM found in the LICENSE file. |
| 6 | REM |
| 7 | |
| 8 | PATH %PATH%;%ProgramFiles(x86)%\Windows Kits\8.0\bin\x86;%DXSDK_DIR%\Utilities\bin\x86 |
| 9 | |
| 10 | setlocal |
| 11 | set errorCount=0 |
| 12 | set successCount=0 |
| 13 | set debug=0 |
| 14 | |
| 15 | if "%1" == "debug" ( |
| 16 | set debug=1 |
| 17 | ) |
| 18 | if "%1" == "release" ( |
| 19 | set debug=0 |
| 20 | ) |
| 21 | |
| 22 | :: | Input file | Entry point | Type | Output file | Debug | |
| 23 | call:BuildShader Blit.vs standardvs vs_2_0 compiled\standardvs.h %debug% |
| 24 | call:BuildShader Blit.vs flipyvs vs_2_0 compiled\flipyvs.h %debug% |
| 25 | call:BuildShader Blit.ps passthroughps ps_2_0 compiled\passthroughps.h %debug% |
| 26 | call:BuildShader Blit.ps luminanceps ps_2_0 compiled\luminanceps.h %debug% |
| 27 | call:BuildShader Blit.ps componentmaskps ps_2_0 compiled\componentmaskps.h %debug% |
| 28 | |
| 29 | echo. |
| 30 | |
| 31 | if %successCount% GTR 0 ( |
| 32 | echo %successCount% shaders compiled successfully. |
| 33 | ) |
| 34 | if %errorCount% GTR 0 ( |
| 35 | echo There were %errorCount% shader compilation errors. |
| 36 | ) |
| 37 | |
| 38 | endlocal |
| 39 | exit /b |
| 40 | |
| 41 | :BuildShader |
| 42 | set input=%~1 |
| 43 | set entry=%~2 |
| 44 | set type=%~3 |
| 45 | set output=%~4 |
| 46 | set debug=%~5 |
| 47 | |
| 48 | if %debug% == 0 ( |
| 49 | set "buildCMD=fxc /nologo /E %entry% /T %type% /Fh %output% %input%" |
| 50 | ) else ( |
| 51 | set "buildCMD=fxc /nologo /Zi /Od /E %entry% /T %type% /Fh %output% %input%" |
| 52 | ) |
| 53 | |
| 54 | set error=0 |
| 55 | %buildCMD% || set error=1 |
| 56 | |
| 57 | if %error% == 0 ( |
| 58 | set /a successCount=%successCount%+1 |
| 59 | ) else ( |
| 60 | set /a errorCount=%errorCount%+1 |
| 61 | ) |
| 62 | |
| 63 | exit /b |