summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat
diff options
context:
space:
mode:
Diffstat (limited to 'Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat')
-rw-r--r--Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat82
1 files changed, 82 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat b/Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat
new file mode 100644
index 0000000..055f100
--- /dev/null
+++ b/Runtime/GfxDevice/d3d11/InternalShaders/compile_all.bat
@@ -0,0 +1,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