From 23570066bfdeebb54953f2c3ac6c7dc73e368f38 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 25 Feb 2019 11:52:59 +0100 Subject: [PATCH] mesa/main: clean-up extension-checks for point-sprites This is the only user of the CHECK_EXTENSION2 macro, so let's remove that while we're at it. Signed-off-by: Erik Faye-Lund Part-of: --- src/mesa/main/enable.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index f41f6185796..e4b6b76cbda 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -280,11 +280,6 @@ _mesa_DisableClientStateiEXT( GLenum cap, GLuint index ) goto invalid_enum_error; \ } -#define CHECK_EXTENSION2(EXT1, EXT2) \ - if (!ctx->Extensions.EXT1 && !ctx->Extensions.EXT2) { \ - goto invalid_enum_error; \ - } - /** * Return pointer to current texture unit for setting/getting coordinate * state. @@ -1020,9 +1015,11 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) /* GL_NV_point_sprite */ case GL_POINT_SPRITE_NV: - if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) + if (!(ctx->API == API_OPENGL_COMPAT && + (_mesa_has_ARB_point_sprite(ctx) || + _mesa_has_NV_point_sprite(ctx))) && + !_mesa_has_OES_point_sprite(ctx)) goto invalid_enum_error; - CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite); if (ctx->Point.PointSprite == state) return; FLUSH_VERTICES(ctx, _NEW_POINT); @@ -1806,9 +1803,11 @@ _mesa_IsEnabled( GLenum cap ) /* GL_NV_point_sprite */ case GL_POINT_SPRITE_NV: - if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES) + if (!(ctx->API == API_OPENGL_COMPAT && + (_mesa_has_ARB_point_sprite(ctx) || + _mesa_has_NV_point_sprite(ctx))) && + !_mesa_has_OES_point_sprite(ctx)) goto invalid_enum_error; - CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite) return ctx->Point.PointSprite; case GL_VERTEX_PROGRAM_ARB: