From 528661d2348fcb7fb444af58e70a18c13302ce2d Mon Sep 17 00:00:00 2001 From: kitsune Date: Sun, 21 Dec 2025 05:23:58 +0100 Subject: [PATCH] Update project files and devtools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Changes per file: • .gitignore - Added the following paths to ignore list to prevent committing build artifacts and IDE-specific files: - src/materialsystem/shaderlib/Debug/ - src/materialsystem/shaderlib/Release/ - src/materialsystem/stdshaders/.vs/ • src/devtools/bin/process_shaders.ps1 - Standardize parameters: add default values for threads and optimization. - Simplify file iteration using Get-Content; remove explicit file handle management. - Consolidate ShaderCompile argument construction for dynamic mode, threading, and optimization. - Early exit for unsupported versions to prevent unnecessary compilation calls. • src/materialsystem/shaderlib/shaderlib_sdk.vcxproj - Enable WholeProgramOptimization in Release configuration. - Enable MultiProcessorCompilation and OmitFramePointers in Release build. - Add explicit TargetName property for consistency in output naming. - Use $(TargetPath) instead of hardcoded paths. - Remove redundant /MP compiler option; rely on MultiProcessorCompilation property. - Set WindowsTargetPlatformVersion to 10.0 for modern SDK targeting. • src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj - Enable WholeProgramOptimization in Release configuration. - Enable MultiProcessorCompilation and OmitFramePointers in Release build. - Enable LinkTimeCodeGeneration in Link settings. - Add explicit TargetName property to standardize output naming. - Use $(TargetPath) instead of hardcoded path. - Move publishing logic from PostBuildEventUseInBuild into PostBuildEvent/PreLinkEvent. - Remove redundant /MP compiler option; rely on MultiProcessorCompilation. - Set WindowsTargetPlatformVersion to 10.0 for modern SDK targeting. • src/game/client/swarm_sdk_client.vcxproj - Disable Intel JCC Erratum workaround. - Add /IGNORE:4099 to linker AdditionalOptions to suppress irrelevant warnings. • src/game/missionchooser/swarm_sdk_missionchooser.vcxproj - Disable Intel JCC Erratum workaround. • src/game/server/swarm_sdk_server.vcxproj - Disable Intel JCC Erratum workaround. --- .gitignore | 3 + src/devtools/bin/process_shaders.ps1 | 35 ++++------- src/game/client/swarm_sdk_client.vcxproj | 4 +- .../swarm_sdk_missionchooser.vcxproj | 2 +- src/game/server/swarm_sdk_server.vcxproj | 2 +- .../shaderlib/shaderlib_sdk.vcxproj | 50 +++++++++++++-- .../stdshaders/stdshader_dx9_sdk.vcxproj | 62 ++++++++++++++----- 7 files changed, 112 insertions(+), 46 deletions(-) diff --git a/.gitignore b/.gitignore index 14303b2d4..c1dacdb72 100644 --- a/.gitignore +++ b/.gitignore @@ -47,6 +47,9 @@ src/game/missionchooser/Release/ src/game/server/Debug_swarm/ src/game/server/Release_swarm/ src/ipch +src/materialsystem/shaderlib/Debug/ +src/materialsystem/shaderlib/Release/ +src/materialsystem/stdshaders/.vs/ src/materialsystem/stdshaders/Debug_dx9/ src/materialsystem/stdshaders/Release_dx9/ src/materialsystem/stdshaders/shaders/ diff --git a/src/devtools/bin/process_shaders.ps1 b/src/devtools/bin/process_shaders.ps1 index fb136c878..470a3e44a 100644 --- a/src/devtools/bin/process_shaders.ps1 +++ b/src/devtools/bin/process_shaders.ps1 @@ -3,31 +3,22 @@ param ( [Parameter(Mandatory=$true, ValueFromPipeline=$true)][System.IO.FileInfo]$File, [Parameter(Mandatory=$true)][string]$Version, [Parameter(Mandatory=$false)][switch]$Dynamic, - [Parameter(Mandatory=$false)][System.UInt32]$Threads + [Parameter(Mandatory=$false)][int]$Threads = 0, + [Parameter(Mandatory=$false)][int]$Optimize = 3 ) -$Optimize = 3 +if ($Version -notin @("20b","30","40","41","50","51")) { return } -if ($Version -notin @("20b", "30", "40", "41", "50", "51")) { - return -} - -$fileList = $File.OpenText() -while ($null -ne ($line = $fileList.ReadLine())) { - if ($line -match '^\s*$' -or $line -match '^\s*//') { - continue - } - - if ($Dynamic) { - & "$PSScriptRoot\ShaderCompile" "-dynamic" "-ver" $Version "-shaderpath" $File.DirectoryName $line - continue - } +foreach ($line in Get-Content $File) { + if ($line -match '^\s*$' -or $line -match '^\s*//') { continue } - if ($Threads -ne 0) { - & "$PSScriptRoot\ShaderCompile" "-threads" $Threads "-ver" $Version "-shaderpath" $File.DirectoryName "-optimize" $Optimize $line - continue - } + $args = @() + if ($Dynamic) { $args += "-dynamic" } + if ($Threads -gt 0) { $args += "-threads"; $args += $Threads } + $args += "-ver"; $args += $Version + $args += "-shaderpath"; $args += $File.DirectoryName + if (-not $Dynamic) { $args += "-optimize"; $args += $Optimize } + $args += $line - & "$PSScriptRoot\ShaderCompile" "-ver" $Version "-shaderpath" $File.DirectoryName "-optimize" $Optimize $line + & "$PSScriptRoot\ShaderCompile" $args } -$fileList.Close() diff --git a/src/game/client/swarm_sdk_client.vcxproj b/src/game/client/swarm_sdk_client.vcxproj index 456227731..e54591b90 100644 --- a/src/game/client/swarm_sdk_client.vcxproj +++ b/src/game/client/swarm_sdk_client.vcxproj @@ -227,7 +227,7 @@ if ERRORLEVEL 1 exit 1 26495;26812 true true - true + false true @@ -253,7 +253,7 @@ if ERRORLEVEL 1 exit 1 MachineX86 PromptImmediately false - /Brepro /SOURCELINK:..\..\sourcelink.json %(AdditionalOptions) + /Brepro /SOURCELINK:..\..\sourcelink.json /IGNORE:4099 %(AdditionalOptions) UseLinkTimeCodeGeneration true true diff --git a/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj b/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj index 909e28e5e..7bd334182 100644 --- a/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj +++ b/src/game/missionchooser/swarm_sdk_missionchooser.vcxproj @@ -218,7 +218,7 @@ if ERRORLEVEL 1 exit 1 true true true - true + false NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) diff --git a/src/game/server/swarm_sdk_server.vcxproj b/src/game/server/swarm_sdk_server.vcxproj index bf1b77c22..ff7cf098e 100644 --- a/src/game/server/swarm_sdk_server.vcxproj +++ b/src/game/server/swarm_sdk_server.vcxproj @@ -223,7 +223,7 @@ if ERRORLEVEL 1 exit 1 true true true - true + false NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) diff --git a/src/materialsystem/shaderlib/shaderlib_sdk.vcxproj b/src/materialsystem/shaderlib/shaderlib_sdk.vcxproj index 67cf0da48..4a18d91ff 100644 --- a/src/materialsystem/shaderlib/shaderlib_sdk.vcxproj +++ b/src/materialsystem/shaderlib/shaderlib_sdk.vcxproj @@ -14,12 +14,14 @@ 17.0 shaderlib {1A1149D9-CB1B-BF85-19CA-C9C2996BFDE8} + 10.0 StaticLibrary v143 MultiByte + true StaticLibrary @@ -45,6 +47,7 @@ true true true + shaderlib .\Release\.\ @@ -52,6 +55,7 @@ true true true + shaderlib @@ -89,11 +93,11 @@ Prompt - if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib + if exist "$(TargetPath)" attrib -R "$(TargetPath)" false - ..\..\lib\public\.\shaderlib.lib + $(TargetPath) true @@ -103,13 +107,25 @@ true $(OutDir)shaderlib.bsc + + setlocal enabledelayedexpansion + +set DestDir=..\..\lib\public + +if not exist !DestDir! mkdir !DestDir! +if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName) +copy /Y $(TargetPath) !DestDir!\ + + + + Publishing to target directory (..\..\lib\public\)... + - /MP %(AdditionalOptions) MaxSpeed AnySuitable true @@ -140,13 +156,16 @@ OldStyle CompileAsCpp Prompt + true + true - if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib + if exist "$(TargetPath)" attrib -R "$(TargetPath)" + false - ..\..\lib\public\.\shaderlib.lib + $(TargetPath) true @@ -156,6 +175,27 @@ true $(OutDir)shaderlib.bsc + + + + + + + + + + setlocal enabledelayedexpansion + +set DestDir=..\..\lib\public + +if not exist !DestDir! mkdir !DestDir! +if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName) +copy /Y $(TargetPath) !DestDir!\ + + + + Publishing to target directory (..\..\lib\public\)... + diff --git a/src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj b/src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj index ab90f8401..f60fa0921 100644 --- a/src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj +++ b/src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj @@ -14,12 +14,14 @@ 17.0 stdshader_dx9 {C8D2DC83-E117-7576-7B43-10C844264C51} + 10.0 DynamicLibrary v143 MultiByte + true DynamicLibrary @@ -46,7 +48,8 @@ true true false - true + false + game_shader_dx9 Release_dx9\ @@ -55,17 +58,20 @@ true false false - true + false + game_shader_dx9 - Publishing to target directory (..\..\game\swarm\bin\)... - if exist "..\..\game\swarm\bin\game_shader_dx9.dll" attrib -r "..\..\game\swarm\bin\game_shader_dx9.dll" - - ..\..\game\swarm\bin\game_shader_dx9.dll;%(Outputs) + + + + + + /MP %(AdditionalOptions) @@ -101,7 +107,7 @@ version.lib;winmm.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)game_shader_dx9.dll + $(TargetPath) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -124,21 +130,33 @@ $(OutDir)stdshader_dx9.bsc - + setlocal enabledelayedexpansion + +set DestDir=..\..\game\swarm\bin + +if not exist !DestDir! mkdir !DestDir! +if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName) +copy /Y $(TargetPath) !DestDir!\ + + Publishing to target directory (..\..\game\swarm\bin)... + + if exist "$(TargetPath)" attrib -R "$(TargetPath)" + - Publishing to target directory (..\..\game\swarm\bin\)... - if exist "..\..\game\swarm\bin\game_shader_dx9.dll" attrib -r "..\..\game\swarm\bin\game_shader_dx9.dll" - - ..\..\game\swarm\bin\game_shader_dx9.dll;%(Outputs) + + + + + + - /MP %(AdditionalOptions) MaxSpeed AnySuitable true @@ -165,6 +183,8 @@ ProgramDatabase CompileAsCpp Prompt + true + true NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions) @@ -173,7 +193,7 @@ version.lib;winmm.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies) NotSet - $(OutDir)game_shader_dx9.dll + $(TargetPath) true ..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories) libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries) @@ -188,6 +208,7 @@ MachineX86 PromptImmediately + UseLinkTimeCodeGeneration true @@ -197,8 +218,19 @@ $(OutDir)stdshader_dx9.bsc - + setlocal enabledelayedexpansion + +set DestDir=..\..\game\swarm\bin + +if not exist !DestDir! mkdir !DestDir! +if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName) +copy /Y $(TargetPath) !DestDir!\ + + Publishing to target directory (..\..\game\swarm\bin)... + + if exist "$(TargetPath)" attrib -R "$(TargetPath)" +