From 8255739a0a5a578811584564a18dda2b5db5aa47 Mon Sep 17 00:00:00 2001 From: Erik Faye-Lund Date: Wed, 12 Oct 2022 13:09:08 +0200 Subject: [PATCH] mesa/main: remove driver-cap for ARB_point_sprite It's always supported, no need for checks here. Reviewed-By: Mike Blumenkrantz Begrudgingly-reviewed-by: Alyssa Rosenzweig Part-of: --- src/mesa/main/attrib.c | 26 +++++++++++--------------- src/mesa/main/consts_exts.h | 1 - src/mesa/main/extensions_table.h | 4 ++-- src/mesa/main/get.c | 1 - src/mesa/main/get_hash_params.py | 4 ++-- src/mesa/main/texenv.c | 15 --------------- src/mesa/main/version.c | 1 - src/mesa/state_tracker/st_extensions.c | 2 -- 8 files changed, 15 insertions(+), 39 deletions(-) diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c index b69edd7375d..d0606fb3b95 100644 --- a/src/mesa/main/attrib.c +++ b/src/mesa/main/attrib.c @@ -423,10 +423,8 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib_node *ena GL_RASTER_POSITION_UNCLIPPED_IBM); TEST_AND_UPDATE(ctx->Point.SmoothFlag, enable->PointSmooth, GL_POINT_SMOOTH); - if (ctx->Extensions.ARB_point_sprite) { - TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite, - GL_POINT_SPRITE); - } + TEST_AND_UPDATE(ctx->Point.PointSprite, enable->PointSprite, + GL_POINT_SPRITE); TEST_AND_UPDATE(ctx->Polygon.OffsetPoint, enable->PolygonOffsetPoint, GL_POLYGON_OFFSET_POINT); TEST_AND_UPDATE(ctx->Polygon.OffsetLine, enable->PolygonOffsetLine, @@ -939,18 +937,16 @@ _mesa_PopAttrib(void) TEST_AND_CALL1_SEL(Point.MaxSize, PointParameterf, GL_POINT_SIZE_MAX_EXT); TEST_AND_CALL1_SEL(Point.Threshold, PointParameterf, GL_POINT_FADE_THRESHOLD_SIZE_EXT); - if (ctx->Extensions.ARB_point_sprite) { - if (ctx->Point.CoordReplace != attr->Point.CoordReplace) { - ctx->NewState |= _NEW_POINT | _NEW_FF_VERT_PROGRAM; - ctx->Point.CoordReplace = attr->Point.CoordReplace; - } - TEST_AND_UPDATE(ctx->Point.PointSprite, attr->Point.PointSprite, - GL_POINT_SPRITE); - - if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20) - || ctx->API == API_OPENGL_CORE) - TEST_AND_CALL1_SEL(Point.SpriteOrigin, PointParameterf, GL_POINT_SPRITE_COORD_ORIGIN); + if (ctx->Point.CoordReplace != attr->Point.CoordReplace) { + ctx->NewState |= _NEW_POINT | _NEW_FF_VERT_PROGRAM; + ctx->Point.CoordReplace = attr->Point.CoordReplace; } + TEST_AND_UPDATE(ctx->Point.PointSprite, attr->Point.PointSprite, + GL_POINT_SPRITE); + + if ((ctx->API == API_OPENGL_COMPAT && ctx->Version >= 20) + || ctx->API == API_OPENGL_CORE) + TEST_AND_CALL1_SEL(Point.SpriteOrigin, PointParameterf, GL_POINT_SPRITE_COORD_ORIGIN); } if (mask & GL_POLYGON_BIT) { diff --git a/src/mesa/main/consts_exts.h b/src/mesa/main/consts_exts.h index 243020b3237..603fd10df39 100644 --- a/src/mesa/main/consts_exts.h +++ b/src/mesa/main/consts_exts.h @@ -97,7 +97,6 @@ struct gl_extensions GLboolean ARB_occlusion_query; GLboolean ARB_occlusion_query2; GLboolean ARB_pipeline_statistics_query; - GLboolean ARB_point_sprite; GLboolean ARB_polygon_offset_clamp; GLboolean ARB_post_depth_coverage; GLboolean ARB_query_buffer_object; diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index cd501439473..0d2851e0a5a 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -104,7 +104,7 @@ EXT(ARB_parallel_shader_compile , dummy_true EXT(ARB_pipeline_statistics_query , ARB_pipeline_statistics_query , GLL, GLC, x , x , 2014) EXT(ARB_pixel_buffer_object , EXT_pixel_buffer_object , GLL, GLC, x , x , 2004) EXT(ARB_point_parameters , dummy_true , GLL, x , x , x , 1997) -EXT(ARB_point_sprite , ARB_point_sprite , GLL, GLC, x , x , 2003) +EXT(ARB_point_sprite , dummy_true , GLL, GLC, x , x , 2003) EXT(ARB_polygon_offset_clamp , ARB_polygon_offset_clamp , GLL, GLC, x , x , 2017) EXT(ARB_post_depth_coverage , ARB_post_depth_coverage , GLL, GLC, x , x, 2015) EXT(ARB_program_interface_query , dummy_true , GLL, GLC, x , x , 2012) @@ -454,7 +454,7 @@ EXT(OES_gpu_shader5 , ARB_gpu_shader5 EXT(OES_mapbuffer , dummy_true , x , x , ES1, ES2, 2005) EXT(OES_packed_depth_stencil , dummy_true , x , x , ES1, ES2, 2007) EXT(OES_point_size_array , dummy_true , x , x , ES1, x , 2004) -EXT(OES_point_sprite , ARB_point_sprite , x , x , ES1, x , 2004) +EXT(OES_point_sprite , dummy_true , x , x , ES1, x , 2004) EXT(OES_primitive_bounding_box , OES_primitive_bounding_box , x , x , x , 31, 2014) EXT(OES_query_matrix , dummy_true , x , x , ES1, x , 2003) EXT(OES_read_format , dummy_true , GLL, x , ES1, x , 2003) diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 6d6a0f864f4..bcd18d0549f 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -544,7 +544,6 @@ EXTRA_EXT(EXT_transform_feedback); EXTRA_EXT(ARB_transform_feedback3); EXTRA_EXT(EXT_pixel_buffer_object); EXTRA_EXT(ARB_vertex_program); -EXTRA_EXT(ARB_point_sprite); EXTRA_EXT2(ARB_vertex_program, ARB_fragment_program); EXTRA_EXT(ARB_color_buffer_float); EXTRA_EXT(EXT_framebuffer_sRGB); diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index ed0b99e1113..e1ee26e0847 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -251,7 +251,7 @@ descriptor=[ [ "TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB", "LOC_CUSTOM, TYPE_INT, NO_OFFSET, NO_EXTRA" ], # GL_OES_point_sprite - [ "POINT_SPRITE", "CONTEXT_BOOL(Point.PointSprite), extra_ARB_point_sprite" ], + [ "POINT_SPRITE", "CONTEXT_BOOL(Point.PointSprite), NO_EXTRA" ], ]}, @@ -875,7 +875,7 @@ descriptor=[ [ "RASTER_POSITION_UNCLIPPED_IBM", "CONTEXT_BOOL(Transform.RasterPositionUnclipped), NO_EXTRA" ], # GL_ARB_point_sprite - [ "POINT_SPRITE_COORD_ORIGIN", "CONTEXT_ENUM16(Point.SpriteOrigin), extra_ARB_point_sprite" ], + [ "POINT_SPRITE_COORD_ORIGIN", "CONTEXT_ENUM16(Point.SpriteOrigin), NO_EXTRA" ], # GL_NV_texture_rectangle [ "TEXTURE_RECTANGLE_NV", "LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_NV_texture_rectangle" ], diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index f6401dd8dcc..3026e80ae4f 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -462,11 +462,6 @@ _mesa_texenvfv_indexed( struct gl_context* ctx, GLuint texunit, GLenum target, } } else if (target == GL_POINT_SPRITE) { - /* GL_ARB_point_sprite */ - if (!ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glTexEnv(target=0x%x)", target ); - return; - } if (pname == GL_COORD_REPLACE) { /* It's kind of weird to set point state via glTexEnv, * but that's what the spec calls for. @@ -745,11 +740,6 @@ _mesa_gettexenvfv_indexed( GLuint texunit, GLenum target, GLenum pname, GLfloat } } else if (target == GL_POINT_SPRITE) { - /* GL_ARB_point_sprite */ - if (!ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); - return; - } if (pname == GL_COORD_REPLACE) { if (ctx->Point.CoordReplace & (1u << texunit)) *params = 1.0f; @@ -821,11 +811,6 @@ _mesa_gettexenviv_indexed( GLuint texunit, GLenum target, } } else if (target == GL_POINT_SPRITE) { - /* GL_ARB_point_sprite */ - if (!ctx->Extensions.ARB_point_sprite) { - _mesa_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); - return; - } if (pname == GL_COORD_REPLACE) { if (ctx->Point.CoordReplace & (1u << texunit)) *params = GL_TRUE; diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c index 8b72b08c223..a564b8cf1f9 100644 --- a/src/mesa/main/version.c +++ b/src/mesa/main/version.c @@ -255,7 +255,6 @@ compute_version(const struct gl_extensions *extensions, const bool ver_1_5 = (ver_1_4 && extensions->ARB_occlusion_query); const bool ver_2_0 = (ver_1_5 && - extensions->ARB_point_sprite && extensions->ARB_vertex_shader && extensions->ARB_fragment_shader && extensions->ARB_texture_non_power_of_two && diff --git a/src/mesa/state_tracker/st_extensions.c b/src/mesa/state_tracker/st_extensions.c index 595e6ec5229..7e22cec7895 100644 --- a/src/mesa/state_tracker/st_extensions.c +++ b/src/mesa/state_tracker/st_extensions.c @@ -1845,6 +1845,4 @@ void st_init_extensions(struct pipe_screen *screen, screen->get_param(screen, PIPE_CAP_DOUBLES) && !(nir_options->lower_doubles_options & nir_lower_fp64_full_software)) extensions->NV_copy_depth_to_color = TRUE; - - extensions->ARB_point_sprite = GL_TRUE; }