Commit b7c4f2b9 by Jamie Madill Committed by Commit Bot

translator: Refactor interface block layout qualifiers.

This will make it easier to insert internal uniform layouts in Vulkan. Bug: angleproject:2717 Change-Id: Ic1a76848337cc67a57698913c584d8596bf4f27e Reviewed-on: https://chromium-review.googlesource.com/1127300Reviewed-by: 's avatarGeoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarLuc Ferron <lucferron@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 6ed6c71c
......@@ -165,6 +165,13 @@ void TOutputGLSLBase::writeLayoutQualifier(TIntermTyped *variable)
return;
}
if (type.getBasicType() == EbtInterfaceBlock)
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
declareInterfaceBlockLayout(interfaceBlock);
return;
}
TInfoSinkBase &out = objSink();
const TLayoutQualifier &layoutQualifier = type.getLayoutQualifier();
out << "layout(";
......@@ -267,11 +274,6 @@ void TOutputGLSLBase::writeVariableType(const TType &type, const TSymbol *symbol
{
writeInvariantQualifier(type);
}
if (type.getBasicType() == EbtInterfaceBlock)
{
const TInterfaceBlock *interfaceBlock = type.getInterfaceBlock();
declareInterfaceBlockLayout(interfaceBlock);
}
if (qualifier != EvqTemporary && qualifier != EvqGlobal)
{
writeQualifier(qualifier, symbol);
......@@ -1316,7 +1318,7 @@ bool NeedsToWriteLayoutQualifier(const TType &type)
{
if (type.getBasicType() == EbtInterfaceBlock)
{
return false;
return true;
}
const TLayoutQualifier &layoutQualifier = type.getLayoutQualifier();
......
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