Cache the index ranges at the gl::Buffer and rx::IndexBuffer levels so that ranges do not need to be re-calculated for direct buffers.
Issue #451
Signed-off-by: Jamie Madill
Signed-off-by: Shannon Woods
Author: Geoff Lang
diff --git a/src/libGLESv2/formatutils.cpp b/src/libGLESv2/formatutils.cpp
index 8b22b56..c3cc615 100644
--- a/src/libGLESv2/formatutils.cpp
+++ b/src/libGLESv2/formatutils.cpp
@@ -1282,6 +1282,34 @@
}
}
+GLuint GetTypeBytes(GLenum type)
+{
+ TypeInfo typeInfo;
+ if (GetTypeInfo(type, &typeInfo))
+ {
+ return typeInfo.mTypeBytes;
+ }
+ else
+ {
+ UNREACHABLE();
+ return 0;
+ }
+}
+
+bool IsSpecialInterpretationType(GLenum type)
+{
+ TypeInfo typeInfo;
+ if (GetTypeInfo(type, &typeInfo))
+ {
+ return typeInfo.mSpecialInterpretation;
+ }
+ else
+ {
+ UNREACHABLE();
+ return false;
+ }
+}
+
GLenum GetFormat(GLint internalFormat, GLuint clientVersion)
{
InternalFormatInfo internalFormatInfo;