[Mesa-dev] [PATCH v2 5/9] mesa: Handle QUERY_RESULT_NO_WAIT in GetQueryObject{ui64}v

Kenneth Graunke kenneth at whitecape.org
Thu Mar 27 23:34:05 PDT 2014


On 03/27/2014 01:59 PM, Rafal Mielniczuk wrote:
> Just return and do nothing if query result is not yet available
> 
> Signed-off-by: Rafal Mielniczuk <rafal.mielniczuk2 at gmail.com>
> ---
>  src/mesa/main/queryobj.c | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
> 
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index 86e7c3a..d2d9fa7 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -594,6 +594,10 @@ _mesa_GetQueryObjectiv(GLuint id, GLenum pname, GLint *params)
>     }
>  
>     switch (pname) {
> +      case GL_QUERY_RESULT_NO_WAIT:
> +         if (!q->Ready)
> +            return;
> +         //else fall through

We don't usually use C++ style comments in Mesa.  I would do:

case GL_QUERY_NO_WAIT:
   if (!q->Ready)
       return;
   /* fallthrough */
case GL_QUERY_RESULT_ARB:

Other than that, patches 1-6 are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>

>        case GL_QUERY_RESULT_ARB:
>           if (!q->Ready)
>              ctx->Driver.WaitQuery(ctx, q);
> @@ -645,6 +649,10 @@ _mesa_GetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params)
>     }
>  
>     switch (pname) {
> +      case GL_QUERY_RESULT_NO_WAIT:
> +         if (!q->Ready)
> +            return;
> +         //else fall through
>        case GL_QUERY_RESULT_ARB:
>           if (!q->Ready)
>              ctx->Driver.WaitQuery(ctx, q);
> @@ -699,6 +707,10 @@ _mesa_GetQueryObjecti64v(GLuint id, GLenum pname, GLint64EXT *params)
>     }
>  
>     switch (pname) {
> +      case GL_QUERY_RESULT_NO_WAIT:
> +         if (!q->Ready)
> +            return;
> +         //else fall through
>        case GL_QUERY_RESULT_ARB:
>           if (!q->Ready)
>              ctx->Driver.WaitQuery(ctx, q);
> @@ -739,6 +751,10 @@ _mesa_GetQueryObjectui64v(GLuint id, GLenum pname, GLuint64EXT *params)
>     }
>  
>     switch (pname) {
> +      case GL_QUERY_RESULT_NO_WAIT:
> +         if (!q->Ready)
> +            return;
> +         //else fall through
>        case GL_QUERY_RESULT_ARB:
>           if (!q->Ready)
>              ctx->Driver.WaitQuery(ctx, q);
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140327/71991868/attachment.sig>


More information about the mesa-dev mailing list