Commit a6e8a0c5 by Qin Jiajia Committed by Commit Bot

ES31: Simplify IsInShaderStorageBlock function

Bug: angleproject:1951 Change-Id: I0501502fa2201953a3dad4b18103ff5ae20db1bf Reviewed-on: https://chromium-review.googlesource.com/c/1314298 Commit-Queue: Corentin Wallez <cwallez@chromium.org> Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org>
parent caeb1e89
...@@ -753,30 +753,28 @@ bool IsOutputVulkan(ShShaderOutput output) ...@@ -753,30 +753,28 @@ bool IsOutputVulkan(ShShaderOutput output)
bool IsInShaderStorageBlock(TIntermTyped *node) bool IsInShaderStorageBlock(TIntermTyped *node)
{ {
TIntermBinary *binaryNode = nullptr;
TIntermSwizzle *swizzleNode = node->getAsSwizzleNode(); TIntermSwizzle *swizzleNode = node->getAsSwizzleNode();
if (swizzleNode) if (swizzleNode)
{ {
binaryNode = swizzleNode->getOperand()->getAsBinaryNode(); return IsInShaderStorageBlock(swizzleNode->getOperand());
if (binaryNode)
{
return IsInShaderStorageBlock(binaryNode->getLeft());
}
TIntermSymbol *symbolNode = swizzleNode->getOperand()->getAsSymbolNode();
if (symbolNode)
{
return symbolNode->getQualifier() == EvqBuffer;
}
} }
binaryNode = node->getAsBinaryNode();
TIntermBinary *binaryNode = node->getAsBinaryNode();
if (binaryNode) if (binaryNode)
{ {
return IsInShaderStorageBlock(binaryNode->getLeft()); switch (binaryNode->getOp())
{
case EOpIndexDirectInterfaceBlock:
case EOpIndexIndirect:
case EOpIndexDirect:
case EOpIndexDirectStruct:
return IsInShaderStorageBlock(binaryNode->getLeft());
default:
return false;
}
} }
const TType &type = node->getType(); const TType &type = node->getType();
return type.getQualifier() == EvqBuffer; return type.getQualifier() == EvqBuffer;
} }
......
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