Commit 6e36042f by Geoff Lang

Implement translation of EOpIndexDirectInterfaceBlock in OutputGLSL.

BUG=angleproject:882 BUG=angleproject:1149 Change-Id: I5e0808dd3576339aa87aade3a349586d01b28f74 Reviewed-on: https://chromium-review.googlesource.com/297087Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Tested-by: 's avatarGeoff Lang <geofflang@chromium.org>
parent f826e1a3
...@@ -373,6 +373,22 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary *node) ...@@ -373,6 +373,22 @@ bool TOutputGLSLBase::visitBinary(Visit visit, TIntermBinary *node)
visitChildren = false; visitChildren = false;
} }
break; break;
case EOpIndexDirectInterfaceBlock:
if (visit == InVisit)
{
out << ".";
const TInterfaceBlock *interfaceBlock = node->getLeft()->getType().getInterfaceBlock();
const TIntermConstantUnion *index = node->getRight()->getAsConstantUnion();
const TField *field = interfaceBlock->fields()[index->getIConst(0)];
TString fieldName = field->name();
ASSERT(!mSymbolTable.findBuiltIn(interfaceBlock->name(), mShaderVersion));
fieldName = hashName(fieldName);
out << fieldName;
visitChildren = false;
}
break;
case EOpVectorSwizzle: case EOpVectorSwizzle:
if (visit == InVisit) if (visit == InVisit)
{ {
......
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