summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat
blob: 055f1004ee5f88a9acb7b62bc092eb3fc12b2573 (plain)
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
@echo off
del FFShaderLib.h
call "CompileShaderLib\CompileShaderLib.exe" FFShaderLib.hlsl FFShaderLib.h

del builtin.h

echo // > builtin.h
echo // >> builtin.h
echo // Autogenerated file. Do not modify! >> builtin.h
echo // >> builtin.h
echo // >> builtin.h

echo const BYTE * g_StreamOutShaders[4][5][3] = {  >tmp.h
echo const size_t g_StreamOutShaderSizes[4][5][3] = {  >tmp2.h

call:compile StreamOutSkinVS_Position
call:compile StreamOutSkinVS_Position_Normal
call:compile StreamOutSkinVS_Position_Normal_Tangent
call:compile StreamOutSkinVS_Position_Tangent

echo }; >>tmp.h
echo }; >>tmp2.h

type tmp.h >>builtin.h
type tmp2.h >>builtin.h

del tmp.h
del tmp2.h

goto:eof

:compile

echo {  >>tmp.h
echo {  >>tmp2.h

call:compilecbvariants %~1 32 
call:compilecbvariants %~1 64 
call:compilecbvariants %~1 128 
call:compilecbvariants %~1 512
call:compilecbvariants %~1 1024 

echo }, >>tmp.h
echo }, >>tmp2.h


goto:eof

::- Compiles all variants for a given bone constant buffer size
::- Arguments: %~1 = entrypoint name, %~2 = max bone count
:compilecbvariants

echo {  >>tmp.h
echo {  >>tmp2.h

call:compilevariant %~1 1 %~2
call:compilevariant %~1 2 %~2
call:compilevariant %~1 4 %~2

echo },>>tmp.h
echo },>>tmp2.h


goto:eof

::- Compiles a single shader variant
::- Arguments: %~1 = entrypoint name %~2 = bones per vertex %~3 = max bone count
:compilevariant

call "%DXSDK_DIR%\Utilities\bin\x64\fxc.exe" /nologo /T vs_4_0 /Fh%~1_%~2_%~3._fxctmp /E%~1_%~2_%~3 /D BONESPERVERTEX=%~2 /D BONECOUNT=%~3 internalshaders.hlsl

echo //-------------------------------------------------------------- >> builtin.h
echo // %~1_%~2_%~3	>> builtin.h
echo //-------------------------------------------------------------- >> builtin.h

type %~1_%~2_%~3._fxctmp >> builtin.h
del %~1_%~2_%~3._fxctmp

echo g_%~1_%~2_%~3, >>tmp.h
echo sizeof(g_%~1_%~2_%~3), >> tmp2.h

goto:eof