From a33ff7876fa5e9c7b564791734bf47534225df13 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Mon, 25 Feb 2019 13:14:50 +0100 Subject: [PATCH] mesa/main: correct extension-checks for MESA_tile_raster_order 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 Reviewed-by: Ian Romanick --- src/mesa/main/enable.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c index 9a59b775da4..1b0f7417aff 100644 --- a/src/mesa/main/enable.c +++ b/src/mesa/main/enable.c @@ -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: -- 2.30.2