diff options
| author | lbavoil <[email protected]> | 2016-03-25 13:01:54 +0100 |
|---|---|---|
| committer | lbavoil <[email protected]> | 2016-03-25 13:01:54 +0100 |
| commit | 99174e4e5fb4b7079da80b35a6dfd68f3fd56a1c (patch) | |
| tree | fbcd4260d6c953d569a887505336a1c3f202e10f /build/tools/ShaderBuildTool | |
| download | hbaoplus-99174e4e5fb4b7079da80b35a6dfd68f3fd56a1c.tar.xz hbaoplus-99174e4e5fb4b7079da80b35a6dfd68f3fd56a1c.zip | |
GFSDK_HBAO+_distro_r3.0_cl20573789
Diffstat (limited to 'build/tools/ShaderBuildTool')
| -rw-r--r-- | build/tools/ShaderBuildTool/ShaderBuildTool.cpp | 388 | ||||
| -rw-r--r-- | build/tools/ShaderBuildTool/ShaderBuildTool.sln | 28 | ||||
| -rw-r--r-- | build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj | 168 | ||||
| -rw-r--r-- | build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj.filters | 33 | ||||
| -rw-r--r-- | build/tools/ShaderBuildTool/stdafx.cpp | 8 | ||||
| -rw-r--r-- | build/tools/ShaderBuildTool/stdafx.h | 19 | ||||
| -rw-r--r-- | build/tools/ShaderBuildTool/targetver.h | 8 |
7 files changed, 652 insertions, 0 deletions
diff --git a/build/tools/ShaderBuildTool/ShaderBuildTool.cpp b/build/tools/ShaderBuildTool/ShaderBuildTool.cpp new file mode 100644 index 0000000..f30f9f9 --- /dev/null +++ b/build/tools/ShaderBuildTool/ShaderBuildTool.cpp @@ -0,0 +1,388 @@ +// ShaderBuildTool.cpp : Defines the entry point for the console application. +// + +#include "stdafx.h" +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <vector> +#include <string> +#include <sstream> + +#define PERMUTATION_KEYWORD "#permutation " +#define SEPARATORS " \n" +#define INDENT " " + +namespace +{ + struct CShaderPermutation + { + std::string Key; + std::vector<std::string> Values; + }; + + struct CShaderDefine + { + std::string Key; + std::string Value; + }; + + struct CShaderInstance + { + std::string GlobalVariableName; + std::vector<CShaderDefine> Defines; + }; + + typedef std::vector<CShaderInstance> CShaderInstances; + typedef std::vector<CShaderPermutation> CShaderPermutations; +}; + +FILE *OpenFile(std::string Path, const char* Mode) +{ + FILE *fp = NULL; + if (fopen_s(&fp, Path.c_str(), Mode) || !fp) + { + fprintf(stderr, "Failed to open file %s\n", Path.c_str()); + exit(1); + } + return fp; +} + +CShaderInstances ExpandShaderInstances(CShaderInstances In, CShaderPermutation Permutation) +{ + CShaderInstances Out; + for (unsigned int InstanceIndex = 0; InstanceIndex < In.size(); ++InstanceIndex) + { + for (unsigned int ValueIndex = 0; ValueIndex < Permutation.Values.size(); ++ValueIndex) + { + CShaderDefine D; + D.Key = Permutation.Key; + D.Value = Permutation.Values[ValueIndex]; + + CShaderInstance Tmp = In[InstanceIndex]; + Tmp.Defines.push_back(D); + Out.push_back(Tmp); + } + } + + return Out; +} + +void MySystem(const char *Command) +{ + //printf("%s\n", Command); + + if (system(Command) != 0) + { + fprintf(stderr, "Failed command: %s\n", Command); + exit(1); + } +} + +struct CArgs +{ + std::string Profile; + std::string Input; + std::string EntryPoint; + std::string OutputDir; + std::string Output_H; + std::string Output_CPP; + std::string CompileTool; + std::string API; + std::string ClassName; +}; + +void ParseInput( + const CArgs& Args, + CShaderPermutations& ShaderPermutations) +{ + FILE *fp = OpenFile(Args.Input, "r"); + + char row[1024]; + while (fgets(row, sizeof(row), fp)) + { + if (strncmp(row, PERMUTATION_KEYWORD, strlen(PERMUTATION_KEYWORD)) == 0) + { + char *Keyword = strtok(row, SEPARATORS); + char *DefineKey = strtok(NULL, SEPARATORS); + if (!DefineKey) break; + + CShaderPermutation P; + P.Key = DefineKey; + + while (1) + { + char *DefineValue = strtok(NULL, SEPARATORS); + if (!DefineValue) break; + + P.Values.push_back(DefineValue); + } + + ShaderPermutations.push_back(P); + } + } + + fclose(fp); +} + +void InitShaderInstances( + const CShaderPermutations& ShaderPermutations, + CShaderInstances& ShaderInstances + ) +{ + ShaderInstances.clear(); + ShaderInstances.push_back(CShaderInstance()); + + for (unsigned int PermutationIndex = 0; PermutationIndex < ShaderPermutations.size(); ++PermutationIndex) + { + CShaderPermutation P = ShaderPermutations[PermutationIndex]; + ShaderInstances = ExpandShaderInstances(ShaderInstances, P); + } +} + +void WriteCPP( + const CArgs& Args, + const CShaderPermutations& ShaderPermutations, + CShaderInstances& ShaderInstances) +{ + remove(Args.Output_CPP.c_str()); + + for (unsigned int InstanceIndex = 0; InstanceIndex < ShaderInstances.size(); ++InstanceIndex) + { + CShaderInstance& Instance = ShaderInstances[InstanceIndex]; + std::string DefineString = "/DAPI_" + Args.API + "=1"; + std::string ShaderName = Args.EntryPoint; + + for (unsigned int i = 0; i < ShaderInstances[i].Defines.size(); ++i) + { + DefineString += " /D" + Instance.Defines[i].Key + "=" + Instance.Defines[i].Value; + ShaderName += "_" + Instance.Defines[i].Key + "_" + Instance.Defines[i].Value; + } + + Instance.GlobalVariableName = "g_" + ShaderName + "_" + Args.API; + + std::string OutputTmp = Args.Output_CPP + ".tmp"; + std::string Command; + Command += "SET SBT_PROFILE=" + Args.Profile; + Command += "& SET SBT_INPUT=" + Args.Input; + Command += "& SET SBT_ENTRY_POINT=" + Args.EntryPoint; + Command += "& SET SBT_DEFINES=" + DefineString; + Command += "& SET SBT_VARIABLE_NAME=" + Instance.GlobalVariableName; + Command += "& SET SBT_OUTPUT=" + OutputTmp; + Command += "& " + Args.CompileTool; + MySystem(Command.c_str()); + + Command = "type " + OutputTmp + " >> " + Args.Output_CPP; + MySystem(Command.c_str()); + + Command = "del " + OutputTmp; + MySystem(Command.c_str()); + } + + FILE *fp = OpenFile(Args.Output_CPP, "a+"); + + fprintf(fp, "\n"); + fprintf(fp, "namespace Generated\n"); + fprintf(fp, "{\n"); + + fprintf(fp, INDENT "void %s::Create(DevicePointer Device)\n", Args.EntryPoint.c_str()); + fprintf(fp, INDENT "{\n"); + for (unsigned int i = 0; i < ShaderInstances.size(); ++i) + { + CShaderInstance Instance = ShaderInstances[i]; + + fprintf(fp, INDENT INDENT "m_Shader"); + for (unsigned int j = 0; j < Instance.Defines.size(); ++j) + { + fprintf(fp, "[ShaderPermutations::%s", Instance.Defines[j].Key.c_str()); + fprintf(fp, "_%s]", Instance.Defines[j].Value.c_str()); + } + fprintf(fp, ".Create(Device, %s, sizeof(%s));\n", Instance.GlobalVariableName.c_str(), Instance.GlobalVariableName.c_str()); + } + fprintf(fp, INDENT "}\n"); + fprintf(fp, "\n"); + + fprintf(fp, INDENT "void %s::Release(DevicePointer Device)\n", Args.EntryPoint.c_str()); + fprintf(fp, INDENT "{\n"); + for (unsigned int i = 0; i < ShaderInstances.size(); ++i) + { + fprintf(fp, INDENT INDENT "m_Shader"); + CShaderInstance Instance = ShaderInstances[i]; + for (unsigned int j = 0; j < Instance.Defines.size(); ++j) + { + fprintf(fp, "[ShaderPermutations::%s", Instance.Defines[j].Key.c_str()); + fprintf(fp, "_%s]", Instance.Defines[j].Value.c_str()); + } + fprintf(fp, ".Release(Device);\n"); + } + fprintf(fp, INDENT "}\n"); + + fprintf(fp, "}\n"); + + fclose(fp); +} + +void WriteHeader( + const CArgs& Args, + const CShaderPermutations& ShaderPermutations, + const CShaderInstances& ShaderInstances) +{ + remove(Args.Output_H.c_str()); + + std::string ClassName = Args.ClassName; + + FILE *fp = OpenFile(Args.Output_H, "a+"); + + fprintf(fp, "//! This file was auto-generated. Do not modify manually.\n"); + fprintf(fp, "#pragma once"); + fprintf(fp, "\n"); + + fprintf(fp, "\n"); + fprintf(fp, "namespace Generated\n"); + fprintf(fp, "{\n"); + fprintf(fp, "\n"); + + fprintf(fp, "namespace ShaderPermutations\n"); + fprintf(fp, "{\n"); + fprintf(fp, "\n"); + + for (unsigned int i = 0; i < ShaderPermutations.size(); ++i) + { + const CShaderPermutation& Permutation = ShaderPermutations[i]; + + std::string PermutationDefine = Permutation.Key + "_DEFINED"; + fprintf(fp, "#ifndef %s\n", PermutationDefine.c_str()); + fprintf(fp, "#define %s\n", PermutationDefine.c_str()); + + fprintf(fp, INDENT "enum %s\n", Permutation.Key.c_str()); + fprintf(fp, INDENT "{\n"); + for (unsigned int j = 0; j < Permutation.Values.size(); ++j) + { + fprintf(fp, INDENT INDENT "%s_%s,\n", Permutation.Key.c_str(), Permutation.Values[j].c_str()); + } + fprintf(fp, INDENT INDENT "%s_COUNT,\n", Permutation.Key.c_str()); + fprintf(fp, INDENT "};\n"); + + fprintf(fp, "#endif\n"); + fprintf(fp, "\n"); + } + + fprintf(fp, "};\n"); + fprintf(fp, "\n"); + + fprintf(fp, "struct %s\n", Args.EntryPoint.c_str()); + fprintf(fp, "{\n"); + + fprintf(fp, INDENT "void Create(DevicePointer Device);\n"); + fprintf(fp, INDENT "void Release(DevicePointer Device);\n"); + + fprintf(fp, INDENT "%s& Get(", ClassName.c_str()); + for (unsigned int i = 0; i < ShaderPermutations.size(); ++i) + { + if (i != 0) + { + fprintf(fp, ", "); + } + fprintf(fp, "ShaderPermutations::%s %c", ShaderPermutations[i].Key.c_str(), 'A' + i); + } + fprintf(fp, ")\n"); + fprintf(fp, INDENT "{\n"); + fprintf(fp, INDENT INDENT "return m_Shader"); + for (unsigned int i = 0; i < ShaderPermutations.size(); ++i) + { + fprintf(fp, "[%c]", 'A' + i); + } + fprintf(fp, ";\n"); + fprintf(fp, INDENT "}\n"); + + fprintf(fp, "\n"); + fprintf(fp, "private:\n"); + + fprintf(fp, INDENT "%s m_Shader", ClassName.c_str()); + for (unsigned int i = 0; i < ShaderPermutations.size(); ++i) + { + fprintf(fp, "[ShaderPermutations::%s_COUNT]", ShaderPermutations[i].Key.c_str()); + } + fprintf(fp, ";\n"); + + fprintf(fp, "#if _WIN32\n"); + for (unsigned int i = 0; i < ShaderPermutations.size(); ++i) + { + fprintf(fp, INDENT "static_assert(ShaderPermutations::%s_COUNT == %d, \"\");\n", + ShaderPermutations[i].Key.c_str(), + (int) ShaderPermutations[i].Values.size()); + } + fprintf(fp, "#endif\n"); + + fprintf(fp, "};\n"); + fprintf(fp, "\n"); + + fprintf(fp, "};\n"); + + fclose(fp); +} + +int main(int argc, char **argv) +{ + if (argc < 7) + { + fprintf(stderr, "Usage: %s PROFILE INPUT_HLSL ENTRY_POINT OUTPUT_DIR COMPILE_TOOL API [CLASS_NAME]\n", argv[0]); + exit(1); + } + + CArgs Args; + int ArgIndex = 1; + if (ArgIndex < argc) + { + Args.Profile = argv[ArgIndex++]; + } + if (ArgIndex < argc) + { + Args.Input = argv[ArgIndex++]; + } + if (ArgIndex < argc) + { + Args.EntryPoint = argv[ArgIndex++]; + } + if (ArgIndex < argc) + { + Args.OutputDir = argv[ArgIndex++]; + } + if (ArgIndex < argc) + { + Args.CompileTool = argv[ArgIndex++]; + } + if (ArgIndex < argc) + { + Args.API = argv[ArgIndex++]; + } + if (ArgIndex < argc) + { + Args.ClassName = argv[ArgIndex++]; + } + + if (Args.ClassName.size() == 0) + { + const bool IsVS = !strcmp(Args.Profile.c_str(), "vs_5_0"); + const bool IsGS = !strcmp(Args.Profile.c_str(), "gs_5_0"); + Args.ClassName = + IsVS ? "VertexShader" : + IsGS ? "GeometryShader" : + "PixelShader"; + } + + CShaderPermutations ShaderPermutations; + ParseInput(Args, ShaderPermutations); + + Args.Output_H = Args.OutputDir + "\\" + Args.EntryPoint + ".h"; + Args.Output_CPP = Args.OutputDir + "\\" + Args.EntryPoint + ".cpp"; + + CShaderInstances ShaderInstances; + InitShaderInstances(ShaderPermutations, ShaderInstances); + + WriteHeader(Args, ShaderPermutations, ShaderInstances); + + WriteCPP(Args, ShaderPermutations, ShaderInstances); + + return 0; +} diff --git a/build/tools/ShaderBuildTool/ShaderBuildTool.sln b/build/tools/ShaderBuildTool/ShaderBuildTool.sln new file mode 100644 index 0000000..9ca8bfc --- /dev/null +++ b/build/tools/ShaderBuildTool/ShaderBuildTool.sln @@ -0,0 +1,28 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.23107.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ShaderBuildTool", "ShaderBuildTool.vcxproj", "{438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Debug|x64.ActiveCfg = Debug|x64 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Debug|x64.Build.0 = Debug|x64 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Debug|x86.ActiveCfg = Debug|Win32 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Debug|x86.Build.0 = Debug|Win32 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Release|x64.ActiveCfg = Release|x64 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Release|x64.Build.0 = Release|x64 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Release|x86.ActiveCfg = Release|Win32 + {438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj b/build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj new file mode 100644 index 0000000..4976c48 --- /dev/null +++ b/build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj @@ -0,0 +1,168 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <ProjectGuid>{438B73C1-A960-4F8E-B23C-DB6E3AEBC0DE}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>ShaderBuildTool</RootNamespace> + <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v140</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(SolutionDir)..\..\..\src\shaders\</OutDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + <OutDir>$(SolutionDir)..\..\..\src\shaders\</OutDir> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>true</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader>Use</PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>_CRT_NONSTDC_NO_WARNING;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>false</SDLCheck> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader>Use</PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>false</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader>Use</PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>_CRT_NONSTDC_NO_WARNING;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <SDLCheck>false</SDLCheck> + <RuntimeLibrary>MultiThreaded</RuntimeLibrary> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <AdditionalDependencies>kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="stdafx.h" /> + <ClInclude Include="targetver.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="ShaderBuildTool.cpp" /> + <ClCompile Include="stdafx.cpp"> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader> + <PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Create</PrecompiledHeader> + </ClCompile> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj.filters b/build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj.filters new file mode 100644 index 0000000..fe9d0e0 --- /dev/null +++ b/build/tools/ShaderBuildTool/ShaderBuildTool.vcxproj.filters @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="stdafx.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="targetver.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="stdafx.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="ShaderBuildTool.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/build/tools/ShaderBuildTool/stdafx.cpp b/build/tools/ShaderBuildTool/stdafx.cpp new file mode 100644 index 0000000..fa5ec19 --- /dev/null +++ b/build/tools/ShaderBuildTool/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// ShaderBuildTool.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/build/tools/ShaderBuildTool/stdafx.h b/build/tools/ShaderBuildTool/stdafx.h new file mode 100644 index 0000000..35c5878 --- /dev/null +++ b/build/tools/ShaderBuildTool/stdafx.h @@ -0,0 +1,19 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + +#ifdef _MSC_VER +#define _CRT_SECURE_NO_WARNINGS +#endif + +#include "targetver.h" + +#include <stdio.h> +#include <tchar.h> + + + +// TODO: reference additional headers your program requires here diff --git a/build/tools/ShaderBuildTool/targetver.h b/build/tools/ShaderBuildTool/targetver.h new file mode 100644 index 0000000..87c0086 --- /dev/null +++ b/build/tools/ShaderBuildTool/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include <SDKDDKVer.h> |