Merge topic 'vs-hlsl-object-name'

8d1ccbc693 VS: Add VS_SHADER_OBJECT_FILE_NAME source file property

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1997
This commit is contained in:
Brad King
2018-04-25 12:53:49 +00:00
committed by Kitware Robot
4 changed files with 21 additions and 0 deletions

View File

@@ -405,6 +405,7 @@ Properties on Source Files
/prop_sf/VS_SHADER_ENTRYPOINT
/prop_sf/VS_SHADER_FLAGS
/prop_sf/VS_SHADER_MODEL
/prop_sf/VS_SHADER_OBJECT_FILE_NAME
/prop_sf/VS_SHADER_OUTPUT_HEADER_FILE
/prop_sf/VS_SHADER_TYPE
/prop_sf/VS_SHADER_VARIABLE_NAME

View File

@@ -0,0 +1,6 @@
VS_SHADER_OBJECT_FILE_NAME
--------------------------
Specifies a file name for the compiled shader object file for an ``.hlsl``
source file. This adds the ``-Fo`` flag to the command line for the FxCompiler
tool.

View File

@@ -0,0 +1,6 @@
vs-hlsl-object-name
-------------------
* HLSL source file property :prop_sf:`VS_SHADER_OBJECT_FILE_NAME` has been
added to the :ref:`Visual Studio Generators` for VS 2010 and above.
The property specifies the file name of the compiled shader object.

View File

@@ -1590,6 +1590,7 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
std::string shaderAdditionalFlags;
std::string shaderDisableOptimizations;
std::string shaderEnableDebug;
std::string shaderObjectFileName;
std::string outputHeaderFile;
std::string variableName;
std::string settingsGenerator;
@@ -1666,6 +1667,10 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
shaderDisableOptimizations = cmSystemTools::IsOn(sdo) ? "true" : "false";
toolHasSettings = true;
}
if (const char* sofn = sf->GetProperty("VS_SHADER_OBJECT_FILE_NAME")) {
shaderObjectFileName = sofn;
toolHasSettings = true;
}
} else if (ext == "jpg" || ext == "png") {
tool = "Image";
} else if (ext == "resw") {
@@ -1808,6 +1813,9 @@ void cmVisualStudio10TargetGenerator::WriteExtraSource(cmSourceFile const* sf)
this->WriteElemEscapeXML("DisableOptimizations",
shaderDisableOptimizations, 3);
}
if (!shaderObjectFileName.empty()) {
this->WriteElemEscapeXML("ObjectFileOutput", shaderObjectFileName, 3);
}
if (!shaderAdditionalFlags.empty()) {
this->WriteElemEscapeXML("AdditionalOptions", shaderAdditionalFlags, 3);
}