diff options
author | Stanislav Vorobiov <s.vorobiov@samsung.com> | 2014-01-31 13:50:29 +0400 |
---|---|---|
committer | Stanislav Vorobiov <s.vorobiov@samsung.com> | 2014-01-31 13:50:29 +0400 |
commit | 79d4ecc93e18c55e03d496170ccd245f51a3a91c (patch) | |
tree | 456e8fd2f6e6bbc402450e5df1aaf87beedb82c4 /GLESv2 | |
parent | 473a621cd072d9b6e11670f45c6167545ca10482 (diff) | |
download | emulator-yagl-79d4ecc93e18c55e03d496170ccd245f51a3a91c.tar.gz emulator-yagl-79d4ecc93e18c55e03d496170ccd245f51a3a91c.tar.bz2 emulator-yagl-79d4ecc93e18c55e03d496170ccd245f51a3a91c.zip |
YaGL: Implemented glUniformMatrixAxBfv
Change-Id: I582da14c8bfba8721abd5c333b4724f0014a406b
Diffstat (limited to 'GLESv2')
-rw-r--r-- | GLESv2/dummy.c | 6 | ||||
-rw-r--r-- | GLESv2/yagl_gles3_calls.c | 204 | ||||
-rw-r--r-- | GLESv2/yagl_gles3_program.c | 114 | ||||
-rw-r--r-- | GLESv2/yagl_gles3_program.h | 36 |
4 files changed, 354 insertions, 6 deletions
diff --git a/GLESv2/dummy.c b/GLESv2/dummy.c index 16eb945..76fc04b 100644 --- a/GLESv2/dummy.c +++ b/GLESv2/dummy.c @@ -30,12 +30,6 @@ YAGL_API void glProgramBinary(GLuint program, GLenum binaryFormat, const void *b exit(5); } -YAGL_API void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) -{ - assert(0); - exit(5); -} - YAGL_API void glProgramParameteri(GLuint program, GLenum pname, GLint value) { assert(0); diff --git a/GLESv2/yagl_gles3_calls.c b/GLESv2/yagl_gles3_calls.c index 11accbe..e8a8eaf 100644 --- a/GLESv2/yagl_gles3_calls.c +++ b/GLESv2/yagl_gles3_calls.c @@ -2115,6 +2115,210 @@ out: YAGL_LOG_FUNC_EXIT(NULL); } +YAGL_API void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2x3fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value); + + YAGL_GET_CTX(); + + if (!ctx->base.program) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (count < 0) { + YAGL_SET_ERR(GL_INVALID_VALUE); + goto out; + } + + if (location == -1) { + goto out; + } + + if (location < 0) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (!yagl_gles3_program_uniform_matrix2x3fv(ctx->base.program, location, count, transpose, value)) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + +out: + YAGL_LOG_FUNC_EXIT(NULL); +} + +YAGL_API void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix2x4fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value); + + YAGL_GET_CTX(); + + if (!ctx->base.program) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (count < 0) { + YAGL_SET_ERR(GL_INVALID_VALUE); + goto out; + } + + if (location == -1) { + goto out; + } + + if (location < 0) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (!yagl_gles3_program_uniform_matrix2x4fv(ctx->base.program, location, count, transpose, value)) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + +out: + YAGL_LOG_FUNC_EXIT(NULL); +} + +YAGL_API void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3x2fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value); + + YAGL_GET_CTX(); + + if (!ctx->base.program) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (count < 0) { + YAGL_SET_ERR(GL_INVALID_VALUE); + goto out; + } + + if (location == -1) { + goto out; + } + + if (location < 0) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (!yagl_gles3_program_uniform_matrix3x2fv(ctx->base.program, location, count, transpose, value)) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + +out: + YAGL_LOG_FUNC_EXIT(NULL); +} + +YAGL_API void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix3x4fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value); + + YAGL_GET_CTX(); + + if (!ctx->base.program) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (count < 0) { + YAGL_SET_ERR(GL_INVALID_VALUE); + goto out; + } + + if (location == -1) { + goto out; + } + + if (location < 0) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (!yagl_gles3_program_uniform_matrix3x4fv(ctx->base.program, location, count, transpose, value)) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + +out: + YAGL_LOG_FUNC_EXIT(NULL); +} + +YAGL_API void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4x2fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value); + + YAGL_GET_CTX(); + + if (!ctx->base.program) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (count < 0) { + YAGL_SET_ERR(GL_INVALID_VALUE); + goto out; + } + + if (location == -1) { + goto out; + } + + if (location < 0) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (!yagl_gles3_program_uniform_matrix4x2fv(ctx->base.program, location, count, transpose, value)) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + +out: + YAGL_LOG_FUNC_EXIT(NULL); +} + +YAGL_API void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + YAGL_LOG_FUNC_ENTER_SPLIT4(glUniformMatrix4x3fv, GLint, GLsizei, GLboolean, const GLfloat*, location, count, transpose, value); + + YAGL_GET_CTX(); + + if (!ctx->base.program) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (count < 0) { + YAGL_SET_ERR(GL_INVALID_VALUE); + goto out; + } + + if (location == -1) { + goto out; + } + + if (location < 0) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + + if (!yagl_gles3_program_uniform_matrix4x3fv(ctx->base.program, location, count, transpose, value)) { + YAGL_SET_ERR(GL_INVALID_OPERATION); + goto out; + } + +out: + YAGL_LOG_FUNC_EXIT(NULL); +} + YAGL_API void glClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint *value) { YAGL_LOG_FUNC_ENTER_SPLIT3(glClearBufferiv, GLenum, GLint, const GLint*, buffer, drawbuffer, value); diff --git a/GLESv2/yagl_gles3_program.c b/GLESv2/yagl_gles3_program.c index d18f39a..49d2d50 100644 --- a/GLESv2/yagl_gles3_program.c +++ b/GLESv2/yagl_gles3_program.c @@ -759,3 +759,117 @@ int yagl_gles3_program_uniform4uiv(struct yagl_gles2_program *program, return 1; } + +int yagl_gles3_program_uniform_matrix2x3fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + uint32_t global_location; + + if (!yagl_gles2_program_translate_location(program, + location, + &global_location)) { + return 0; + } + + yagl_host_glUniformMatrix2x3fv(program->gen_locations, global_location, transpose, value, 2 * 3 * count); + + return 1; +} + +int yagl_gles3_program_uniform_matrix2x4fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + uint32_t global_location; + + if (!yagl_gles2_program_translate_location(program, + location, + &global_location)) { + return 0; + } + + yagl_host_glUniformMatrix2x4fv(program->gen_locations, global_location, transpose, value, 2 * 4 * count); + + return 1; +} + +int yagl_gles3_program_uniform_matrix3x2fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + uint32_t global_location; + + if (!yagl_gles2_program_translate_location(program, + location, + &global_location)) { + return 0; + } + + yagl_host_glUniformMatrix3x2fv(program->gen_locations, global_location, transpose, value, 3 * 2 * count); + + return 1; +} + +int yagl_gles3_program_uniform_matrix3x4fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + uint32_t global_location; + + if (!yagl_gles2_program_translate_location(program, + location, + &global_location)) { + return 0; + } + + yagl_host_glUniformMatrix3x4fv(program->gen_locations, global_location, transpose, value, 3 * 4 * count); + + return 1; +} + +int yagl_gles3_program_uniform_matrix4x2fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + uint32_t global_location; + + if (!yagl_gles2_program_translate_location(program, + location, + &global_location)) { + return 0; + } + + yagl_host_glUniformMatrix4x2fv(program->gen_locations, global_location, transpose, value, 4 * 2 * count); + + return 1; +} + +int yagl_gles3_program_uniform_matrix4x3fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + uint32_t global_location; + + if (!yagl_gles2_program_translate_location(program, + location, + &global_location)) { + return 0; + } + + yagl_host_glUniformMatrix4x3fv(program->gen_locations, global_location, transpose, value, 4 * 3 * count); + + return 1; +} diff --git a/GLESv2/yagl_gles3_program.h b/GLESv2/yagl_gles3_program.h index 189c0ec..4c6bacc 100644 --- a/GLESv2/yagl_gles3_program.h +++ b/GLESv2/yagl_gles3_program.h @@ -91,4 +91,40 @@ int yagl_gles3_program_uniform4uiv(struct yagl_gles2_program *program, GLsizei count, const GLuint *v); +int yagl_gles3_program_uniform_matrix2x3fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +int yagl_gles3_program_uniform_matrix2x4fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +int yagl_gles3_program_uniform_matrix3x2fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +int yagl_gles3_program_uniform_matrix3x4fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +int yagl_gles3_program_uniform_matrix4x2fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + +int yagl_gles3_program_uniform_matrix4x3fv(struct yagl_gles2_program *program, + GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value); + #endif |