[Mesa-dev] [PATCH v2 09/12] mesa: glGet: rename *{_EXT, _ARB} enums missing from the XML spec

Ian Romanick idr at freedesktop.org
Mon Sep 10 04:41:53 PDT 2012


On 09/10/2012 10:51 AM, Imre Deak wrote:
> On Mon, 2012-09-10 at 10:12 +0300, Ian Romanick wrote:
>> On 09/10/2012 09:41 AM, Imre Deak wrote:
>>> The following enums used to be extensions but later became part of the
>>> core specification. The _EXT/_ARB versions of these are not present in
>>> in the current XML spec files, only defined in GL/glext.h
>>>
>>> Later we'll need to look up these in a python script using the XML spec.
>>> As a preparation for that remove the _EXT,_ARB suffix from these enums
>>> and rename GL_DISTANCE_ATTENUATION_EXT to GL_POINT_DISTANCE_ATTENUATION.
>>> Naturally, all enums keep their numerical values.
>>
>> I'm not opposed to this change, but there are a couple potential
>> problems.  First, as I noted in patch 08/12, at least one of the names
>> you rely on does not exist.
>
> Yes, POLYGON_OFFSET_BIAS, but I think this is because the XML spec is
> incorrect.
>
>> Second, this may not continue to work going
>> forward.  What happens when we add support for GL_FOO_ARB and 6 months
>> later GL_FOO becomes part of core?
>
> Isn't at this point the XML spec updated to include GL_FOO_ARB?
> Otherwise things like _mesa_lookup_enum_by_name() wouldn't find either
> the new enum.

Okay, I see what's going on.  This shouldn't be a problem then.

>> Do we have to update this file?
>> This can lead to a lot of unnecessary churn in the code.
>
> Agreed, but only if in the above scenario the XML spec is not updated.
>
> --Imre
>
>>
>>>
>>> GL_BLEND_DST_ALPHA_EXT
>>> GL_BLEND_DST_RGB_EXT
>>> GL_BLEND_SRC_ALPHA_EXT
>>> GL_BLEND_SRC_RGB_EXT
>>> GL_COLOR_SUM_EXT
>>> GL_COMPRESSED_TEXTURE_FORMATS_ARB
>>> GL_CURRENT_FOG_COORDINATE_EXT
>>> GL_CURRENT_SECONDARY_COLOR_EXT
>>> GL_DISTANCE_ATTENUATION_EXT
>>> GL_FOG_COORDINATE_ARRAY_EXT
>>> GL_FOG_COORDINATE_ARRAY_STRIDE_EXT
>>> GL_FOG_COORDINATE_ARRAY_TYPE_EXT
>>> GL_FOG_COORDINATE_SOURCE_EXT
>>> GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB
>>> GL_PACK_IMAGE_HEIGHT_EXT
>>> GL_PACK_SKIP_IMAGES_EXT
>>> GL_POLYGON_OFFSET_BIAS_EXT
>>> GL_SECONDARY_COLOR_ARRAY_EXT
>>> GL_SECONDARY_COLOR_ARRAY_SIZE_EXT
>>> GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT
>>> GL_SECONDARY_COLOR_ARRAY_TYPE_EXT
>>> GL_UNPACK_IMAGE_HEIGHT_EXT
>>> GL_UNPACK_SKIP_IMAGES_EXT
>>>
>>> Signed-off-by: Imre Deak <imre.deak at intel.com>
>>> ---
>>>    src/mesa/main/get.c |   46 +++++++++++++++++++++++-----------------------
>>>    1 file changed, 23 insertions(+), 23 deletions(-)
>>>
>>> diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c
>>> index 48c6911..2e154bf 100644
>>> --- a/src/mesa/main/get.c
>>> +++ b/src/mesa/main/get.c
>>> @@ -471,10 +471,10 @@ static const struct value_desc values[] = {
>>>         extra_ARB_texture_cube_map }, /* XXX: OES_texture_cube_map */
>>>
>>>       /* XXX: OES_blend_subtract */
>>> -   { GL_BLEND_SRC_RGB_EXT, CONTEXT_ENUM(Color.Blend[0].SrcRGB), NO_EXTRA },
>>> -   { GL_BLEND_DST_RGB_EXT, CONTEXT_ENUM(Color.Blend[0].DstRGB), NO_EXTRA },
>>> -   { GL_BLEND_SRC_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].SrcA), NO_EXTRA },
>>> -   { GL_BLEND_DST_ALPHA_EXT, CONTEXT_ENUM(Color.Blend[0].DstA), NO_EXTRA },
>>> +   { GL_BLEND_SRC_RGB, CONTEXT_ENUM(Color.Blend[0].SrcRGB), NO_EXTRA },
>>> +   { GL_BLEND_DST_RGB, CONTEXT_ENUM(Color.Blend[0].DstRGB), NO_EXTRA },
>>> +   { GL_BLEND_SRC_ALPHA, CONTEXT_ENUM(Color.Blend[0].SrcA), NO_EXTRA },
>>> +   { GL_BLEND_DST_ALPHA, CONTEXT_ENUM(Color.Blend[0].DstA), NO_EXTRA },
>>>
>>>       /* GL_BLEND_EQUATION_RGB, which is what we're really after, is
>>>        * defined identically to GL_BLEND_EQUATION. */
>>> @@ -483,7 +483,7 @@ static const struct value_desc values[] = {
>>>
>>>       /* GL_ARB_texture_compression */
>>>       { GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA },
>>> -   { GL_COMPRESSED_TEXTURE_FORMATS_ARB, LOC_CUSTOM, TYPE_INT_N, 0, NO_EXTRA },
>>> +   { GL_COMPRESSED_TEXTURE_FORMATS, LOC_CUSTOM, TYPE_INT_N, 0, NO_EXTRA },
>>>
>>>       /* GL_ARB_multisample */
>>>       { GL_SAMPLE_ALPHA_TO_COVERAGE_ARB,
>>> @@ -573,7 +573,7 @@ static const struct value_desc values[] = {
>>>         extra_flush_current },
>>>       { GL_CURRENT_TEXTURE_COORDS, LOC_CUSTOM, TYPE_FLOAT_4, 0,
>>>         extra_flush_current_valid_texture_unit },
>>> -   { GL_DISTANCE_ATTENUATION_EXT, CONTEXT_FLOAT3(Point.Params[0]), NO_EXTRA },
>>> +   { GL_POINT_DISTANCE_ATTENUATION, CONTEXT_FLOAT3(Point.Params[0]), NO_EXTRA },
>>>       { GL_FOG, CONTEXT_BOOL(Fog.Enabled), NO_EXTRA },
>>>       { GL_FOG_COLOR, LOC_CUSTOM, TYPE_FLOATN_4, 0, extra_new_frag_clamp },
>>>       { GL_FOG_DENSITY, CONTEXT_FLOAT(Fog.Density), NO_EXTRA },
>>> @@ -594,7 +594,7 @@ static const struct value_desc values[] = {
>>>       { GL_MODELVIEW_STACK_DEPTH, LOC_CUSTOM, TYPE_INT,
>>>         offsetof(struct gl_context, ModelviewMatrixStack.Depth), NO_EXTRA },
>>>       { GL_NORMALIZE, CONTEXT_BOOL(Transform.Normalize), NO_EXTRA },
>>> -   { GL_PACK_SKIP_IMAGES_EXT, CONTEXT_INT(Pack.SkipImages), NO_EXTRA },
>>> +   { GL_PACK_SKIP_IMAGES, CONTEXT_INT(Pack.SkipImages), NO_EXTRA },
>>>       { GL_PERSPECTIVE_CORRECTION_HINT, CONTEXT_ENUM(Hint.PerspectiveCorrection), NO_EXTRA },
>>>       { GL_POINT_SIZE, CONTEXT_FLOAT(Point.Size), NO_EXTRA },
>>>       { GL_POINT_SIZE_RANGE, CONTEXT_FLOAT2(Const.MinPointSizeAA), NO_EXTRA },
>>> @@ -711,15 +711,15 @@ static const struct value_desc values[] = {
>>>       { GL_MAX_TEXTURE_COORDS_ARB, /* == GL_MAX_TEXTURE_COORDS_NV */
>>>         CONTEXT_INT(Const.MaxTextureCoordUnits),
>>>         extra_ARB_fragment_program_NV_fragment_program },
>>> -   { GL_PACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Pack.ImageHeight), NO_EXTRA },
>>> +   { GL_PACK_IMAGE_HEIGHT, CONTEXT_INT(Pack.ImageHeight), NO_EXTRA },
>>>       { GL_PACK_ROW_LENGTH, CONTEXT_INT(Pack.RowLength), NO_EXTRA },
>>>       { GL_PACK_SKIP_PIXELS, CONTEXT_INT(Pack.SkipPixels), NO_EXTRA },
>>>       { GL_PACK_SKIP_ROWS, CONTEXT_INT(Pack.SkipRows), NO_EXTRA },
>>>       { GL_UNPACK_ROW_LENGTH, CONTEXT_INT(Unpack.RowLength), NO_EXTRA },
>>>       { GL_UNPACK_SKIP_PIXELS, CONTEXT_INT(Unpack.SkipPixels), NO_EXTRA },
>>>       { GL_UNPACK_SKIP_ROWS, CONTEXT_INT(Unpack.SkipRows), NO_EXTRA },
>>> -   { GL_UNPACK_SKIP_IMAGES_EXT, CONTEXT_INT(Unpack.SkipImages), NO_EXTRA },
>>> -   { GL_UNPACK_IMAGE_HEIGHT_EXT, CONTEXT_INT(Unpack.ImageHeight), NO_EXTRA },
>>> +   { GL_UNPACK_SKIP_IMAGES, CONTEXT_INT(Unpack.SkipImages), NO_EXTRA },
>>> +   { GL_UNPACK_IMAGE_HEIGHT, CONTEXT_INT(Unpack.ImageHeight), NO_EXTRA },
>>>
>>>       /* GL_ARB_draw_buffers */
>>>       { GL_MAX_DRAW_BUFFERS_ARB, CONTEXT_INT(Const.MaxDrawBuffers), NO_EXTRA },
>>> @@ -780,7 +780,7 @@ static const struct value_desc values[] = {
>>>         offsetof(struct gl_context, Const.Max3DTextureLevels), NO_EXTRA },
>>>
>>>       /* GL_ARB_fragment_program/OES_standard_derivatives */
>>> -   { GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB,
>>> +   { GL_FRAGMENT_SHADER_DERIVATIVE_HINT,
>>>         CONTEXT_ENUM(Hint.FragmentShaderDerivative), extra_ARB_fragment_shader },
>>>
>>>       /* GL_NV_read_buffer */
>>> @@ -914,7 +914,7 @@ static const struct value_desc values[] = {
>>>       { GL_PIXEL_MAP_S_TO_S_SIZE, CONTEXT_INT(PixelMaps.StoS.Size), NO_EXTRA },
>>>       { GL_POINT_SIZE_GRANULARITY, CONTEXT_FLOAT(Const.PointSizeGranularity), NO_EXTRA },
>>>       { GL_POLYGON_MODE, CONTEXT_ENUM2(Polygon.FrontMode), NO_EXTRA },
>>> -   { GL_POLYGON_OFFSET_BIAS_EXT, CONTEXT_FLOAT(Polygon.OffsetUnits), NO_EXTRA },
>>> +   { GL_POLYGON_OFFSET_BIAS, CONTEXT_FLOAT(Polygon.OffsetUnits), NO_EXTRA },
>>>       { GL_POLYGON_OFFSET_POINT, CONTEXT_BOOL(Polygon.OffsetPoint), NO_EXTRA },
>>>       { GL_POLYGON_OFFSET_LINE, CONTEXT_BOOL(Polygon.OffsetLine), NO_EXTRA },
>>>       { GL_POLYGON_SMOOTH, CONTEXT_BOOL(Polygon.SmoothFlag), NO_EXTRA },
>>> @@ -984,31 +984,31 @@ static const struct value_desc values[] = {
>>>       { GL_TRANSPOSE_TEXTURE_MATRIX_ARB, CONTEXT_MATRIX_T(TextureMatrixStack), NO_EXTRA },
>>>
>>>       /* GL_EXT_secondary_color */
>>> -   { GL_COLOR_SUM_EXT, CONTEXT_BOOL(Fog.ColorSumEnabled),
>>> +   { GL_COLOR_SUM, CONTEXT_BOOL(Fog.ColorSumEnabled),
>>>         extra_EXT_secondary_color_ARB_vertex_program },
>>> -   { GL_CURRENT_SECONDARY_COLOR_EXT,
>>> +   { GL_CURRENT_SECONDARY_COLOR,
>>>         CONTEXT_FIELD(Current.Attrib[VERT_ATTRIB_COLOR1][0], TYPE_FLOATN_4),
>>>         extra_EXT_secondary_color_flush_current },
>>> -   { GL_SECONDARY_COLOR_ARRAY_EXT, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR1].Enabled),
>>> +   { GL_SECONDARY_COLOR_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR1].Enabled),
>>>         extra_EXT_secondary_color },
>>> -   { GL_SECONDARY_COLOR_ARRAY_TYPE_EXT, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR1].Type),
>>> +   { GL_SECONDARY_COLOR_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR1].Type),
>>>         extra_EXT_secondary_color },
>>> -   { GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride),
>>> +   { GL_SECONDARY_COLOR_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride),
>>>         extra_EXT_secondary_color },
>>> -   { GL_SECONDARY_COLOR_ARRAY_SIZE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Size),
>>> +   { GL_SECONDARY_COLOR_ARRAY_SIZE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Size),
>>>         extra_EXT_secondary_color },
>>>
>>>       /* GL_EXT_fog_coord */
>>> -   { GL_CURRENT_FOG_COORDINATE_EXT,
>>> +   { GL_CURRENT_FOG_COORDINATE,
>>>         CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]),
>>>         extra_EXT_fog_coord_flush_current },
>>> -   { GL_FOG_COORDINATE_ARRAY_EXT, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_FOG].Enabled),
>>> +   { GL_FOG_COORDINATE_ARRAY, ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_FOG].Enabled),
>>>         extra_EXT_fog_coord },
>>> -   { GL_FOG_COORDINATE_ARRAY_TYPE_EXT, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_FOG].Type),
>>> +   { GL_FOG_COORDINATE_ARRAY_TYPE, ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_FOG].Type),
>>>         extra_EXT_fog_coord },
>>> -   { GL_FOG_COORDINATE_ARRAY_STRIDE_EXT, ARRAY_INT(VertexAttrib[VERT_ATTRIB_FOG].Stride),
>>> +   { GL_FOG_COORDINATE_ARRAY_STRIDE, ARRAY_INT(VertexAttrib[VERT_ATTRIB_FOG].Stride),
>>>         extra_EXT_fog_coord },
>>> -   { GL_FOG_COORDINATE_SOURCE_EXT, CONTEXT_ENUM(Fog.FogCoordinateSource),
>>> +   { GL_FOG_COORDINATE_SOURCE, CONTEXT_ENUM(Fog.FogCoordinateSource),
>>>         extra_EXT_fog_coord },
>>>
>>>       /* GL_NV_fog_distance */
>>>



More information about the mesa-dev mailing list