mesa/main: correct extension-checks for MESA_tile_raster_order
authorErik Faye-Lund <erik.faye-lund@collabora.com>
Mon, 25 Feb 2019 12:14:50 +0000 (13:14 +0100)
committerErik Faye-Lund <erik.faye-lund@collabora.com>
Wed, 29 May 2019 08:54:09 +0000 (10:54 +0200)
This extension isn't enabled for GLES 1.x, so we shouldn't allow the
state there. Let's use the extension-helpers instead of CHECK_EXTENSION
for this.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/enable.c

index 9a59b775da4afc7ee66d25a8804214e0a596f87a..1b0f7417affe29dead7b770c375b5ded3729bcfa 100644 (file)
@@ -1064,7 +1064,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          break;
 
       case GL_TILE_RASTER_ORDER_FIXED_MESA:
-         CHECK_EXTENSION(MESA_tile_raster_order);
+         if (!_mesa_has_MESA_tile_raster_order(ctx))
+            goto invalid_enum_error;
          if (ctx->TileRasterOrderFixed != state) {
             FLUSH_VERTICES(ctx, 0);
             ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
@@ -1073,7 +1074,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          break;
 
       case GL_TILE_RASTER_ORDER_INCREASING_X_MESA:
-         CHECK_EXTENSION(MESA_tile_raster_order);
+         if (!_mesa_has_MESA_tile_raster_order(ctx))
+            goto invalid_enum_error;
          if (ctx->TileRasterOrderIncreasingX != state) {
             FLUSH_VERTICES(ctx, 0);
             ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
@@ -1082,7 +1084,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          break;
 
       case GL_TILE_RASTER_ORDER_INCREASING_Y_MESA:
-         CHECK_EXTENSION(MESA_tile_raster_order);
+         if (!_mesa_has_MESA_tile_raster_order(ctx))
+            goto invalid_enum_error;
          if (ctx->TileRasterOrderIncreasingY != state) {
             FLUSH_VERTICES(ctx, 0);
             ctx->NewDriverState |= ctx->DriverFlags.NewTileRasterOrder;
@@ -1779,15 +1782,18 @@ _mesa_IsEnabled( GLenum cap )
          return ctx->ConservativeRasterization;
 
       case GL_TILE_RASTER_ORDER_FIXED_MESA:
-         CHECK_EXTENSION(MESA_tile_raster_order);
+         if (!_mesa_has_MESA_tile_raster_order(ctx))
+            goto invalid_enum_error;
          return ctx->TileRasterOrderFixed;
 
       case GL_TILE_RASTER_ORDER_INCREASING_X_MESA:
-         CHECK_EXTENSION(MESA_tile_raster_order);
+         if (!_mesa_has_MESA_tile_raster_order(ctx))
+            goto invalid_enum_error;
          return ctx->TileRasterOrderIncreasingX;
 
       case GL_TILE_RASTER_ORDER_INCREASING_Y_MESA:
-         CHECK_EXTENSION(MESA_tile_raster_order);
+         if (!_mesa_has_MESA_tile_raster_order(ctx))
+            goto invalid_enum_error;
          return ctx->TileRasterOrderIncreasingY;
 
       default: