[Mesa-dev] [PATCH 2/3] mesa: add check for NV_texture_barrier in _mesa_TextureBarrierNV()

Ilia Mirkin imirkin at alum.mit.edu
Thu Apr 16 14:53:34 PDT 2015


Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>

Consider dropping the NV from the message as the same callback is used
for ARB_texture_barrier.

On Thu, Apr 16, 2015 at 5:52 PM, Brian Paul <brianp at vmware.com> wrote:
> If an app called glTextureBarrierNV() without checking if the
> extension was available, we'd crash with some gallium drivers
> in st_TextureBarrier() because the pipe_context::texture_barrier()
> pointer was NULL.
>
> Generate GL_INVALID_OPERATION instead.
> ---
>  src/mesa/main/texturebarrier.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/src/mesa/main/texturebarrier.c b/src/mesa/main/texturebarrier.c
> index 08ff561..4b2dda5 100644
> --- a/src/mesa/main/texturebarrier.c
> +++ b/src/mesa/main/texturebarrier.c
> @@ -49,5 +49,11 @@ _mesa_TextureBarrierNV(void)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>
> +   if (!ctx->Extensions.NV_texture_barrier) {
> +      _mesa_error(ctx, GL_INVALID_OPERATION,
> +                  "glTextureBarrierNV(not supported)");
> +      return;
> +   }
> +
>     ctx->Driver.TextureBarrier(ctx);
>  }
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list