From fb7b279451cb4fabc8fe4f856f9b6a4b5cd81b85 Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Wed, 24 Aug 2016 03:54:02 +0800 Subject: [PATCH] coregl_fastpath: Change GL error number as driver does GL error number should be set according to the behavior of GL driver or specification files Signed-off-by: Zhaowei Yuan Change-Id: I20e2426fd8e472eba4be54b721748e4479a68e05 --- src/modules/fastpath/coregl_fastpath_gl.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/src/modules/fastpath/coregl_fastpath_gl.c b/src/modules/fastpath/coregl_fastpath_gl.c index 1f397c6..7c3522e 100644 --- a/src/modules/fastpath/coregl_fastpath_gl.c +++ b/src/modules/fastpath/coregl_fastpath_gl.c @@ -8800,7 +8800,7 @@ fastpath_glGetSamplerParameterIivEXT(GLuint sampler, GLenum pname, GLint *params INIT_FASTPATH_GL_FUNC(); if (GET_REAL_OBJ(GL_OBJECT_TYPE_SAMPLER, sampler, &real_obj) != 1) { - _set_gl_error(GL_INVALID_ENUM); + _set_gl_error(GL_INVALID_OPERATION); goto finish; } @@ -8821,7 +8821,7 @@ fastpath_glGetSamplerParameterIuivEXT(GLuint sampler, GLenum pname, GLuint *para INIT_FASTPATH_GL_FUNC(); if (GET_REAL_OBJ(GL_OBJECT_TYPE_SAMPLER, sampler, &real_obj) != 1) { - _set_gl_error(GL_INVALID_ENUM); + _set_gl_error(GL_INVALID_OPERATION); goto finish; } @@ -8842,7 +8842,7 @@ fastpath_glSamplerParameterIivEXT(GLuint sampler, GLenum pname, const GLint *par INIT_FASTPATH_GL_FUNC(); if (GET_REAL_OBJ(GL_OBJECT_TYPE_SAMPLER, sampler, &real_obj) != 1) { - _set_gl_error(GL_INVALID_ENUM); + _set_gl_error(GL_INVALID_OPERATION); goto finish; } @@ -8883,10 +8883,19 @@ fastpath_glTexBufferRangeEXT(GLenum target, GLenum internalformat, GLuint buffer _COREGL_FASTPATH_FUNC_BEGIN(); INIT_FASTPATH_GL_FUNC(); - if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) { + if(target != GL_TEXTURE_BUFFER_EXT){ _set_gl_error(GL_INVALID_ENUM); goto finish; } + if (offset < 0 || size<=0){ + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } _orig_fastpath_glTexBufferRangeEXT(target, internalformat, real_obj, offset, size); @@ -8905,7 +8914,7 @@ fastpath_glSamplerParameterIuivEXT(GLuint sampler, GLenum pname, const GLuint *p INIT_FASTPATH_GL_FUNC(); if (GET_REAL_OBJ(GL_OBJECT_TYPE_SAMPLER, sampler, &real_obj) != 1) { - _set_gl_error(GL_INVALID_ENUM); + _set_gl_error(GL_INVALID_OPERATION); goto finish; } @@ -8925,8 +8934,11 @@ fastpath_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer) _COREGL_FASTPATH_FUNC_BEGIN(); INIT_FASTPATH_GL_FUNC(); - if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) { + if(target != GL_TEXTURE_BUFFER_EXT) _set_gl_error(GL_INVALID_ENUM); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) { + _set_gl_error(GL_INVALID_OPERATION); goto finish; } -- 2.7.4