+static const bool TRACE{false};
+
+uint32_t GetGLDataTypeSize(GLenum type)
+{
+ // There are many more types than what are covered here, but
+ // they are not supported in dali.
+ switch(type)
+ {
+ case GL_FLOAT: // "float", 1 float, 4 bytes
+ return 4;
+ case GL_FLOAT_VEC2: // "vec2", 2 floats, 8 bytes
+ return 8;
+ case GL_FLOAT_VEC3: // "vec3", 3 floats, 12 bytes
+ return 12;
+ case GL_FLOAT_VEC4: // "vec4", 4 floats, 16 bytes
+ return 16;
+ case GL_INT: // "int", 1 integer, 4 bytes
+ return 4;
+ case GL_FLOAT_MAT2: // "mat2", 4 floats, 16 bytes
+ return 16;
+ case GL_FLOAT_MAT3: // "mat3", 3 vec3, 36 bytes
+ return 36;
+ case GL_FLOAT_MAT4: // "mat4", 4 vec4, 64 bytes
+ return 64;
+ default:
+ return 0;
+ }
+}