FPPS4/shaders/compile.cmd

33 lines
797 B
Batchfile
Raw Normal View History

2021-12-08 20:04:07 +00:00
2022-05-31 07:18:54 +00:00
@echo off
2022-12-01 10:41:48 +00:00
Rem The source of "glslangValidator" and "spirv-opt" is Vulkan SDK
Rem The source of "lazres" is Lazarus IDE
2022-10-12 12:41:51 +00:00
Set spirvgls=glslangValidator -g0 -V --target-env vulkan1.0
2021-12-08 20:04:07 +00:00
2022-10-12 12:41:51 +00:00
Set spirvopt=spirv-opt --eliminate-dead-branches --eliminate-local-multi-store --inline-entry-points-exhaustive --eliminate-dead-code-aggressive --scalar-replacement --simplify-instructions
2021-12-08 20:04:07 +00:00
2022-12-01 10:41:48 +00:00
Set lrs=shaders.lrs
echo [build comp]
For /F %%a in ('dir /B') do if "%%~xa"==".comp" (call :build %%a %%~na)
echo [build vert]
For /F %%a in ('dir /B') do if "%%~xa"==".vert" (call :build %%a %%~na)
echo [build lrs]
lazres %lrs%
2021-12-08 20:04:07 +00:00
2022-12-01 10:41:48 +00:00
echo [clean]
For /F %%a in ('dir /B') do if "%%~xa"==".spv" (call del /Q %%a)
2021-12-08 20:04:07 +00:00
pause
2022-05-31 07:18:54 +00:00
exit
2022-12-01 10:41:48 +00:00
:build
Set lrs=%lrs% %2.spv
2022-05-31 07:18:54 +00:00
%spirvgls% %1 -o %2.spv
%spirvopt% %2.spv -o %2.spv
exit /b