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 <imirkin@alum.mit.edu>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
{
GET_CURRENT_CONTEXT(ctx);
+ if (!ctx->Extensions.NV_texture_barrier) {
+ _mesa_error(ctx, GL_INVALID_OPERATION,
+ "glTextureBarrier(not supported)");
+ return;
+ }
+
ctx->Driver.TextureBarrier(ctx);
}