[Mesa-dev] [PATCH 08/13] mesa/main: fix validation of GL_TIME_ELAPSED

Erik Faye-Lund erik.faye-lund at collabora.com
Thu Nov 8 09:42:55 UTC 2018


On Thu, 2018-11-08 at 11:40 +0200, Tapani Pälli wrote:
> 
> On 11/7/18 5:58 PM, Erik Faye-Lund wrote:
> > ctx->Extensions.EXT_timer_query is set based on the driver-
> > capabilities, not based on the context type. We need to check
> > against
> > _mesa_has_EXT_timer_query(ctx) instead to figure out if the
> > extension
> > is really supported.
> > 
> > This turns usage of GL_TIME_ELAPSED into an error on ES 3, as is
> > required by the spec.
> > 
> > Signed-off-by: Erik Faye-Lund <erik.faye-lund at collabora.com>
> > ---
> >   src/mesa/main/queryobj.c | 2 +-
> >   1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> > index 2f178bbf483..e4185073e3b 100644
> > --- a/src/mesa/main/queryobj.c
> > +++ b/src/mesa/main/queryobj.c
> > @@ -196,7 +196,7 @@ get_query_binding_point(struct gl_context *ctx,
> > GLenum target, GLuint index)
> >         else
> >            return NULL;
> >      case GL_TIME_ELAPSED:
> > -      if (ctx->Extensions.EXT_timer_query)
> > +      if (_mesa_has_EXT_timer_query(ctx))
> >            return &ctx->Query.CurrentTimerObject;
> 
> This would need to be:
> 
>        if (_mesa_has_EXT_timer_query(ctx) ||
>            _mesa_has_EXT_disjoint_timer_query)
> 
> // Tapani

Yeah. There's a similar issue in "mesa/main: fix validation of
GL_TIMESTAMP", where EXT_disjoint_timer_query also allows TIMESTAMP
queries, it seems.



More information about the mesa-dev mailing list