[Mesa-dev] [PATCH 08/11] mesa: Return INVALID_OPERATION when querying a never bound Query obj
Ian Romanick
idr at freedesktop.org
Tue Feb 10 09:26:59 PST 2015
This patch is
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
On 02/10/2015 07:40 AM, Eduardo Lima Mitev wrote:
> Section 2.14 Asynchronous Queries, page 84 of the OpenGL ES 3.0.4 states:
>
> "The command void GenQueries( sizei n, uint *ids ); returns n previously unused
> query object names in ids. These names are marked as used, for the purposes of
> GenQueries only, but no object is associated with them until the first time they
> are used by BeginQuery."
>
> This means that any attempt to use or query a Query object id before it has ever
> been bound by calling glBeginQuery, should be assume to be an invalid object.
>
> Fixes 1 dEQP test:
> * dEQP-GLES3.functional.negative_api.state.get_query_objectuiv
> ---
> src/mesa/main/queryobj.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index 932359c..8ce899f 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -589,7 +589,7 @@ _mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
> if (id)
> q = _mesa_lookup_query_object(ctx, id);
>
> - if (!q || q->Active) {
> + if (!q || q->Active || !q->EverBound) {
> _mesa_error(ctx, GL_INVALID_OPERATION,
> "glGetQueryObjectivARB(id=%d is invalid or active)", id);
> return;
> @@ -640,7 +640,7 @@ _mesa_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
> if (id)
> q = _mesa_lookup_query_object(ctx, id);
>
> - if (!q || q->Active) {
> + if (!q || q->Active || !q->EverBound) {
> _mesa_error(ctx, GL_INVALID_OPERATION,
> "glGetQueryObjectuivARB(id=%d is invalid or active)", id);
> return;
> @@ -694,7 +694,7 @@ _mesa_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64EXT *params)
> if (id)
> q = _mesa_lookup_query_object(ctx, id);
>
> - if (!q || q->Active) {
> + if (!q || q->Active || !q->EverBound) {
> _mesa_error(ctx, GL_INVALID_OPERATION,
> "glGetQueryObjectui64vARB(id=%d is invalid or active)", id);
> return;
> @@ -734,7 +734,7 @@ _mesa_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64EXT *params)
> if (id)
> q = _mesa_lookup_query_object(ctx, id);
>
> - if (!q || q->Active) {
> + if (!q || q->Active || !q->EverBound) {
> _mesa_error(ctx, GL_INVALID_OPERATION,
> "glGetQueryObjectuui64vARB(id=%d is invalid or active)", id);
> return;
>
More information about the mesa-dev
mailing list