[Mesa-dev] [PATCH] mesa: Enable GL_ANGLE_pack_reverse_row_order
Ian Romanick
idr at freedesktop.org
Tue Nov 6 11:58:41 PST 2012
On 11/05/2012 09:57 AM, Fredrik Höglund wrote:
> This extension is functionally the same as GL_MESA_pack_invert,
> but is also available in GLES.
Do we have any piglit tests for this?
> ---
> docs/relnotes-9.1.html | 1 +
> src/mapi/glapi/gen/es_EXT.xml | 7 +++++++
> src/mesa/main/extensions.c | 1 +
> src/mesa/main/get_hash_params.py | 3 +++
> src/mesa/main/glheader.h | 4 ++++
> src/mesa/main/pixelstore.c | 3 ++-
> 6 files changed, 18 insertions(+), 1 deletions(-)
>
> diff --git a/docs/relnotes-9.1.html b/docs/relnotes-9.1.html
> index 5bf9d8c..4aae5f6 100644
> --- a/docs/relnotes-9.1.html
> +++ b/docs/relnotes-9.1.html
> @@ -45,6 +45,7 @@ Note: some of the new features are only available with certain drivers.
>
> <ul>
> <li>GL_ARB_map_buffer_alignment</li>
> +<li>GL_ANGLE_pack_reverse_row_order</li>
> </ul>
>
>
> diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml
> index 1fdb4d5..69cb39b 100644
> --- a/src/mapi/glapi/gen/es_EXT.xml
> +++ b/src/mapi/glapi/gen/es_EXT.xml
> @@ -782,6 +782,13 @@
> <enum name="RG8_EXT" value="0x822B"/>
> </category>
>
> +<!-- 110. GL_ANGLE_pack_reverse_row_order -->
> +<category name="GL_ANGLE_pack_reverse_row_order" number="110">
> + <enum name="PACK_REVERSE_ROW_ORDER_ANGLE" count="1" value="0x93A4">
> + <size name="Get" mode="get"/>
> + </enum>
> +</category>
> +
> <!-- 111. GL_ANGLE_texture_compression_dxt -->
> <category name="ANGLE_texture_compression_dxt" number="111">
> <enum name="COMPRESSED_RGBA_S3TC_DXT3_ANGLE" value="0x83F2"/>
> diff --git a/src/mesa/main/extensions.c b/src/mesa/main/extensions.c
> index f8688cd..0fb4ed8 100644
> --- a/src/mesa/main/extensions.c
> +++ b/src/mesa/main/extensions.c
> @@ -274,6 +274,7 @@ static const struct extension extension_table[] = {
> { "GL_AMD_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
> { "GL_AMD_seamless_cubemap_per_texture", o(AMD_seamless_cubemap_per_texture), GL, 2009 },
> { "GL_AMD_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 },
> + { "GL_ANGLE_pack_reverse_row_order", o(MESA_pack_invert), GL | ES1 | ES2, 2011 },
> { "GL_APPLE_object_purgeable", o(APPLE_object_purgeable), GL, 2006 },
> { "GL_APPLE_packed_pixels", o(dummy_true), GLL, 2002 },
> { "GL_APPLE_texture_max_level", o(dummy_true), ES1 | ES2, 2009 },
> diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py
> index 376df09..d54ea0e 100644
> --- a/src/mesa/main/get_hash_params.py
> +++ b/src/mesa/main/get_hash_params.py
> @@ -120,6 +120,9 @@ descriptor=[
>
> # GL_EXT_texture_filter_anisotropic
> [ "MAX_TEXTURE_MAX_ANISOTROPY_EXT", "CONTEXT_FLOAT(Const.MaxTextureMaxAnisotropy), extra_EXT_texture_filter_anisotropic" ],
> +
> +# GL_ANGLE_pack_reverse_row_order
> + [ "PACK_REVERSE_ROW_ORDER_ANGLE", "CONTEXT_BOOL(Pack.Invert), NO_EXTRA" ],
If we're going to have the two pieces of state alias each other, we
should submit patches to both extension specs saying such. In
MESA_pack_invert, add something like:
Dependencies on ANGLE_pack_reverse_row_order:
If both ANGLE_pack_reverse_row_order and MESA_pack_invert are
supported by the implementation, the same state flag is used
for both PACK_REVERSE_ROW_ORDER_ANGLE and PACK_INVERT_MESA.
Calling Enable (or Disable) on either enum will cause
IsEnabled to return true (or false) for the other.
I would suggest sending the ANGLE_pack_reverse_row_order change to
Daniel Koch (listed in the extension spec).
> ]},
>
> # Enums in OpenGL and GLES1
> diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h
> index e93ca30..33c3d40 100644
> --- a/src/mesa/main/glheader.h
> +++ b/src/mesa/main/glheader.h
> @@ -134,6 +134,10 @@ typedef void *GLeglImageOES;
> #define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
> #endif
>
> +#ifndef GL_ANGLE_pack_reverse_row_order
> +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4
> +#endif
> +
> #ifndef GL_ATI_texture_compression_3dc
> #define GL_ATI_texture_compression_3dc 1
> #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837
> diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c
> index e56d504..ea4340d 100644
> --- a/src/mesa/main/pixelstore.c
> +++ b/src/mesa/main/pixelstore.c
> @@ -133,6 +133,8 @@ _mesa_PixelStorei( GLenum pname, GLint param )
> case GL_PACK_INVERT_MESA:
> if (!_mesa_is_desktop_gl(ctx))
> goto invalid_enum_error;
> + /* fallthrough */
> + case GL_PACK_REVERSE_ROW_ORDER_ANGLE:
> if (!ctx->Extensions.MESA_pack_invert) {
> _mesa_error( ctx, GL_INVALID_ENUM, "glPixelstore(pname)" );
> return;
> @@ -142,7 +144,6 @@ _mesa_PixelStorei( GLenum pname, GLint param )
> FLUSH_VERTICES(ctx, _NEW_PACKUNPACK);
> ctx->Pack.Invert = param;
> break;
> -
Spurious whitespace change.
> case GL_UNPACK_SWAP_BYTES:
> if (!_mesa_is_desktop_gl(ctx))
> goto invalid_enum_error;
>
More information about the mesa-dev
mailing list