summaryrefslogtreecommitdiffstats
path: root/Source/cmVisualStudio10TargetGenerator.cxx
diff options
context:
space:
mode:
authorCedric Perthuis <cedric.perthuis@gmail.com>2014-12-02 09:41:10 (GMT)
committerBrad King <brad.king@kitware.com>2014-12-03 14:30:59 (GMT)
commit2a224b4ce3fcc3c25bb3f56cf50806ae79262fc2 (patch)
treeb5ad40461fb63e893ead590dc96d67027a6b1025 /Source/cmVisualStudio10TargetGenerator.cxx
parent433c6d4689ca86f1a8d8d966be0204e98f95b968 (diff)
downloadCMake-2a224b4ce3fcc3c25bb3f56cf50806ae79262fc2.zip
CMake-2a224b4ce3fcc3c25bb3f56cf50806ae79262fc2.tar.gz
CMake-2a224b4ce3fcc3c25bb3f56cf50806ae79262fc2.tar.bz2
VS: Add source file properties to set the hlsl shader entry point and model
Create properties VS_SHADER_ENTRYPOINT and VS_SHADER_MODEL. Without these many .hlsl source files may not be possible to use. Extend the VSWinStorePhone test project to cover them.
Diffstat (limited to 'Source/cmVisualStudio10TargetGenerator.cxx')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx27
1 files changed, 26 insertions, 1 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 26fc317..4fbd8fd 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1203,6 +1203,8 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
bool toolHasSettings = false;
std::string tool = "None";
std::string shaderType;
+ std::string shaderEntryPoint;
+ std::string shaderModel;
std::string ext = cmSystemTools::LowerCase(sf->GetExtension());
if(ext == "hlsl")
{
@@ -1213,6 +1215,18 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
shaderType = st;
toolHasSettings = true;
}
+ // Figure out which entry point to use if any
+ if (const char* se = sf->GetProperty("VS_SHADER_ENTRYPOINT"))
+ {
+ shaderEntryPoint = se;
+ toolHasSettings = true;
+ }
+ // Figure out which entry point to use if any
+ if (const char* sm = sf->GetProperty("VS_SHADER_MODEL"))
+ {
+ shaderModel = sm;
+ toolHasSettings = true;
+ }
}
else if(ext == "jpg" ||
ext == "png")
@@ -1295,7 +1309,18 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
(*this->BuildFileStream) << cmVS10EscapeXML(shaderType)
<< "</ShaderType>\n";
}
-
+ if(!shaderEntryPoint.empty())
+ {
+ this->WriteString("<EntryPointName>", 3);
+ (*this->BuildFileStream) << cmVS10EscapeXML(shaderEntryPoint)
+ << "</EntryPointName>\n";
+ }
+ if(!shaderModel.empty())
+ {
+ this->WriteString("<ShaderModel>", 3);
+ (*this->BuildFileStream) << cmVS10EscapeXML(shaderModel)
+ << "</ShaderModel>\n";
+ }
this->WriteString("</", 2);
(*this->BuildFileStream) << tool << ">\n";
}