Last active
August 29, 2015 14:15
-
-
Save Mr-Byte/21da1020ddee3f0e0dee to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- Detect whether or not to include debug symbols in the shader build. --> | |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | |
<ShaderDebugSymbols>false</ShaderDebugSymbols> | |
</PropertyGroup> | |
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | |
<ShaderDebugSymbols>true</ShaderDebugSymbols> | |
</PropertyGroup> | |
<!-- Select the FXC compiler in order of precedence --> | |
<Choose> | |
<When Condition=" '$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot81)' != '' "> | |
<PropertyGroup> | |
<CompilerPath>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot81)bin\x86\fxc.exe</CompilerPath> | |
</PropertyGroup> | |
</When> | |
<When Condition=" '$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot)' != '' "> | |
<PropertyGroup> | |
<CompilerPath>$(registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots@KitsRoot)bin\x86\fxc.exe</CompilerPath> | |
</PropertyGroup> | |
</When> | |
</Choose> | |
<ItemGroup> | |
<CompiledShaderObject Include="@(Shader -> '$(IntermediateOutputPath)%(Filename).cso' )" /> | |
</ItemGroup> | |
<Target Name="ShaderCompileInfo" BeforeTargets="ShaderCompile"> | |
<Message Text="Using compiler '$(CompilerPath)'" /> | |
</Target> | |
<!-- Compile shaders --> | |
<Target Name="ShaderCompile" | |
BeforeTargets="BeforeBuild" | |
Inputs="@(Shader)" | |
Outputs="@(CompiledShaderObject)"> | |
<!--TODO: Turn off debug symbols when compiled in release. --> | |
<Exec Command=""$(CompilerPath)" /T %(Shader.Profile) /Fo "$(IntermediateOutputPath)%(Filename).cso" /Zi /Fd "$(OutputPath)%(Filename).pdb" "%(FullPath)"" | |
Condition="$([System.DateTime]::Parse('%(ModifiedTime)').Ticks) > $([System.IO.File]::GetLastWriteTime('$(IntermediateOutputPath)%(Filename).cso').Ticks)" | |
IgnoreExitCode="true" /> | |
</Target> | |
<!-- Embed resources --> | |
<Target Name="BeforeBuild" AfterTargets="ShaderCompile" BeforeTargets="Build"> | |
<ItemGroup> | |
<EmbeddedResource Include="@(CompiledShaderObject)"> | |
<LogicalName>$(RootNamespace).Shaders.%(Filename)</LogicalName> | |
</EmbeddedResource> | |
</ItemGroup> | |
<Message Text="Embedded the following files: [@(CompiledShaderObject)]" Importance="high" /> | |
</Target> | |
<Target Name="Clean"> | |
<Delete Files="@(CompiledShaderObject)"/> | |
</Target> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<PropertyGroup> | |
<IntermediateOutputPath>C:\temp\</IntermediateOutputPath> | |
</PropertyGroup> | |
<Target Name="Build"> | |
<Message Text="Running build target." /> | |
</Target> | |
<ItemGroup> | |
<VertexShader Include="test.hlsl" /> | |
</ItemGroup> | |
<!-- TODO: Set the ShaderIncludePath here --> | |
<PropertyGroup> | |
<ShaderIncludePath></ShaderIncludePath> | |
<VertexShaderProfile>vs_5_0</VertexShaderProfile> | |
<GeometryShaderProfile>gs_5_0</GeometryShaderProfile> | |
<PixelShaderProfile>ps_5_0</PixelShaderProfile> | |
</PropertyGroup> | |
<Import Project="shaders.targets" /> | |
</Project> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment