Commit 2bae451b authored by Adam Jackson's avatar Adam Jackson 🎧

mesa: Implement GL_ARB_polygon_offset_clamp

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's avatarAdam Jackson <ajax@redhat.com>
Reviewed-by: Ilia Mirkin's avatarIlia Mirkin <imirkin@alum.mit.edu>
parent 00caf2ab
......@@ -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)
......
......@@ -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>
......
......@@ -66,4 +66,13 @@
</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>
......@@ -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;
......
......@@ -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 */
......
......@@ -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)
......
......@@ -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);
......
......@@ -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
......
......@@ -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;
......
......@@ -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 */
/*@{*/
......
......@@ -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 &&
......
......@@ -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 },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment