aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBo Liu <boliu@google.com>2014-08-19 14:18:08 -0700
committerBo Liu <boliu@google.com>2014-08-19 14:18:08 -0700
commit64be28160a13c210790863a2b05603acb37661ed (patch)
tree475fa4adf7b3a79d2980ef18eec60d5529a5bf1b
parent62fe2385907281231e53f05cc2bea7ba5adf4462 (diff)
parent8938b6dcd63f0a1a0756f452dad058fa1827ae1e (diff)
downloadangle-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.cpp6
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 &registerString = TString("register(") + RegisterPrefix(type) + str(registerIndex) + ")";