From: Brian Paul Date: Thu, 16 Apr 2015 21:27:41 +0000 (-0600) Subject: mesa: add check for NV_texture_barrier in _mesa_TextureBarrierNV() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=bd4dbdfa519362f74263a2c277a3b4be841acd06;p=mesa.git mesa: add check for NV_texture_barrier in _mesa_TextureBarrierNV() 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. Reviewed-by: Ilia Mirkin Reviewed-by: Anuj Phogat --- diff --git a/src/mesa/main/texturebarrier.c b/src/mesa/main/texturebarrier.c index 08ff561504c..d879eed57f2 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, + "glTextureBarrier(not supported)"); + return; + } + ctx->Driver.TextureBarrier(ctx); }