Update for recent tool improvements

This commit is contained in:
Chuck Walbourn
2024-09-16 14:07:57 -07:00
parent c615dee025
commit 390747e98f
12 changed files with 72 additions and 23 deletions

View File

@@ -9,6 +9,7 @@ if %PROCESSOR_ARCHITECTURE%.==ARM64. (set FXCARCH=arm64) else (if %PROCESSOR_ARC
set FXCOPTS=/nologo /WX /Ges /Zi /Zpc /Qstrip_reflect /Qstrip_debug
if defined LegacyShaderCompiler goto fxcviaenv
set PCFXC="%WindowsSdkVerBinPath%%FXCARCH%\fxc.exe"
if exist %PCFXC% goto continue
set PCFXC="%WindowsSdkBinPath%%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
@@ -17,6 +18,12 @@ set PCFXC="%WindowsSdkDir%bin\%WindowsSDKVersion%\%FXCARCH%\fxc.exe"
if exist %PCFXC% goto continue
set PCFXC=fxc.exe
goto continue
:fxcviaenv
set PCFXC="%LegacyShaderCompiler%"
if not exist %PCFXC% goto needfxc
goto continue
:continue
if not defined CompileShadersOutput set CompileShadersOutput=Compiled
@@ -42,8 +49,12 @@ endlocal
exit /b 0
:CompileShader
set fxc=%PCFXC% %1.fx %FXCOPTS% /T%2_4_0 /E%3 /Fh%CompileShadersOutput%\%1_%3.inc /Fd%CompileShadersOutput%\%1_%3.pdb /Vn%1_%3
set fxc=%PCFXC% "%1.hlsl" %FXCOPTS% /T%2_4_0 /E%3 "/Fh%CompileShadersOutput%\%1_%3.inc" "/Fd%CompileShadersOutput%\%1_%3.pdb" /Vn%1_%3
echo.
echo %fxc%
%fxc% || set error=1
exit /b
:needfxc
echo ERROR: CompileShaders requires FXC.EXE
exit /b 1