VS: Add a source file property to set the hlsl shader type
Create a VS_SHADER_TYPE source file property. Inspired-by: Gilles Khouzam <gillesk@microsoft.com>
This commit is contained in:
parent
9b4dc2ad4a
commit
6fe770e163
|
@ -288,6 +288,7 @@ Properties on Source Files
|
||||||
/prop_sf/OBJECT_OUTPUTS
|
/prop_sf/OBJECT_OUTPUTS
|
||||||
/prop_sf/SYMBOLIC
|
/prop_sf/SYMBOLIC
|
||||||
/prop_sf/VS_DEPLOYMENT_CONTENT
|
/prop_sf/VS_DEPLOYMENT_CONTENT
|
||||||
|
/prop_sf/VS_SHADER_TYPE
|
||||||
/prop_sf/WRAP_EXCLUDE
|
/prop_sf/WRAP_EXCLUDE
|
||||||
/prop_sf/XCODE_EXPLICIT_FILE_TYPE
|
/prop_sf/XCODE_EXPLICIT_FILE_TYPE
|
||||||
/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE
|
/prop_sf/XCODE_LAST_KNOWN_FILE_TYPE
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
VS_SHADER_TYPE
|
||||||
|
--------------
|
||||||
|
|
||||||
|
Set the VS shader type of a ``.hlsl`` source file.
|
|
@ -1020,11 +1020,22 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
|
||||||
{
|
{
|
||||||
bool toolHasSettings = false;
|
bool toolHasSettings = false;
|
||||||
std::string tool = "None";
|
std::string tool = "None";
|
||||||
|
std::string shaderType;
|
||||||
std::string const& ext = sf->GetExtension();
|
std::string const& ext = sf->GetExtension();
|
||||||
if(ext == "appxmanifest")
|
if(ext == "appxmanifest")
|
||||||
{
|
{
|
||||||
tool = "AppxManifest";
|
tool = "AppxManifest";
|
||||||
}
|
}
|
||||||
|
else if(ext == "hlsl")
|
||||||
|
{
|
||||||
|
tool = "FXCompile";
|
||||||
|
// Figure out the type of shader compiler to use.
|
||||||
|
if(const char* st = sf->GetProperty("VS_SHADER_TYPE"))
|
||||||
|
{
|
||||||
|
shaderType = st;
|
||||||
|
toolHasSettings = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
else if(ext == "jpg" ||
|
else if(ext == "jpg" ||
|
||||||
ext == "png")
|
ext == "png")
|
||||||
{
|
{
|
||||||
|
@ -1078,6 +1089,12 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(!shaderType.empty())
|
||||||
|
{
|
||||||
|
this->WriteString("<ShaderType>", 3);
|
||||||
|
(*this->BuildFileStream) << cmVS10EscapeXML(shaderType)
|
||||||
|
<< "</ShaderType>\n";
|
||||||
|
}
|
||||||
|
|
||||||
this->WriteString("</", 2);
|
this->WriteString("</", 2);
|
||||||
(*this->BuildFileStream) << tool << ">\n";
|
(*this->BuildFileStream) << tool << ">\n";
|
||||||
|
|
Loading…
Reference in New Issue