Mesa (marge_bot_batch_merge_job): mesa: OpenGL 1.4 feature GL_EXT_point_parameters is not optional

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Jan 7 11:20:49 UTC 2022


Module: Mesa
Branch: marge_bot_batch_merge_job
Commit: d36fd459b6d2b508f5976a940e35eb742b5653fc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d36fd459b6d2b508f5976a940e35eb742b5653fc

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Tue Dec 14 17:51:56 2021 -0800

mesa: OpenGL 1.4 feature GL_EXT_point_parameters is not optional

Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14213>

---

 src/mesa/main/attrib.c           | 12 +++++-------
 src/mesa/main/extensions.c       |  1 -
 src/mesa/main/extensions_table.h |  4 ++--
 src/mesa/main/mtypes.h           |  1 -
 src/mesa/main/points.c           | 13 -------------
 src/mesa/main/version.c          |  5 ++---
 src/mesa/program/program_parse.y |  5 -----
 7 files changed, 9 insertions(+), 32 deletions(-)

diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
index 88a56c4c824..1eaaa1e8ece 100644
--- a/src/mesa/main/attrib.c
+++ b/src/mesa/main/attrib.c
@@ -935,13 +935,11 @@ _mesa_PopAttrib(void)
    if (mask & GL_POINT_BIT) {
       TEST_AND_CALL1(Point.Size, PointSize);
       TEST_AND_UPDATE(ctx->Point.SmoothFlag, attr->Point.SmoothFlag, GL_POINT_SMOOTH);
-      if (ctx->Extensions.EXT_point_parameters) {
-         _mesa_PointParameterfv(GL_DISTANCE_ATTENUATION_EXT,
-                                attr->Point.Params);
-         TEST_AND_CALL1_SEL(Point.MinSize, PointParameterf, GL_POINT_SIZE_MIN_EXT);
-         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);
-      }
+      _mesa_PointParameterfv(GL_DISTANCE_ATTENUATION_EXT, attr->Point.Params);
+      TEST_AND_CALL1_SEL(Point.MinSize, PointParameterf, GL_POINT_SIZE_MIN_EXT);
+      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;
diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
index 2ef5e24c599..63333fdb2f3 100644
--- a/src/mesa/main/extensions.c
+++ b/src/mesa/main/extensions.c
@@ -283,7 +283,6 @@ _mesa_init_extensions(struct gl_extensions *extensions)
    extensions->EXT_EGL_image_storage = GL_TRUE;
    extensions->EXT_gpu_program_parameters = GL_TRUE;
    extensions->EXT_pixel_buffer_object = GL_TRUE;
-   extensions->EXT_point_parameters = GL_TRUE;
    extensions->EXT_provoking_vertex = GL_TRUE;
    extensions->EXT_stencil_two_side = GL_TRUE;
    extensions->EXT_texture_env_dot3 = GL_TRUE;
diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h
index 705a9a6f6f9..2af3cd9a6ab 100644
--- a/src/mesa/main/extensions_table.h
+++ b/src/mesa/main/extensions_table.h
@@ -104,7 +104,7 @@ EXT(ARB_occlusion_query2                    , ARB_occlusion_query2
 EXT(ARB_parallel_shader_compile             , dummy_true                             , GLL, GLC,  x ,  x , 2015)
 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                    , EXT_point_parameters                   , GLL,  x ,  x ,  x , 1997)
+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_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)
@@ -267,7 +267,7 @@ EXT(EXT_packed_depth_stencil                , dummy_true
 EXT(EXT_packed_float                        , EXT_packed_float                       , GLL, GLC,  x ,  x , 2004)
 EXT(EXT_packed_pixels                       , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_pixel_buffer_object                 , EXT_pixel_buffer_object                , GLL, GLC,  x ,  x , 2004)
-EXT(EXT_point_parameters                    , EXT_point_parameters                   , GLL,  x ,  x ,  x , 1997)
+EXT(EXT_point_parameters                    , dummy_true                             , GLL,  x ,  x ,  x , 1997)
 EXT(EXT_polygon_offset_clamp                , ARB_polygon_offset_clamp               , GLL, GLC, ES1, ES2, 2014)
 EXT(EXT_primitive_bounding_box              , OES_primitive_bounding_box             ,  x ,  x ,  x ,  31, 2014)
 EXT(EXT_provoking_vertex                    , EXT_provoking_vertex                   , GLL, GLC,  x ,  x , 2009)
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 6f6df54a5d2..5f76f58e641 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4482,7 +4482,6 @@ struct gl_extensions
    GLboolean EXT_multisampled_render_to_texture;
    GLboolean EXT_packed_float;
    GLboolean EXT_pixel_buffer_object;
-   GLboolean EXT_point_parameters;
    GLboolean EXT_provoking_vertex;
    GLboolean EXT_render_snorm;
    GLboolean EXT_semaphore;
diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c
index b76c90d6c86..3734bf01ad9 100644
--- a/src/mesa/main/points.c
+++ b/src/mesa/main/points.c
@@ -111,19 +111,6 @@ _mesa_PointParameterfv( GLenum pname, const GLfloat *params)
 {
    GET_CURRENT_CONTEXT(ctx);
 
-   /* Drivers that support point sprites must also support point parameters.
-    * If point parameters aren't supported, then this function shouldn't even
-    * exist.
-    */
-   assert(!ctx->Extensions.ARB_point_sprite ||
-          ctx->Extensions.EXT_point_parameters);
-
-   if (!ctx->Extensions.EXT_point_parameters) {
-      _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "unsupported function called (unsupported extension)");
-      return;
-   }
-
    switch (pname) {
       case GL_DISTANCE_ATTENUATION_EXT:
          if (TEST_EQ_3V(ctx->Point.Params, params))
diff --git a/src/mesa/main/version.c b/src/mesa/main/version.c
index 235f47f7db2..b35f0903215 100644
--- a/src/mesa/main/version.c
+++ b/src/mesa/main/version.c
@@ -251,8 +251,7 @@ compute_version(const struct gl_extensions *extensions,
 {
    GLuint major, minor, version;
 
-   const bool ver_1_4 = (extensions->ARB_shadow &&
-                         extensions->EXT_point_parameters);
+   const bool ver_1_4 = (extensions->ARB_shadow);
    const bool ver_1_5 = (ver_1_4 &&
                          extensions->ARB_occlusion_query);
    const bool ver_2_0 = (ver_1_5 &&
@@ -484,7 +483,7 @@ compute_version_es1(const struct gl_extensions *extensions)
    /* OpenGL ES 1.0 is derived from OpenGL 1.3, which is always supported.
     * OpenGL ES 1.1 is derived from OpenGL 1.5.
     */
-   const bool ver_1_1 = (extensions->EXT_point_parameters);
+   const bool ver_1_1 = true;
 
    return ver_1_1 ? 11 : 10;
 }
diff --git a/src/mesa/program/program_parse.y b/src/mesa/program/program_parse.y
index a42a988dd8f..96335111e19 100644
--- a/src/mesa/program/program_parse.y
+++ b/src/mesa/program/program_parse.y
@@ -1279,11 +1279,6 @@ stateLightProperty: ambDiffSpecPropertyLight
 	}
 	| ATTENUATION
 	{
-	   if (!state->ctx->Extensions.EXT_point_parameters) {
-	      yyerror(& @1, state, "GL_ARB_point_parameters not supported");
-	      YYERROR;
-	   }
-
 	   $$ = STATE_ATTENUATION;
 	}
 	| SPOT stateSpotProperty



More information about the mesa-commit mailing list