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/libANGLE/Shader.cpp b/src/libANGLE/Shader.cpp
index 7de8c59..6bdc65a 100644
--- a/src/libANGLE/Shader.cpp
+++ b/src/libANGLE/Shader.cpp
@@ -270,7 +270,8 @@
mState.mShaderVersion = 100;
mState.mVaryings.clear();
mState.mUniforms.clear();
- mState.mInterfaceBlocks.clear();
+ mState.mUniformBlocks.clear();
+ mState.mShaderStorageBlocks.clear();
mState.mActiveAttributes.clear();
mState.mActiveOutputVariables.clear();
mState.mNumViews = -1;
@@ -361,7 +362,8 @@
mState.mVaryings = GetShaderVariables(sh::GetVaryings(compilerHandle));
mState.mUniforms = GetShaderVariables(sh::GetUniforms(compilerHandle));
- mState.mInterfaceBlocks = GetShaderVariables(sh::GetInterfaceBlocks(compilerHandle));
+ mState.mUniformBlocks = GetShaderVariables(sh::GetUniformBlocks(compilerHandle));
+ mState.mShaderStorageBlocks = GetShaderVariables(sh::GetShaderStorageBlocks(compilerHandle));
switch (mState.mShaderType)
{
@@ -451,10 +453,16 @@
return mState.getUniforms();
}
-const std::vector<sh::InterfaceBlock> &Shader::getInterfaceBlocks(const Context *context)
+const std::vector<sh::InterfaceBlock> &Shader::getUniformBlocks(const Context *context)
{
resolveCompile(context);
- return mState.getInterfaceBlocks();
+ return mState.getUniformBlocks();
+}
+
+const std::vector<sh::InterfaceBlock> &Shader::getShaderStorageBlocks(const Context *context)
+{
+ resolveCompile(context);
+ return mState.getShaderStorageBlocks();
}
const std::vector<sh::Attribute> &Shader::getActiveAttributes(const Context *context)