From fd104096c61328933723ba807771f6862f1d42df Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Wed, 18 Dec 2019 10:40:38 -0500 Subject: [PATCH] mesa: Implement GL_ANGLE_pack_reverse_row_order MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Identical to GL_MESA_pack_invert in effect, just need to check for a different enum value for GLES vs GL. The spec claims that "OpenGL 1.5 or OpenGL ES 1.0 are required", but ReadPixels isn't a thing for ES1 so we only enable it for ES2+. Reviewed-by: Marek Olšák Reviewed-by: Eric Anholt Part-of: --- src/mapi/glapi/gen/es_EXT.xml | 5 +++++ src/mesa/main/extensions_table.h | 1 + src/mesa/main/get_hash_params.py | 2 ++ src/mesa/main/glheader.h | 4 ++++ src/mesa/main/pixelstore.c | 5 +++++ 5 files changed, 17 insertions(+) diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index dd987b8..4386375 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -819,6 +819,11 @@ + + + + + diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index f7238c1..14b0b8d 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -27,6 +27,7 @@ EXT(AMD_vertex_shader_viewport_index , AMD_vertex_shader_viewport_index EXT(ANDROID_extension_pack_es31a , ANDROID_extension_pack_es31a , x , x , x , 31, 2014) +EXT(ANGLE_pack_reverse_row_order , dummy_true , x , x , x , ES2, 2011) EXT(ANGLE_texture_compression_dxt3 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2011) EXT(ANGLE_texture_compression_dxt5 , ANGLE_texture_compression_dxt , GLL, GLC, ES1, ES2, 2011) diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py index 657a22f..d9c0984 100644 --- a/src/mesa/main/get_hash_params.py +++ b/src/mesa/main/get_hash_params.py @@ -262,6 +262,8 @@ descriptor=[ # Enums in GLES2, GLES3 { "apis": ["GLES2", "GLES3"], "params": [ [ "GPU_DISJOINT_EXT", "LOC_CUSTOM, TYPE_INT, 0, extra_EXT_disjoint_timer_query" ], +# ANGLE_pack_reverse_row_order + [ "PACK_REVERSE_ROW_ORDER_ANGLE", "CONTEXT_BOOL(Pack.Invert), NO_EXTRA" ], ]}, { "apis": ["GL", "GL_CORE", "GLES2"], "params": [ diff --git a/src/mesa/main/glheader.h b/src/mesa/main/glheader.h index 59ca1cb..a7818d6 100644 --- a/src/mesa/main/glheader.h +++ b/src/mesa/main/glheader.h @@ -157,6 +157,10 @@ typedef int GLclampx; #define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C #endif +#ifndef GL_ANGLE_pack_reverse_row_order +#define GL_PACK_REVERSE_ROW_ORDER_ANGLE 0x93A4 +#endif + #ifdef __cplusplus } #endif diff --git a/src/mesa/main/pixelstore.c b/src/mesa/main/pixelstore.c index d4ae7dd..a439a98 100644 --- a/src/mesa/main/pixelstore.c +++ b/src/mesa/main/pixelstore.c @@ -98,6 +98,11 @@ pixel_storei(GLenum pname, GLint param, bool no_error) goto invalid_enum_error; ctx->Pack.Invert = param; break; + case GL_PACK_REVERSE_ROW_ORDER_ANGLE: + if (!no_error && !_mesa_is_gles(ctx)) + goto invalid_enum_error; + ctx->Pack.Invert = param; + break; case GL_PACK_COMPRESSED_BLOCK_WIDTH: if (!no_error && !_mesa_is_desktop_gl(ctx)) goto invalid_enum_error; -- 2.7.4