diff options
author | Bo Liu <boliu@google.com> | 2014-08-19 14:18:08 -0700 |
---|---|---|
committer | Bo Liu <boliu@google.com> | 2014-08-19 14:18:08 -0700 |
commit | 64be28160a13c210790863a2b05603acb37661ed (patch) | |
tree | 475fa4adf7b3a79d2980ef18eec60d5529a5bf1b | |
parent | 62fe2385907281231e53f05cc2bea7ba5adf4462 (diff) | |
parent | 8938b6dcd63f0a1a0756f452dad058fa1827ae1e (diff) | |
download | angle-64be28160a13c210790863a2b05603acb37661ed.tar.gz |
Merge from Chromium at DEPS revision 37.0.2062.95
This commit was generated by merge_to_master.py.
Change-Id: If29cef6221d2b5324baee465dbb67877078ef8c9
-rw-r--r-- | src/compiler/translator/OutputHLSL.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp index 5520c861..5cc2c141 100644 --- a/src/compiler/translator/OutputHLSL.cpp +++ b/src/compiler/translator/OutputHLSL.cpp @@ -582,7 +582,11 @@ void OutputHLSL::header() else { const TStructure *structure = type.getStruct(); - const TString &typeName = (structure ? structureTypeName(*structure, false, false) : typeString(type)); + // If this is a nameless struct, we need to use its full definition, rather than its (empty) name. + // TypeString() will invoke defineNameless in this case, but layout qualifiers, if relevant, will not + // be taken into account. + const TString &typeName = ((structure && !structure->name().empty()) ? + structureTypeName(*structure, false, false) : typeString(type)); const TString ®isterString = TString("register(") + RegisterPrefix(type) + str(registerIndex) + ")"; |