mesa/main: clean-up extension-checks for point-sprites
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 25 Feb 2019 10:52:59 +0000 (11:52 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 1 Apr 2020 10:57:57 +0000 (12:57 +0200)
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 <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/329>

src/mesa/main/enable.c

index f41f6185796162f35f38d1cfddf864d06ef0b372..e4b6b76cbda3395892890d2f11ce7bfe66f2bdbe 100644 (file)
@@ -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: