mesa: Implement GL_ARB_polygon_offset_clamp
authorAdam Jackson <ajax@redhat.com>
Thu, 24 Aug 2017 21:00:43 +0000 (17:00 -0400)
committerAdam Jackson <ajax@redhat.com>
Fri, 25 Aug 2017 16:38:14 +0000 (12:38 -0400)
Semantically identical to the EXT version (whose string is still valid
for GLES), so rename the bit but expose both extension strings.
(Suggested by Ilia Mirkin and Ian Romanick.)

v3: Fix the entrypoint alias in GL4x.xml (Ilia)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
12 files changed:
docs/features.txt
docs/relnotes/17.3.0.html
src/mapi/glapi/gen/GL4x.xml
src/mesa/drivers/dri/i965/intel_extensions.c
src/mesa/main/dlist.c
src/mesa/main/extensions_table.h
src/mesa/main/get.c
src/mesa/main/get_hash_params.py
src/mesa/main/mtypes.h
src/mesa/main/polygon.c
src/mesa/main/version.c
src/mesa/state_tracker/st_extensions.c

index 3f91c2daaea508358e57ecbc66b49db0970dbaa3..0435ce61ff55c2f892fd933a6dccba11eee1c1ad 100644 (file)
@@ -226,7 +226,7 @@ GL 4.6, GLSL 4.60
   GL_ARB_gl_spirv                                       in progress (Nicolai Hähnle, Ian Romanick)
   GL_ARB_indirect_parameters                            DONE (nvc0, radeonsi)
   GL_ARB_pipeline_statistics_query                      DONE (i965, nvc0, radeonsi, softpipe, swr)
-  GL_ARB_polygon_offset_clamp                           not started
+  GL_ARB_polygon_offset_clamp                           DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, swr)
   GL_ARB_shader_atomic_counter_ops                      DONE (i965/gen7+, nvc0, radeonsi, softpipe)
   GL_ARB_shader_draw_parameters                         DONE (i965, nvc0, radeonsi)
   GL_ARB_shader_group_vote                              DONE (i965, nvc0, radeonsi)
index 8da43f22f02fa30f0cd3daf78b4b672af4119594..4a74284632e1b3560ae68f596a01452186193e31 100644 (file)
@@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers.
 </p>
 
 <ul>
+<li>GL_ARB_polygon_offset_clamp on i965, nv50, nvc0, r600, radeonsi, llvmpipe, swr</li>
 <li>GL_ARB_transform_feedback_overflow_query on radeonsi</li>
 <li>GL_ARB_texture_filter_anisotropic on i965, nv50, nvc0, r600, radeonsi</li>
 <li>GL_EXT_memory_object on radeonsi</li>
index e958ee70c715d1006d49cd28184b20fba0427fe8..88dba5cd71a36944685b3386c8e5d7317f0dde9b 100644 (file)
   </function>
 </category>
 
+<category name="4.6">
+  <function name="PolygonOffsetClamp" alias="PolygonOffsetClampEXT">
+    <param name="factor" type="GLfloat"/>
+    <param name="units" type="GLfloat"/>
+    <param name="clamp" type="GLfloat"/>
+  </function>
+  <enum name="POLYGON_OFFSET_CLAMP" value="0x8E1B"/>
+</category>
+
 </OpenGLAPI>
index c3cd8004a1243ec529e597d47cca656ab66c7452..deacd0d9dfcf4a7091f5d631039b24c301942106 100644 (file)
@@ -66,6 +66,7 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.ARB_occlusion_query = true;
    ctx->Extensions.ARB_occlusion_query2 = true;
    ctx->Extensions.ARB_point_sprite = true;
+   ctx->Extensions.ARB_polygon_offset_clamp = true;
    ctx->Extensions.ARB_seamless_cube_map = true;
    ctx->Extensions.ARB_shader_bit_encoding = true;
    ctx->Extensions.ARB_shader_draw_parameters = true;
@@ -100,7 +101,6 @@ intelInitExtensions(struct gl_context *ctx)
    ctx->Extensions.EXT_packed_float = true;
    ctx->Extensions.EXT_pixel_buffer_object = true;
    ctx->Extensions.EXT_point_parameters = true;
-   ctx->Extensions.EXT_polygon_offset_clamp = true;
    ctx->Extensions.EXT_provoking_vertex = true;
    ctx->Extensions.EXT_stencil_two_side = true;
    ctx->Extensions.EXT_texture_array = true;
index 208471aca73c94a2b1e2072b88e3bb280d308830..b7d1406eb748eec7b7d7b78a2b636736f231e9fa 100644 (file)
@@ -10062,7 +10062,7 @@ _mesa_initialize_save_table(const struct gl_context *ctx)
    SET_ProgramUniformMatrix3x4fv(table, save_ProgramUniformMatrix3x4fv);
    SET_ProgramUniformMatrix4x3fv(table, save_ProgramUniformMatrix4x3fv);
 
-   /* GL_EXT_polygon_offset_clamp */
+   /* GL_{ARB,EXT}_polygon_offset_clamp */
    SET_PolygonOffsetClampEXT(table, save_PolygonOffsetClampEXT);
 
    /* GL_EXT_window_rectangles */
index d096260891c40c935af4c696d5e0b9b5cfd14f75..9475c1b69d9464339525ba0ce4e5f727db780171 100644 (file)
@@ -94,6 +94,7 @@ EXT(ARB_pipeline_statistics_query           , ARB_pipeline_statistics_query
 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_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                ,  x , GLC,  x ,  x,  2015)
 EXT(ARB_program_interface_query             , dummy_true                             , GLL, GLC,  x ,  x , 2012)
 EXT(ARB_provoking_vertex                    , EXT_provoking_vertex                   , GLL, GLC,  x ,  x , 2009)
@@ -236,7 +237,7 @@ EXT(EXT_packed_pixels                       , dummy_true
 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_polygon_offset                      , dummy_true                             , GLL,  x ,  x ,  x , 1995)
-EXT(EXT_polygon_offset_clamp                , EXT_polygon_offset_clamp               , GLL, GLC, ES1, ES2, 2014)
+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)
 EXT(EXT_read_format_bgra                    , dummy_true                             ,  x ,  x , ES1, ES2, 2009)
index 8c3958b09654904b3640f3d8c5a1549177151a3d..4c4a4a79c078449ec650e46d2bdc049630d03809 100644 (file)
@@ -489,7 +489,7 @@ EXTRA_EXT2(ARB_transform_feedback3, ARB_gpu_shader5);
 EXTRA_EXT(INTEL_performance_query);
 EXTRA_EXT(ARB_explicit_uniform_location);
 EXTRA_EXT(ARB_clip_control);
-EXTRA_EXT(EXT_polygon_offset_clamp);
+EXTRA_EXT(ARB_polygon_offset_clamp);
 EXTRA_EXT(ARB_framebuffer_no_attachments);
 EXTRA_EXT(ARB_tessellation_shader);
 EXTRA_EXT(ARB_shader_storage_buffer_object);
index 9d67ca49f8ef299fb969b69b9191f9fdba2fd55d..acd5cd1f0119c8325b5ed29a51d6dd1b5bda3988 100644 (file)
@@ -136,8 +136,8 @@ descriptor=[
   [ "MAX_DEBUG_GROUP_STACK_DEPTH", "CONST(MAX_DEBUG_GROUP_STACK_DEPTH), NO_EXTRA" ],
   [ "DEBUG_GROUP_STACK_DEPTH", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
 
-# GL_EXT_polygon_offset_clamp
-  [ "POLYGON_OFFSET_CLAMP_EXT", "CONTEXT_FLOAT(Polygon.OffsetClamp), extra_EXT_polygon_offset_clamp" ],
+# GL_ARB_polygon_offset_clamp / GL_EXT_polygon_offset_clamp
+  [ "POLYGON_OFFSET_CLAMP_EXT", "CONTEXT_FLOAT(Polygon.OffsetClamp), extra_ARB_polygon_offset_clamp" ],
 ]},
 
 # Enums in OpenGL and GLES1
index 99b6dfa611302bd8fc96af96813944f84cd880c4..19135673dcb631c43b3636d6cff37e3c4ebcd858 100644 (file)
@@ -4055,6 +4055,7 @@ struct gl_extensions
    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;
    GLboolean ARB_robust_buffer_access_behavior;
@@ -4133,7 +4134,6 @@ struct gl_extensions
    GLboolean EXT_packed_float;
    GLboolean EXT_pixel_buffer_object;
    GLboolean EXT_point_parameters;
-   GLboolean EXT_polygon_offset_clamp;
    GLboolean EXT_provoking_vertex;
    GLboolean EXT_shader_integer_mix;
    GLboolean EXT_shader_samples_identical;
index 44d943e930b7d08ee1ae9837988dcb1b956b060d..effd4d27fbd9957902fd4b25550f391e5e465553 100644 (file)
@@ -328,7 +328,6 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
    _mesa_polygon_offset_clamp(ctx, factor, units, 0.0);
 }
 
-
 void GLAPIENTRY
 _mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias )
 {
@@ -342,20 +341,18 @@ _mesa_PolygonOffsetClampEXT( GLfloat factor, GLfloat units, GLfloat clamp )
 {
    GET_CURRENT_CONTEXT(ctx);
 
-   if (!ctx->Extensions.EXT_polygon_offset_clamp) {
+   if (!ctx->Extensions.ARB_polygon_offset_clamp) {
       _mesa_error(ctx, GL_INVALID_OPERATION,
-                  "unsupported function (glPolygonOffsetClampEXT) called");
+                  "unsupported function (%s) called", "glPolygonOffsetClamp");
       return;
    }
 
    if (MESA_VERBOSE&VERBOSE_API)
-      _mesa_debug(ctx, "glPolygonOffsetClampEXT %f %f %f\n", factor, units, clamp);
+      _mesa_debug(ctx, "glPolygonOffsetClamp %f %f %f\n", factor, units, clamp);
 
    _mesa_polygon_offset_clamp(ctx, factor, units, clamp);
 }
 
-
-
 /**********************************************************************/
 /** \name Initialization */
 /*@{*/
index 59e7b89ff6ed2257684135a6d3e00c8849ed9a82..90c5c5f84e0a265ef80208b829fc8d232adb6b1b 100644 (file)
@@ -391,7 +391,7 @@ compute_version(const struct gl_extensions *extensions,
                          /* extensions->ARB_spirv_extensions */ 0 &&
                          extensions->ARB_indirect_parameters &&
                          extensions->ARB_pipeline_statistics_query &&
-                         /* extensions->ARB_polygon_offset_clamp */ 0 &&
+                         extensions->ARB_polygon_offset_clamp &&
                          extensions->ARB_shader_atomic_counter_ops &&
                          extensions->ARB_shader_draw_parameters &&
                          extensions->ARB_shader_group_vote &&
index 9a22e54675c2d4d31d069839bc54ba12dd676904..87859032512a061018e038c06ab0d65e310181af 100644 (file)
@@ -601,6 +601,7 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(ARB_occlusion_query2),             PIPE_CAP_OCCLUSION_QUERY                  },
       { o(ARB_pipeline_statistics_query),    PIPE_CAP_QUERY_PIPELINE_STATISTICS        },
       { o(ARB_point_sprite),                 PIPE_CAP_POINT_SPRITE                     },
+      { o(ARB_polygon_offset_clamp),         PIPE_CAP_POLYGON_OFFSET_CLAMP             },
       { o(ARB_post_depth_coverage),          PIPE_CAP_POST_DEPTH_COVERAGE              },
       { o(ARB_query_buffer_object),          PIPE_CAP_QUERY_BUFFER_OBJECT              },
       { o(ARB_robust_buffer_access_behavior), PIPE_CAP_ROBUST_BUFFER_ACCESS_BEHAVIOR   },
@@ -633,7 +634,6 @@ void st_init_extensions(struct pipe_screen *screen,
       { o(EXT_blend_equation_separate),      PIPE_CAP_BLEND_EQUATION_SEPARATE          },
       { o(EXT_depth_bounds_test),            PIPE_CAP_DEPTH_BOUNDS_TEST                },
       { o(EXT_draw_buffers2),                PIPE_CAP_INDEP_BLEND_ENABLE               },
-      { o(EXT_polygon_offset_clamp),         PIPE_CAP_POLYGON_OFFSET_CLAMP             },
       { o(EXT_memory_object),                PIPE_CAP_MEMOBJ                           },
       { o(EXT_memory_object_fd),             PIPE_CAP_MEMOBJ                           },
       { o(EXT_stencil_two_side),             PIPE_CAP_TWO_SIDED_STENCIL                },