Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
35 changes: 13 additions & 22 deletions src/devtools/bin/process_shaders.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -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()
4 changes: 2 additions & 2 deletions src/game/client/swarm_sdk_client.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ if ERRORLEVEL 1 exit 1
<DisableSpecificWarnings>26495;26812</DisableSpecificWarnings>
<WholeProgramOptimization>true</WholeProgramOptimization>
<OmitFramePointers>true</OmitFramePointers>
<IntelJCCErratum>true</IntelJCCErratum>
<IntelJCCErratum>false</IntelJCCErratum>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
Expand All @@ -253,7 +253,7 @@ if ERRORLEVEL 1 exit 1
<TargetMachine>MachineX86</TargetMachine>
<LinkErrorReporting>PromptImmediately</LinkErrorReporting>
<ImageHasSafeExceptionHandlers>false</ImageHasSafeExceptionHandlers>
<AdditionalOptions>/Brepro /SOURCELINK:..\..\sourcelink.json %(AdditionalOptions)</AdditionalOptions>
<AdditionalOptions>/Brepro /SOURCELINK:..\..\sourcelink.json /IGNORE:4099 %(AdditionalOptions)</AdditionalOptions>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
<LargeAddressAware>true</LargeAddressAware>
<SetChecksum>true</SetChecksum>
Expand Down
2 changes: 1 addition & 1 deletion src/game/missionchooser/swarm_sdk_missionchooser.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ if ERRORLEVEL 1 exit 1
<WholeProgramOptimization>true</WholeProgramOptimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OmitFramePointers>true</OmitFramePointers>
<IntelJCCErratum>true</IntelJCCErratum>
<IntelJCCErratum>false</IntelJCCErratum>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion src/game/server/swarm_sdk_server.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ if ERRORLEVEL 1 exit 1
<WholeProgramOptimization>true</WholeProgramOptimization>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OmitFramePointers>true</OmitFramePointers>
<IntelJCCErratum>true</IntelJCCErratum>
<IntelJCCErratum>false</IntelJCCErratum>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
50 changes: 45 additions & 5 deletions src/materialsystem/shaderlib/shaderlib_sdk.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectName>shaderlib</ProjectName>
<ProjectGuid>{1A1149D9-CB1B-BF85-19CA-C9C2996BFDE8}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
Expand All @@ -45,13 +47,15 @@
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<TargetName>shaderlib</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>.\Release\.\</OutDir>
<IntDir>.\Release\.\</IntDir>
<PreBuildEventUseInBuild>true</PreBuildEventUseInBuild>
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<TargetName>shaderlib</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
Expand Down Expand Up @@ -89,11 +93,11 @@
<ErrorReporting>Prompt</ErrorReporting>
</ClCompile>
<PreLinkEvent>
<Command>if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib</Command>
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"</Command>
</PreLinkEvent>
<Lib>
<UseUnicodeResponseFiles>false</UseUnicodeResponseFiles>
<OutputFile>..\..\lib\public\.\shaderlib.lib</OutputFile>
<OutputFile>$(TargetPath)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
<Xdcmake>
Expand All @@ -103,13 +107,25 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(OutDir)shaderlib.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command>setlocal enabledelayedexpansion

set DestDir=..\..\lib\public

if not exist !DestDir! mkdir !DestDir!
if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName)
copy /Y $(TargetPath) !DestDir!\


</Command>
<Message>Publishing to target directory (..\..\lib\public\)...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<ClCompile>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
Expand Down Expand Up @@ -140,13 +156,16 @@
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<ErrorReporting>Prompt</ErrorReporting>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<OmitFramePointers>true</OmitFramePointers>
</ClCompile>
<PreLinkEvent>
<Command>if exist ..\..\lib\public\shaderlib.lib attrib -r ..\..\lib\public\shaderlib.lib</Command>
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"
</Command>
</PreLinkEvent>
<Lib>
<UseUnicodeResponseFiles>false</UseUnicodeResponseFiles>
<OutputFile>..\..\lib\public\.\shaderlib.lib</OutputFile>
<OutputFile>$(TargetPath)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
</Lib>
<Xdcmake>
Expand All @@ -156,6 +175,27 @@
<SuppressStartupBanner>true</SuppressStartupBanner>
<OutputFile>$(OutDir)shaderlib.bsc</OutputFile>
</Bscmake>
<CustomBuildStep>
<Outputs>
</Outputs>
<Message>
</Message>
<Command>
</Command>
</CustomBuildStep>
<PostBuildEvent>
<Command>setlocal enabledelayedexpansion

set DestDir=..\..\lib\public

if not exist !DestDir! mkdir !DestDir!
if exist !DestDir!\$(TargetFileName) attrib -R !DestDir!\$(TargetFileName)
copy /Y $(TargetPath) !DestDir!\


</Command>
<Message>Publishing to target directory (..\..\lib\public\)...</Message>
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="..\..\vpc_scripts\source_lib_base.vpc" />
Expand Down
62 changes: 47 additions & 15 deletions src/materialsystem/stdshaders/stdshader_dx9_sdk.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@
<VCProjectVersion>17.0</VCProjectVersion>
<ProjectName>stdshader_dx9</ProjectName>
<ProjectGuid>{C8D2DC83-E117-7576-7B43-10C844264C51}</ProjectGuid>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v143</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand All @@ -46,7 +48,8 @@
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
<LinkIncremental>true</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
<TargetName>game_shader_dx9</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<OutDir>Release_dx9\</OutDir>
Expand All @@ -55,17 +58,20 @@
<PreLinkEventUseInBuild>true</PreLinkEventUseInBuild>
<LinkIncremental>false</LinkIncremental>
<GenerateManifest>false</GenerateManifest>
<PostBuildEventUseInBuild>true</PostBuildEventUseInBuild>
<PostBuildEventUseInBuild>false</PostBuildEventUseInBuild>
<TargetName>game_shader_dx9</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Message>Publishing to target directory (..\..\game\swarm\bin\)...</Message>
<Command>if exist "..\..\game\swarm\bin\game_shader_dx9.dll" attrib -r "..\..\game\swarm\bin\game_shader_dx9.dll"
</Command>
<Outputs>..\..\game\swarm\bin\game_shader_dx9.dll;%(Outputs)</Outputs>
<Message>
</Message>
<Command>
</Command>
<Outputs>
</Outputs>
</CustomBuildStep>
<ClCompile>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
Expand Down Expand Up @@ -101,7 +107,7 @@
<Link>
<AdditionalDependencies>version.lib;winmm.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<OutputFile>$(OutDir)game_shader_dx9.dll</OutputFile>
<OutputFile>$(TargetPath)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
Expand All @@ -124,21 +130,33 @@
<OutputFile>$(OutDir)stdshader_dx9.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command />
<Command>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!\
</Command>
<Message>Publishing to target directory (..\..\game\swarm\bin)...</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"</Command>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<PreBuildEvent>
<Command />
</PreBuildEvent>
<CustomBuildStep>
<Message>Publishing to target directory (..\..\game\swarm\bin\)...</Message>
<Command>if exist "..\..\game\swarm\bin\game_shader_dx9.dll" attrib -r "..\..\game\swarm\bin\game_shader_dx9.dll"
</Command>
<Outputs>..\..\game\swarm\bin\game_shader_dx9.dll;%(Outputs)</Outputs>
<Message>
</Message>
<Command>
</Command>
<Outputs>
</Outputs>
</CustomBuildStep>
<ClCompile>
<AdditionalOptions>/MP %(AdditionalOptions)</AdditionalOptions>
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>AnySuitable</InlineFunctionExpansion>
<IntrinsicFunctions>true</IntrinsicFunctions>
Expand All @@ -165,6 +183,8 @@
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<CompileAs>CompileAsCpp</CompileAs>
<ErrorReporting>Prompt</ErrorReporting>
<OmitFramePointers>true</OmitFramePointers>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<ResourceCompile>
<PreprocessorDefinitions>NDEBUG;_CRT_SECURE_NO_DEPRECATE;_CRT_NONSTDC_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -173,7 +193,7 @@
<Link>
<AdditionalDependencies>version.lib;winmm.lib;legacy_stdio_definitions.lib;%(AdditionalDependencies)</AdditionalDependencies>
<ShowProgress>NotSet</ShowProgress>
<OutputFile>$(OutDir)game_shader_dx9.dll</OutputFile>
<OutputFile>$(TargetPath)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\lib\common\.;..\..\lib\public\.;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc;libcd;libcmtd;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
Expand All @@ -188,6 +208,7 @@
</BaseAddress>
<TargetMachine>MachineX86</TargetMachine>
<LinkErrorReporting>PromptImmediately</LinkErrorReporting>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
<Xdcmake>
<SuppressStartupBanner>true</SuppressStartupBanner>
Expand All @@ -197,8 +218,19 @@
<OutputFile>$(OutDir)stdshader_dx9.bsc</OutputFile>
</Bscmake>
<PostBuildEvent>
<Command />
<Command>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!\
</Command>
<Message>Publishing to target directory (..\..\game\swarm\bin)...</Message>
</PostBuildEvent>
<PreLinkEvent>
<Command>if exist "$(TargetPath)" attrib -R "$(TargetPath)"</Command>
</PreLinkEvent>
</ItemDefinitionGroup>
<ItemGroup>
<None Include="..\..\vpc_scripts\loadaddress.vpc" />
Expand Down