Commit f4126d2b by Shannon Woods

Fix nameless struct handling.

BUG=401296 The addition of layout qualifier handling in es3 development inadvertently broke handling of nameless structs. Change-Id: I805bab7a981d1f7f6227ae043720296fc3454662 Reviewed-on: https://chromium-review.googlesource.com/211860Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org> Conflicts: src/compiler/translator/UniformHLSL.cpp Change-Id: I2f9fca71cef383c1a48c9bcdbe1083ac3222fac0 Reviewed-on: https://chromium-review.googlesource.com/212153Reviewed-by: 's avatarZhenyao Mo <zmo@chromium.org> Tested-by: 's avatarShannon Woods <shannonwoods@chromium.org>
parent 75551cf9
...@@ -582,7 +582,11 @@ void OutputHLSL::header() ...@@ -582,7 +582,11 @@ void OutputHLSL::header()
else else
{ {
const TStructure *structure = type.getStruct(); 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) + ")"; const TString &registerString = TString("register(") + RegisterPrefix(type) + str(registerIndex) + ")";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment