Implemented glGetActiveUniform
TRAC #11929
Signed-off-by: Shannon Woods
Signed-off-by: Daniel Koch
Author: Nicolas Capens
git-svn-id: https://angleproject.googlecode.com/svn/trunk@181 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 61c8e48..2abbd61 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -216,6 +216,41 @@
mVertexCompiler = NULL;
}
+GLenum Shader::parseAttributeType(const std::string &type)
+{
+ if (type == "float")
+ {
+ return GL_FLOAT;
+ }
+ else if (type == "float2")
+ {
+ return GL_FLOAT_VEC2;
+ }
+ else if (type == "float3")
+ {
+ return GL_FLOAT_VEC3;
+ }
+ else if (type == "float4")
+ {
+ return GL_FLOAT_VEC4;
+ }
+ else if (type == "float2x2")
+ {
+ return GL_FLOAT_MAT2;
+ }
+ else if (type == "float3x3")
+ {
+ return GL_FLOAT_MAT3;
+ }
+ else if (type == "float4x4")
+ {
+ return GL_FLOAT_MAT4;
+ }
+ else UNREACHABLE();
+
+ return GL_NONE;
+}
+
void Shader::compileToHLSL(void *compiler)
{
if (isCompiled() || !mSource)
@@ -319,7 +354,7 @@
{
if (semanticIndex < MAX_VERTEX_ATTRIBS + 1)
{
- mAttribute[semanticIndex].type = attributeType;
+ mAttribute[semanticIndex].type = parseAttributeType(attributeType);
mAttribute[semanticIndex].name = attributeName;
}
else