diff options
author | marha <marha@users.sourceforge.net> | 2012-10-25 09:59:33 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-10-25 09:59:33 +0200 |
commit | 281f26a1dfda732687680a36857960f74608df5b (patch) | |
tree | 2dada31e73b6e8a6d4e1202999a88377d0eebbf3 /mesalib/src/mesa/main/queryobj.c | |
parent | 34d741a3fc96c9424ffec29b114a1bdfde40f8b0 (diff) | |
download | vcxsrv-281f26a1dfda732687680a36857960f74608df5b.tar.gz vcxsrv-281f26a1dfda732687680a36857960f74608df5b.tar.bz2 vcxsrv-281f26a1dfda732687680a36857960f74608df5b.zip |
fontconfig mesa pixman git update
fonconfig: 73ab254336100c5971e3a1e14b73222efd0e9822
mesa: 86cd77d0a9ac940c2c06eebc5e9ef840d176712a
pixman: 9df645dfb04b5a790faabe1e9a84fc37287d91b0
Diffstat (limited to 'mesalib/src/mesa/main/queryobj.c')
-rw-r--r-- | mesalib/src/mesa/main/queryobj.c | 45 |
1 files changed, 36 insertions, 9 deletions
diff --git a/mesalib/src/mesa/main/queryobj.c b/mesalib/src/mesa/main/queryobj.c index 18792cf6c..d21691328 100644 --- a/mesalib/src/mesa/main/queryobj.c +++ b/mesalib/src/mesa/main/queryobj.c @@ -301,6 +301,19 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id) return; } + /* From the GL_ARB_occlusion_query spec: + * + * "If BeginQueryARB is called while another query is already in + * progress with the same target, an INVALID_OPERATION error is + * generated." + */ + if (*bindpt) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glBeginQuery{Indexed}(target=%s is active)", + _mesa_lookup_enum_by_nr(target)); + return; + } + if (id == 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glBeginQuery{Indexed}(id==0)"); return; @@ -361,6 +374,16 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index) /* XXX should probably refcount query objects */ q = *bindpt; + + /* Check for GL_ANY_SAMPLES_PASSED vs GL_SAMPLES_PASSED. */ + if (q && q->Target != target) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "glEndQuery(target=%s with active query of target %s)", + _mesa_lookup_enum_by_nr(target), + _mesa_lookup_enum_by_nr(q->Target)); + return; + } + *bindpt = NULL; if (!q || !q->Active) { @@ -509,7 +532,7 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname, } break; case GL_CURRENT_QUERY_ARB: - *params = q ? q->Id : 0; + *params = (q && q->Target == target) ? q->Id : 0; break; default: _mesa_error(ctx, GL_INVALID_ENUM, "glGetQuery{Indexed}iv(pname)"); @@ -708,7 +731,8 @@ _mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) void -_mesa_init_queryobj_dispatch(struct _glapi_table *disp) +_mesa_init_queryobj_dispatch(const struct gl_context *ctx, + struct _glapi_table *disp) { SET_GenQueriesARB(disp, _mesa_GenQueriesARB); SET_DeleteQueriesARB(disp, _mesa_DeleteQueriesARB); @@ -716,16 +740,19 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp) SET_BeginQueryARB(disp, _mesa_BeginQueryARB); SET_EndQueryARB(disp, _mesa_EndQueryARB); SET_GetQueryivARB(disp, _mesa_GetQueryivARB); - SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); - SET_QueryCounter(disp, _mesa_QueryCounter); - SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); + if (_mesa_is_desktop_gl(ctx)) { + SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); + SET_QueryCounter(disp, _mesa_QueryCounter); + + SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); + SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); - SET_BeginQueryIndexed(disp, _mesa_BeginQueryIndexed); - SET_EndQueryIndexed(disp, _mesa_EndQueryIndexed); - SET_GetQueryIndexediv(disp, _mesa_GetQueryIndexediv); + SET_BeginQueryIndexed(disp, _mesa_BeginQueryIndexed); + SET_EndQueryIndexed(disp, _mesa_EndQueryIndexed); + SET_GetQueryIndexediv(disp, _mesa_GetQueryIndexediv); + } } |