[Mesa-dev] [PATCH] i965: Flush batchbuffer containing the query on glQueryCounter.

Kenneth Graunke kenneth at whitecape.org
Sun Apr 12 10:34:12 PDT 2015


On Sunday, April 12, 2015 07:08:58 PM Mathias.Froehlich at gmx.net wrote:
> From: Mathias Froehlich <Mathias.Froehlich at gmx.net>
> 
> Hi all,
> 
> the attached patch fixes timer queries as noticed with osgviewer.
> Please review!
> 
> Greetings and thanks
> 
>   Mathias
> 
> 
> 
> This change fixes a regression with timer queries introduced with
> commit 3eb6258. There the pending batchbuffer is flushed
> only if glEndQuery is executed. This present change adds such
> a flush to glQueryCounter which also schedules a value query
> just like glEndQuery does. The patch fixes GPU timer queries
> going mad from within osgviewer.
> 
> Signed-off-by: Mathias Froehlich <Mathias.Froehlich at web.de>
> ---
>  src/mesa/drivers/dri/i965/brw_queryobj.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_queryobj.c b/src/mesa/drivers/dri/i965/brw_queryobj.c
> index 917a24f..667c900 100644
> --- a/src/mesa/drivers/dri/i965/brw_queryobj.c
> +++ b/src/mesa/drivers/dri/i965/brw_queryobj.c
> @@ -472,6 +472,8 @@ brw_query_counter(struct gl_context *ctx, struct gl_query_object *q)
>     drm_intel_bo_unreference(query->bo);
>     query->bo = drm_intel_bo_alloc(brw->bufmgr, "timestamp query", 4096, 4096);
>     brw_write_timestamp(brw, query->bo, 0);
> +
> +   query->flushed = false;
>  }
>  
>  /**
> 

D'oh.  Thanks :)

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Cc: mesa-stable at lists.freedesktop.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150412/c2a9bd59/attachment.sig>


More information about the mesa-dev mailing list