diff options
author | Lizhe Liu <lizhe.liu@intel.com> | 2015-06-01 16:55:48 +0800 |
---|---|---|
committer | Lizhe Liu <lizhe.liu@intel.com> | 2015-06-01 17:33:56 +0800 |
commit | 118bf83aae3fd99b4361ba38bf747e6478868aa8 (patch) | |
tree | bf9f4b68956dbbdaa6df35e47e9333717618107f /opengl/system/GLESv2_enc/GL2Encoder.cpp | |
parent | ee3d16ee0486b428a1c56667540f7ab9ce56195e (diff) | |
download | device_generic_goldfish-118bf83aae3fd99b4361ba38bf747e6478868aa8.tar.gz device_generic_goldfish-118bf83aae3fd99b4361ba38bf747e6478868aa8.tar.bz2 device_generic_goldfish-118bf83aae3fd99b4361ba38bf747e6478868aa8.zip |
Add parameters validation to glGetUniform
According to GLES2.0 Spec, glGetUniform return the value of a
uniform variable. dEQP test it with functional.negative_api.
state.get_uniformfv and functional.negative_api.state.
get_uniformiv. To pass the test cases, we should add object
validation to glGetUniform API. You can see details in
https://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetUniform.xml
Change-Id: Idf95805419fa90d813c9a94765fa6731be6ca661
Signed-off-by: Lizhe Liu <lizhe.liu@intel.com>
Diffstat (limited to 'opengl/system/GLESv2_enc/GL2Encoder.cpp')
-rwxr-xr-x | opengl/system/GLESv2_enc/GL2Encoder.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/opengl/system/GLESv2_enc/GL2Encoder.cpp b/opengl/system/GLESv2_enc/GL2Encoder.cpp index b3c557b2..1dc80155 100755 --- a/opengl/system/GLESv2_enc/GL2Encoder.cpp +++ b/opengl/system/GLESv2_enc/GL2Encoder.cpp @@ -779,7 +779,8 @@ void GL2Encoder::s_glDeleteProgram(void *self, GLuint program) void GL2Encoder::s_glGetUniformiv(void *self, GLuint program, GLint location, GLint* params) { GL2Encoder *ctx = (GL2Encoder*)self; - SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_VALUE); + SET_ERROR_IF(!ctx->m_shared->isObject(program), GL_INVALID_VALUE); + SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION); SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION); GLint hostLoc = ctx->m_shared->locationWARAppToHost(program, location); SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION); @@ -788,7 +789,8 @@ void GL2Encoder::s_glGetUniformiv(void *self, GLuint program, GLint location, GL void GL2Encoder::s_glGetUniformfv(void *self, GLuint program, GLint location, GLfloat* params) { GL2Encoder *ctx = (GL2Encoder*)self; - SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_VALUE); + SET_ERROR_IF(!ctx->m_shared->isObject(program), GL_INVALID_VALUE); + SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION); SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION); GLint hostLoc = ctx->m_shared->locationWARAppToHost(program,location); SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION); |