Program: Clean up UBO info gathering.
The data size & block member info was getting messy, so clean up
how we query this from the Impl layer.
Also remove the register information from gl::UniformBlock, moving
it into the D3D-only world.
BUG=angleproject:1172
Change-Id: I40af658ebbd6b7c1a4251906a387ebcbb621cf77
Reviewed-on: https://chromium-review.googlesource.com/304150
Reviewed-by: Corentin Wallez <cwallez@chromium.org>
Tryjob-Request: Jamie Madill <jmadill@chromium.org>
Tested-by: Jamie Madill <jmadill@chromium.org>
diff --git a/src/common/utilities.cpp b/src/common/utilities.cpp
index 764fb06..3952872 100644
--- a/src/common/utilities.cpp
+++ b/src/common/utilities.cpp
@@ -639,8 +639,24 @@
return name.substr(0, open);
}
+unsigned int ParseAndStripArrayIndex(std::string *name)
+{
+ unsigned int subscript = GL_INVALID_INDEX;
+
+ // Strip any trailing array operator and retrieve the subscript
+ size_t open = name->find_last_of('[');
+ size_t close = name->find_last_of(']');
+ if (open != std::string::npos && close == name->length() - 1)
+ {
+ subscript = atoi(name->c_str() + open + 1);
+ name->erase(open);
+ }
+
+ return subscript;
}
+} // namespace gl
+
namespace egl
{
static_assert(EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR - EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR == 1,