Gather UniformBlock and ShaderStorageBlock separately
Refactor InterfaceBlocks since it only stands for UniformBlock before
ES31. But for ES31, uniform block and shader storage block both belong
to interface block.
This CL will add GetUniformBlocks and GetShaderStorageBlocks in
ShaderLang.h. Meanwhile, keep GetInterfaceBlocks which can return all
the interface blocks together.
BUG=angleproject:1951
Change-Id: I3036e201aadfbd490575ed03538c81bcc3793ff3
Reviewed-on: https://chromium-review.googlesource.com/582546
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Geoff Lang <geofflang@chromium.org>
diff --git a/src/compiler/translator/OutputHLSL.cpp b/src/compiler/translator/OutputHLSL.cpp
index 2d43024..03e0494 100644
--- a/src/compiler/translator/OutputHLSL.cpp
+++ b/src/compiler/translator/OutputHLSL.cpp
@@ -147,7 +147,7 @@
}
// Reserve registers for the default uniform block and driver constants
- mUniformHLSL->reserveInterfaceBlockRegisters(2);
+ mUniformHLSL->reserveUniformBlockRegisters(2);
}
OutputHLSL::~OutputHLSL()
@@ -231,9 +231,9 @@
}
}
-const std::map<std::string, unsigned int> &OutputHLSL::getInterfaceBlockRegisterMap() const
+const std::map<std::string, unsigned int> &OutputHLSL::getUniformBlockRegisterMap() const
{
- return mUniformHLSL->getInterfaceBlockRegisterMap();
+ return mUniformHLSL->getUniformBlockRegisterMap();
}
const std::map<std::string, unsigned int> &OutputHLSL::getUniformRegisterMap() const
@@ -354,7 +354,7 @@
out << mStructureHLSL->structsHeader();
mUniformHLSL->uniformsHeader(out, mOutputType, mReferencedUniforms);
- out << mUniformHLSL->interfaceBlocksHeader(mReferencedInterfaceBlocks);
+ out << mUniformHLSL->uniformBlocksHeader(mReferencedUniformBlocks);
if (!mEqualityFunctions.empty())
{
@@ -792,7 +792,7 @@
if (interfaceBlock)
{
- mReferencedInterfaceBlocks[interfaceBlock->name()] = node;
+ mReferencedUniformBlocks[interfaceBlock->name()] = node;
}
else
{
@@ -1138,9 +1138,9 @@
{
TInterfaceBlock *interfaceBlock = leftType.getInterfaceBlock();
const int arrayIndex = node->getRight()->getAsConstantUnion()->getIConst(0);
- mReferencedInterfaceBlocks[interfaceBlock->instanceName()] =
+ mReferencedUniformBlocks[interfaceBlock->instanceName()] =
node->getLeft()->getAsSymbolNode();
- out << mUniformHLSL->interfaceBlockInstanceString(*interfaceBlock, arrayIndex);
+ out << mUniformHLSL->uniformBlockInstanceString(*interfaceBlock, arrayIndex);
return false;
}
}