forked from samwinkelstein/tomdc_sound_location
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ms.fxcompile.targets
198 lines (167 loc) · 8.36 KB
/
ms.fxcompile.targets
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
============================================================
FxCompile
Compile .hlsl shaders files into .cso.
[IN]
ItemType of EffectShader, VertexShader, PixelShader, GeometryShader,
HullShader, DomainShader, ComputeShader, and TextureShader
[OUT]
@(FxCompileOutput) - a list of .cso files
============================================================
-->
<UsingTask
TaskName="FxCompile"
TaskFactory="CodeTaskFactory"
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" >
<ParameterGroup>
<Source ParameterType="Microsoft.Build.Framework.ITaskItem[]" Required="true" />
<ShaderType/>
<ShaderModel/>
<AssemblerOutput/>
<AssemblerOutputFile/>
<VariableName/>
<HeaderFileOutput/>
<ObjectFileOutput/>
<PreprocessorDefinitions ParameterType="System.String[]"/>
<AdditionalIncludeDirectories ParameterType="System.String[]"/>
<SuppressStartupBanner ParameterType="System.Boolean"/>
<EntryPointName/>
<TreatWarningAsError ParameterType="System.Boolean"/>
<DisableOptimizations ParameterType="System.Boolean"/>
<EnableDebuggingInformation ParameterType="System.Boolean"/>
<SdkToolsPath/>
</ParameterGroup>
<Task>
<Reference Include="$(MSBuildToolsPath)\Microsoft.Build.Tasks.Core.dll" />
<Using Namespace="System"/>
<Using Namespace="System.IO"/>
<Using Namespace="Microsoft.Build.Tasks"/>
<Code Type="Class" Language="cs" Source="$(MSBuildThisFileDirectory)FxCompile.cs">
</Code>
</Task>
</UsingTask>
<PropertyGroup>
<PrepareResourcesDependsOn>
$(PrepareResourcesDependsOn);
FxCompile;
</PrepareResourcesDependsOn>
</PropertyGroup>
<ItemGroup>
<AvailableItemName Include="EffectShader" />
<AvailableItemName Include="VertexShader" />
<AvailableItemName Include="PixelShader" />
<AvailableItemName Include="GeometryShader" />
<AvailableItemName Include="HullShader" />
<AvailableItemName Include="DomainShader" />
<AvailableItemName Include="ComputeShader" />
<AvailableItemName Include="TextureShader" />
</ItemGroup>
<Target Name="AssignItemsFxCompile" >
<AssignTargetPath Files="@(EffectShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_EffectShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(VertexShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_VertexShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(PixelShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_PixelShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(GeometryShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_GeometryShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(HullShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_HullShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(DomainShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_DomainShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(ComputeShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_ComputeShaderWithTargetPath" />
</AssignTargetPath>
<AssignTargetPath Files="@(TextureShader)" RootFolder="$(MSBuildProjectDirectory)">
<Output TaskParameter="AssignedFiles" ItemName="_TextureShaderWithTargetPath" />
</AssignTargetPath>
<ItemGroup>
<_FxCompile Include="@(_EffectShaderWithTargetPath)">
<ShaderType>Effect</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_VertexShaderWithTargetPath)">
<ShaderType>Vertex</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_PixelShaderWithTargetPath)">
<ShaderType>Pixel</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_GeometryShaderWithTargetPath)">
<ShaderType>Geometry</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_HullShaderWithTargetPath)">
<ShaderType>Hull</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_DomainShaderWithTargetPath)">
<ShaderType>Domain</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_ComputeShaderWithTargetPath)">
<ShaderType>Compute</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
<_FxCompile Include="@(_TextureShaderWithTargetPath)">
<ShaderType>Texture</ShaderType>
<ShaderModel Condition="'$(ShaderModel)' == ''">5_0</ShaderModel>
</_FxCompile>
</ItemGroup>
<ItemGroup>
<_FxCompile>
<EnableDebuggingInformation Condition="'$(DebugSymbols)' == 'true'">true</EnableDebuggingInformation>
<TargetDirectory>$([System.IO.Path]::GetDirectoryName(%(_FxCompile.TargetPath)))</TargetDirectory>
<ObjectFileOutput Condition="'$(ObjectFileOutput)' == ''">$(IntermediateOutputPath)$([System.IO.Path]::ChangeExtension(%(_FxCompile.TargetPath), '.cso'))</ObjectFileOutput>
<EntryPointName Condition="'$(EntryPointName)' == ''">main</EntryPointName>
<SuppressStartupBanner Condition="'$(SuppressStartupBanner)' == ''">true</SuppressStartupBanner>
<ShaderModel Condition="'$(ShaderModel)' != ''">$(ShaderModel)</ShaderModel>
</_FxCompile>
</ItemGroup>
<ItemGroup>
<ReferenceCopyLocalPaths Include="@(_FxCompile->'%(ObjectFileOutput)'->'%(FullPath)')">
<DestinationSubDirectory Condition=" %(_FxCompile.TargetDirectory) != '' " >%(_FxCompile.TargetDirectory)\</DestinationSubDirectory>
</ReferenceCopyLocalPaths>
</ItemGroup>
<PropertyGroup>
<FXCPath>$(MSBuildProgramFiles32)\Windows Kits\10\bin\x86</FXCPath>
</PropertyGroup>
<Message Text="Using 'fxc.exe' from '$(FXCPath)'." />
</Target>
<PropertyGroup>
<FxCompileDependsOn>$(FxCompileDependsOn);AssignItemsFxCompile;</FxCompileDependsOn>
<AssignTargetPathsDependsOn>$(AssignTargetPathsDependsOn);AssignItemsFxCompile</AssignTargetPathsDependsOn>
</PropertyGroup>
<Target Name="FxCompile" Condition="'@(_FxCompile)' != ''" DependsOnTargets="$(FxCompileDependsOn)" Inputs="@(_FxCompile)" Outputs="%(_FxCompile.ObjectFileOutput)">
<MakeDir Directories="@(_FxCompile->'%(ObjectFileOutput)'->DirectoryName())" />
<FxCompile Source="@(_FxCompile)"
ShaderType="%(_FxCompile.ShaderType)"
ShaderModel="%(_FxCompile.ShaderModel)"
AssemblerOutput="%(_FxCompile.AssemblerOutput)"
AssemblerOutputFile="%(_FxCompile.AssemblerOutputFile)"
VariableName="%(_FxCompile.VariableName)"
HeaderFileOutput="%(_FxCompile.HeaderFileOutput)"
ObjectFileOutput="%(_FxCompile.ObjectFileOutput)"
PreprocessorDefinitions="%(_FxCompile.PreprocessorDefinitions)"
AdditionalIncludeDirectories="%(_FxCompile.AdditionalIncludeDirectories)"
SuppressStartupBanner="%(_FxCompile.SuppressStartupBanner)"
EntryPointName="%(_FxCompile.EntryPointName)"
TreatWarningAsError="%(_FxCompile.TreatWarningAsError)"
DisableOptimizations="%(_FxCompile.DisableOptimizations)"
EnableDebuggingInformation="%(_FxCompile.EnableDebuggingInformation)"
SdkToolsPath="$(FXCPath)">
</FxCompile>
<ItemGroup>
<FxCompileOutput Include="@(_FxCompile->'%(ObjectFileOutput)')" />
<FileWrites Include="@(_FxCompile->'%(ObjectFileOutput)')" />
</ItemGroup>
</Target>
</Project>