YaGL: Simplified active variable operations 41/13141/1
authorStanislav Vorobiov <s.vorobiov@samsung.com>
Fri, 8 Nov 2013 10:24:41 +0000 (14:24 +0400)
committerStanislav Vorobiov <s.vorobiov@samsung.com>
Fri, 8 Nov 2013 10:24:41 +0000 (14:24 +0400)
Change-Id: I49df9ce8ceb73aede6a1372de47845fcd3218833

hw/yagl_apis/gles/yagl_gles_calls.c
hw/yagl_apis/gles/yagl_host_gles_calls.c
hw/yagl_apis/gles/yagl_host_gles_calls.h

index 32b78a06de73db503ae8aa70611596b457f19ce8..a8f8989d4e7ef4efe58c7d64eb5a13bea86bafe7 100644 (file)
@@ -1299,7 +1299,6 @@ static bool yagl_func_glGetActiveAttrib(struct yagl_transport *t)
     GLchar *name;
     int32_t name_maxcount;
     int32_t *name_count;
-    GLboolean *retval;
     program = yagl_transport_get_out_GLuint(t);
     index = yagl_transport_get_out_GLuint(t);
     yagl_transport_get_in_arg(t, (void**)&size);
@@ -1307,11 +1306,10 @@ static bool yagl_func_glGetActiveAttrib(struct yagl_transport *t)
     if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) {
         return false;
     }
-    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveAttrib, GLuint, GLuint, void*, void*, void*, program, index, size, type, name);
     *name_count = 0;
-    *retval = yagl_host_glGetActiveAttrib(program, index, size, type, name, name_maxcount, name_count);
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+    (void)yagl_host_glGetActiveAttrib(program, index, size, type, name, name_maxcount, name_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
 
     return true;
 }
@@ -1328,7 +1326,6 @@ static bool yagl_func_glGetActiveUniform(struct yagl_transport *t)
     GLchar *name;
     int32_t name_maxcount;
     int32_t *name_count;
-    GLboolean *retval;
     program = yagl_transport_get_out_GLuint(t);
     index = yagl_transport_get_out_GLuint(t);
     yagl_transport_get_in_arg(t, (void**)&size);
@@ -1336,11 +1333,10 @@ static bool yagl_func_glGetActiveUniform(struct yagl_transport *t)
     if (!yagl_transport_get_in_array(t, sizeof(GLchar), (void**)&name, &name_maxcount, &name_count)) {
         return false;
     }
-    yagl_transport_get_in_arg(t, (void**)&retval);
     YAGL_LOG_FUNC_ENTER_SPLIT5(glGetActiveUniform, GLuint, GLuint, void*, void*, void*, program, index, size, type, name);
     *name_count = 0;
-    *retval = yagl_host_glGetActiveUniform(program, index, size, type, name, name_maxcount, name_count);
-    YAGL_LOG_FUNC_EXIT_SPLIT(GLboolean, *retval);
+    (void)yagl_host_glGetActiveUniform(program, index, size, type, name, name_maxcount, name_count);
+    YAGL_LOG_FUNC_EXIT(NULL);
 
     return true;
 }
@@ -1571,9 +1567,16 @@ static bool yagl_func_glGetVertexAttribiv(struct yagl_transport *t)
 static bool yagl_func_glLinkProgram(struct yagl_transport *t)
 {
     GLuint program;
+    GLint *params;
+    int32_t params_maxcount;
+    int32_t *params_count;
     program = yagl_transport_get_out_GLuint(t);
-    YAGL_LOG_FUNC_ENTER_SPLIT1(glLinkProgram, GLuint, program);
-    (void)yagl_host_glLinkProgram(program);
+    if (!yagl_transport_get_in_array(t, sizeof(GLint), (void**)&params, &params_maxcount, &params_count)) {
+        return false;
+    }
+    YAGL_LOG_FUNC_ENTER_SPLIT2(glLinkProgram, GLuint, void*, program, params);
+    *params_count = 0;
+    (void)yagl_host_glLinkProgram(program, params, params_maxcount, params_count);
     YAGL_LOG_FUNC_EXIT(NULL);
 
     return true;
index 9ef6158d1347f355ca62b7f939782eb0bbf1eaa4..0f422e30adf5a20a0b7f60fc883bb1ffdc50f3eb 100644 (file)
@@ -1109,7 +1109,7 @@ void yagl_host_glBindAttribLocation(GLuint program,
                                             name);
 }
 
-GLboolean yagl_host_glGetActiveAttrib(GLuint program,
+void yagl_host_glGetActiveAttrib(GLuint program,
     GLuint index,
     GLint *size,
     GLenum *type,
@@ -1127,13 +1127,10 @@ GLboolean yagl_host_glGetActiveAttrib(GLuint program,
 
     if (tmp >= 0) {
         *name_count = MIN(tmp + 1, name_maxcount);
-        return GL_TRUE;
-    } else {
-        return GL_FALSE;
     }
 }
 
-GLboolean yagl_host_glGetActiveUniform(GLuint program,
+void yagl_host_glGetActiveUniform(GLuint program,
     GLuint index,
     GLint *size,
     GLenum *type,
@@ -1151,9 +1148,6 @@ GLboolean yagl_host_glGetActiveUniform(GLuint program,
 
     if (tmp >= 0) {
         *name_count = MIN(tmp + 1, name_maxcount);
-        return GL_TRUE;
-    } else {
-        return GL_FALSE;
     }
 }
 
@@ -1299,9 +1293,25 @@ void yagl_host_glGetVertexAttribiv(GLuint index,
     gles_api_ts->driver->GetVertexAttribiv(index, pname, params);
 }
 
-void yagl_host_glLinkProgram(GLuint program)
+void yagl_host_glLinkProgram(GLuint program,
+    GLint *params, int32_t params_maxcount, int32_t *params_count)
 {
-    gles_api_ts->driver->LinkProgram(yagl_gles_object_get(program));
+    GLuint obj = yagl_gles_object_get(program);
+
+    gles_api_ts->driver->LinkProgram(obj);
+
+    if (!params || (params_maxcount != 6)) {
+        return;
+    }
+
+    gles_api_ts->driver->GetProgramiv(obj, GL_LINK_STATUS, &params[0]);
+    gles_api_ts->driver->GetProgramiv(obj, GL_INFO_LOG_LENGTH, &params[1]);
+    gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_ATTRIBUTES, &params[2]);
+    gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &params[3]);
+    gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_UNIFORMS, &params[4]);
+    gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_UNIFORM_MAX_LENGTH, &params[5]);
+
+    *params_count = 6;
 }
 
 void yagl_host_glUniform1f(GLboolean tl,
index 51d85f588062bcef404db3218f594f3d86097aaf..4397f42ae651ec1cea4991b2caf16a278e8742f5 100644 (file)
@@ -224,12 +224,12 @@ void yagl_host_glCompileShader(GLuint shader);
 void yagl_host_glBindAttribLocation(GLuint program,
     GLuint index,
     const GLchar *name, int32_t name_count);
-GLboolean yagl_host_glGetActiveAttrib(GLuint program,
+void yagl_host_glGetActiveAttrib(GLuint program,
     GLuint index,
     GLint *size,
     GLenum *type,
     GLchar *name, int32_t name_maxcount, int32_t *name_count);
-GLboolean yagl_host_glGetActiveUniform(GLuint program,
+void yagl_host_glGetActiveUniform(GLuint program,
     GLuint index,
     GLint *size,
     GLenum *type,
@@ -262,7 +262,8 @@ void yagl_host_glGetVertexAttribfv(GLuint index,
 void yagl_host_glGetVertexAttribiv(GLuint index,
     GLenum pname,
     GLint *params, int32_t params_maxcount, int32_t *params_count);
-void yagl_host_glLinkProgram(GLuint program);
+void yagl_host_glLinkProgram(GLuint program,
+    GLint *params, int32_t params_maxcount, int32_t *params_count);
 void yagl_host_glUniform1f(GLboolean tl,
     uint32_t location,
     GLfloat x);