From: Stanislav Vorobiov Date: Fri, 8 Nov 2013 10:24:41 +0000 (+0400) Subject: YaGL: Simplified active variable operations X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.1~475^2~43 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d8c6de0d83066743c9fbc130fa4bc981840e6fe5;p=sdk%2Femulator%2Fqemu.git YaGL: Simplified active variable operations Change-Id: I49df9ce8ceb73aede6a1372de47845fcd3218833 --- diff --git a/hw/yagl_apis/gles/yagl_gles_calls.c b/hw/yagl_apis/gles/yagl_gles_calls.c index 32b78a06de..a8f8989d4e 100644 --- a/hw/yagl_apis/gles/yagl_gles_calls.c +++ b/hw/yagl_apis/gles/yagl_gles_calls.c @@ -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**)¶ms, ¶ms_maxcount, ¶ms_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; diff --git a/hw/yagl_apis/gles/yagl_host_gles_calls.c b/hw/yagl_apis/gles/yagl_host_gles_calls.c index 9ef6158d13..0f422e30ad 100644 --- a/hw/yagl_apis/gles/yagl_host_gles_calls.c +++ b/hw/yagl_apis/gles/yagl_host_gles_calls.c @@ -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, ¶ms[0]); + gles_api_ts->driver->GetProgramiv(obj, GL_INFO_LOG_LENGTH, ¶ms[1]); + gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_ATTRIBUTES, ¶ms[2]); + gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, ¶ms[3]); + gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_UNIFORMS, ¶ms[4]); + gles_api_ts->driver->GetProgramiv(obj, GL_ACTIVE_UNIFORM_MAX_LENGTH, ¶ms[5]); + + *params_count = 6; } void yagl_host_glUniform1f(GLboolean tl, diff --git a/hw/yagl_apis/gles/yagl_host_gles_calls.h b/hw/yagl_apis/gles/yagl_host_gles_calls.h index 51d85f5880..4397f42ae6 100644 --- a/hw/yagl_apis/gles/yagl_host_gles_calls.h +++ b/hw/yagl_apis/gles/yagl_host_gles_calls.h @@ -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);