Skip to content

Commit 528661d

Browse files
committed
Update project files and devtools
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.
1 parent ce83282 commit 528661d

7 files changed

Lines changed: 112 additions & 46 deletions

File tree

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ src/game/missionchooser/Release/
4747
src/game/server/Debug_swarm/
4848
src/game/server/Release_swarm/
4949
src/ipch
50+
src/materialsystem/shaderlib/Debug/
51+
src/materialsystem/shaderlib/Release/
52+
src/materialsystem/stdshaders/.vs/
5053
src/materialsystem/stdshaders/Debug_dx9/
5154
src/materialsystem/stdshaders/Release_dx9/
5255
src/materialsystem/stdshaders/shaders/

src/devtools/bin/process_shaders.ps1

Lines changed: 13 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,22 @@ param (
33
[Parameter(Mandatory=$true, ValueFromPipeline=$true)][System.IO.FileInfo]$File,
44
[Parameter(Mandatory=$true)][string]$Version,
55
[Parameter(Mandatory=$false)][switch]$Dynamic,
6-
[Parameter(Mandatory=$false)][System.UInt32]$Threads
6+
[Parameter(Mandatory=$false)][int]$Threads = 0,
7+
[Parameter(Mandatory=$false)][int]$Optimize = 3
78
)
89

9-
$Optimize = 3
10+
if ($Version -notin @("20b","30","40","41","50","51")) { return }
1011

11-
if ($Version -notin @("20b", "30", "40", "41", "50", "51")) {
12-
return
13-
}
14-
15-
$fileList = $File.OpenText()
16-
while ($null -ne ($line = $fileList.ReadLine())) {
17-
if ($line -match '^\s*$' -or $line -match '^\s*//') {
18-
continue
19-
}
20-
21-
if ($Dynamic) {
22-
& "$PSScriptRoot\ShaderCompile" "-dynamic" "-ver" $Version "-shaderpath" $File.DirectoryName $line
23-
continue
24-
}
12+
foreach ($line in Get-Content $File) {
13+
if ($line -match '^\s*$' -or $line -match '^\s*//') { continue }
2514

26-
if ($Threads -ne 0) {
27-
& "$PSScriptRoot\ShaderCompile" "-threads" $Threads "-ver" $Version "-shaderpath" $File.DirectoryName "-optimize" $Optimize $line
28-
continue
29-
}
15+
$args = @()
16+
if ($Dynamic) { $args += "-dynamic" }
17+
if ($Threads -gt 0) { $args += "-threads"; $args += $Threads }
18+
$args += "-ver"; $args += $Version
19+
$args += "-shaderpath"; $args += $File.DirectoryName
20+
if (-not $Dynamic) { $args += "-optimize"; $args += $Optimize }
21+
$args += $line
3022

31-
& "$PSScriptRoot\ShaderCompile" "-ver" $Version "-shaderpath" $File.DirectoryName "-optimize" $Optimize $line
23+
& "$PSScriptRoot\ShaderCompile" $args
3224
}
33-
$fileList.Close()

src/game/client/swarm_sdk_client.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ if ERRORLEVEL 1 exit 1
227227
<DisableSpecificWarnings>26495;26812</DisableSpecificWarnings>
228228
<WholeProgramOptimization>true</WholeProgramOptimization>
229229
<OmitFramePointers>true</OmitFramePointers>
230-
<IntelJCCErratum>true</IntelJCCErratum>
230+
<IntelJCCErratum>false</IntelJCCErratum>
231231
<MultiProcessorCompilation>true</MultiProcessorCompilation>
232232
</ClCompile>
233233
<ResourceCompile>
@@ -253,7 +253,7 @@ if ERRORLEVEL 1 exit 1
253253
<TargetMachine>MachineX86</TargetMachine>
254254
<LinkErrorReporting>PromptImmediately</LinkErrorReporting>
255255
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
256-
<AdditionalOptions>/Brepro /SOURCELINK:..\..\sourcelink.json %(AdditionalOptions)</AdditionalOptions>
256+
<AdditionalOptions>/Brepro /SOURCELINK:..\..\sourcelink.json /IGNORE:4099 %(AdditionalOptions)</AdditionalOptions>
257257
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
258258
<LargeAddressAware>true</LargeAddressAware>
259259
<SetChecksum>true</SetChecksum>

src/game/missionchooser/swarm_sdk_missionchooser.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ if ERRORLEVEL 1 exit 1
218218
<WholeProgramOptimization>true</WholeProgramOptimization>
219219
<MultiProcessorCompilation>true</MultiProcessorCompilation>
220220
<OmitFramePointers>true</OmitFramePointers>
221-
<IntelJCCErratum>true</IntelJCCErratum>
221+
<IntelJCCErratum>false</IntelJCCErratum>
222222
</ClCompile>
223223
<ResourceCompile>
224224
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

src/game/server/swarm_sdk_server.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ if ERRORLEVEL 1 exit 1
223223
<WholeProgramOptimization>true</WholeProgramOptimization>
224224
<MultiProcessorCompilation>true</MultiProcessorCompilation>
225225
<OmitFramePointers>true</OmitFramePointers>
226-
<IntelJCCErratum>true</IntelJCCErratum>
226+
<IntelJCCErratum>false</IntelJCCErratum>
227227
</ClCompile>
228228
<ResourceCompile>
229229
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>

src/materialsystem/shaderlib/shaderlib_sdk.vcxproj

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
<VCProjectVersion>17.0</VCProjectVersion>
1515
<ProjectName>shaderlib</ProjectName>
1616
<ProjectGuid>{1A1149D9-CB1B-BF85-19CA-C9C2996BFDE8}</ProjectGuid>
17+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1718
</PropertyGroup>
1819
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1920
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2021
<ConfigurationType>StaticLibrary</ConfigurationType>
2122
<PlatformToolset>v143</PlatformToolset>
2223
<CharacterSet>MultiByte</CharacterSet>
24+
<WholeProgramOptimization>true</WholeProgramOptimization>
2325
</PropertyGroup>
2426
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2527
<ConfigurationType>StaticLibrary</ConfigurationType>
@@ -45,13 +47,15 @@
4547
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
4648
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
4749
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
50+
<TargetName>shaderlib</TargetName>
4851
</PropertyGroup>
4952
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
5053
<OutDir>.\Release\.\</OutDir>
5154
<IntDir>.\Release\.\</IntDir>
5255
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
5356
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
5457
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
58+
<TargetName>shaderlib</TargetName>
5559
</PropertyGroup>
5660
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
5761
<PreBuildEvent>
@@ -89,11 +93,11 @@
8993
<ErrorReporting>Prompt</ErrorReporting>
9094
</ClCompile>
9195
<PreLinkEvent>
92-
<Command>if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib</Command>
96+
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"</Command>
9397
</PreLinkEvent>
9498
<Lib>
9599
<UseUnicodeResponseFiles>false</UseUnicodeResponseFiles>
96-
<OutputFile>..\..\lib\public\.\shaderlib.lib</OutputFile>
100+
<OutputFile>$(TargetPath)</OutputFile>
97101
<SuppressStartupBanner>true</SuppressStartupBanner>
98102
</Lib>
99103
<Xdcmake>
@@ -103,13 +107,25 @@
103107
<SuppressStartupBanner>true</SuppressStartupBanner>
104108
<OutputFile>$(OutDir)shaderlib.bsc</OutputFile>
105109
</Bscmake>
110+
<PostBuildEvent>
111+
<Command>setlocal enabledelayedexpansion
112+
113+
set DestDir=..\..\lib\public
114+
115+
if not exist !DestDir! mkdir !DestDir!
116+
if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName)
117+
copy /Y $(TargetPath) !DestDir!\
118+
119+
120+
</Command>
121+
<Message>Publishing to target directory (..\..\lib\public\)...</Message>
122+
</PostBuildEvent>
106123
</ItemDefinitionGroup>
107124
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
108125
<PreBuildEvent>
109126
<Command />
110127
</PreBuildEvent>
111128
<ClCompile>
112-
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
113129
<Optimization>MaxSpeed</Optimization>
114130
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
115131
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -140,13 +156,16 @@
140156
<DebugInformationFormat>OldStyle</DebugInformationFormat>
141157
<CompileAs>CompileAsCpp</CompileAs>
142158
<ErrorReporting>Prompt</ErrorReporting>
159+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
160+
<OmitFramePointers>true</OmitFramePointers>
143161
</ClCompile>
144162
<PreLinkEvent>
145-
<Command>if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib</Command>
163+
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"
164+
</Command>
146165
</PreLinkEvent>
147166
<Lib>
148167
<UseUnicodeResponseFiles>false</UseUnicodeResponseFiles>
149-
<OutputFile>..\..\lib\public\.\shaderlib.lib</OutputFile>
168+
<OutputFile>$(TargetPath)</OutputFile>
150169
<SuppressStartupBanner>true</SuppressStartupBanner>
151170
</Lib>
152171
<Xdcmake>
@@ -156,6 +175,27 @@
156175
<SuppressStartupBanner>true</SuppressStartupBanner>
157176
<OutputFile>$(OutDir)shaderlib.bsc</OutputFile>
158177
</Bscmake>
178+
<CustomBuildStep>
179+
<Outputs>
180+
</Outputs>
181+
<Message>
182+
</Message>
183+
<Command>
184+
</Command>
185+
</CustomBuildStep>
186+
<PostBuildEvent>
187+
<Command>setlocal enabledelayedexpansion
188+
189+
set DestDir=..\..\lib\public
190+
191+
if not exist !DestDir! mkdir !DestDir!
192+
if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName)
193+
copy /Y $(TargetPath) !DestDir!\
194+
195+
196+
</Command>
197+
<Message>Publishing to target directory (..\..\lib\public\)...</Message>
198+
</PostBuildEvent>
159199
</ItemDefinitionGroup>
160200
<ItemGroup>
161201
<None Include="..\..\vpc_scripts\source_lib_base.vpc" />

src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj

Lines changed: 47 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,14 @@
1414
<VCProjectVersion>17.0</VCProjectVersion>
1515
<ProjectName>stdshader_dx9</ProjectName>
1616
<ProjectGuid>{C8D2DC83-E117-7576-7B43-10C844264C51}</ProjectGuid>
17+
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
1718
</PropertyGroup>
1819
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
1920
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
2021
<ConfigurationType>DynamicLibrary</ConfigurationType>
2122
<PlatformToolset>v143</PlatformToolset>
2223
<CharacterSet>MultiByte</CharacterSet>
24+
<WholeProgramOptimization>true</WholeProgramOptimization>
2325
</PropertyGroup>
2426
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
2527
<ConfigurationType>DynamicLibrary</ConfigurationType>
@@ -46,7 +48,8 @@
4648
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
4749
<LinkIncremental>true</LinkIncremental>
4850
<GenerateManifest>false</GenerateManifest>
49-
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
51+
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
52+
<TargetName>game_shader_dx9</TargetName>
5053
</PropertyGroup>
5154
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
5255
<OutDir>Release_dx9\</OutDir>
@@ -55,17 +58,20 @@
5558
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
5659
<LinkIncremental>false</LinkIncremental>
5760
<GenerateManifest>false</GenerateManifest>
58-
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
61+
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
62+
<TargetName>game_shader_dx9</TargetName>
5963
</PropertyGroup>
6064
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
6165
<PreBuildEvent>
6266
<Command />
6367
</PreBuildEvent>
6468
<CustomBuildStep>
65-
<Message>Publishing to target directory (..\..\game\swarm\bin\)...</Message>
66-
<Command>if exist "..\..\game\swarm\bin\game_shader_dx9.dll" attrib -r "..\..\game\swarm\bin\game_shader_dx9.dll"
67-
</Command>
68-
<Outputs>..\..\game\swarm\bin\game_shader_dx9.dll;%(Outputs)</Outputs>
69+
<Message>
70+
</Message>
71+
<Command>
72+
</Command>
73+
<Outputs>
74+
</Outputs>
6975
</CustomBuildStep>
7076
<ClCompile>
7177
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
@@ -101,7 +107,7 @@
101107
<Link>
102108
<AdditionalDependencies>version.lib;winmm.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
103109
<ShowProgress>NotSet</ShowProgress>
104-
<OutputFile>$(OutDir)game_shader_dx9.dll</OutputFile>
110+
<OutputFile>$(TargetPath)</OutputFile>
105111
<SuppressStartupBanner>true</SuppressStartupBanner>
106112
<AdditionalLibraryDirectories>..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
107113
<IgnoreSpecificDefaultLibraries>libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -124,21 +130,33 @@
124130
<OutputFile>$(OutDir)stdshader_dx9.bsc</OutputFile>
125131
</Bscmake>
126132
<PostBuildEvent>
127-
<Command />
133+
<Command>setlocal enabledelayedexpansion
134+
135+
set DestDir=..\..\game\swarm\bin
136+
137+
if not exist !DestDir! mkdir !DestDir!
138+
if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName)
139+
copy /Y $(TargetPath) !DestDir!\
140+
</Command>
141+
<Message>Publishing to target directory (..\..\game\swarm\bin)...</Message>
128142
</PostBuildEvent>
143+
<PreLinkEvent>
144+
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"</Command>
145+
</PreLinkEvent>
129146
</ItemDefinitionGroup>
130147
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
131148
<PreBuildEvent>
132149
<Command />
133150
</PreBuildEvent>
134151
<CustomBuildStep>
135-
<Message>Publishing to target directory (..\..\game\swarm\bin\)...</Message>
136-
<Command>if exist "..\..\game\swarm\bin\game_shader_dx9.dll" attrib -r "..\..\game\swarm\bin\game_shader_dx9.dll"
137-
</Command>
138-
<Outputs>..\..\game\swarm\bin\game_shader_dx9.dll;%(Outputs)</Outputs>
152+
<Message>
153+
</Message>
154+
<Command>
155+
</Command>
156+
<Outputs>
157+
</Outputs>
139158
</CustomBuildStep>
140159
<ClCompile>
141-
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
142160
<Optimization>MaxSpeed</Optimization>
143161
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
144162
<IntrinsicFunctions>true</IntrinsicFunctions>
@@ -165,6 +183,8 @@
165183
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
166184
<CompileAs>CompileAsCpp</CompileAs>
167185
<ErrorReporting>Prompt</ErrorReporting>
186+
<OmitFramePointers>true</OmitFramePointers>
187+
<MultiProcessorCompilation>true</MultiProcessorCompilation>
168188
</ClCompile>
169189
<ResourceCompile>
170190
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
@@ -173,7 +193,7 @@
173193
<Link>
174194
<AdditionalDependencies>version.lib;winmm.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
175195
<ShowProgress>NotSet</ShowProgress>
176-
<OutputFile>$(OutDir)game_shader_dx9.dll</OutputFile>
196+
<OutputFile>$(TargetPath)</OutputFile>
177197
<SuppressStartupBanner>true</SuppressStartupBanner>
178198
<AdditionalLibraryDirectories>..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
179199
<IgnoreSpecificDefaultLibraries>libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -188,6 +208,7 @@
188208
</BaseAddress>
189209
<TargetMachine>MachineX86</TargetMachine>
190210
<LinkErrorReporting>PromptImmediately</LinkErrorReporting>
211+
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
191212
</Link>
192213
<Xdcmake>
193214
<SuppressStartupBanner>true</SuppressStartupBanner>
@@ -197,8 +218,19 @@
197218
<OutputFile>$(OutDir)stdshader_dx9.bsc</OutputFile>
198219
</Bscmake>
199220
<PostBuildEvent>
200-
<Command />
221+
<Command>setlocal enabledelayedexpansion
222+
223+
set DestDir=..\..\game\swarm\bin
224+
225+
if not exist !DestDir! mkdir !DestDir!
226+
if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName)
227+
copy /Y $(TargetPath) !DestDir!\
228+
</Command>
229+
<Message>Publishing to target directory (..\..\game\swarm\bin)...</Message>
201230
</PostBuildEvent>
231+
<PreLinkEvent>
232+
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"</Command>
233+
</PreLinkEvent>
202234
</ItemDefinitionGroup>
203235
<ItemGroup>
204236
<None Include="..\..\vpc_scripts\loadaddress.vpc" />

0 commit comments

Comments
 (0)