diff options
-rw-r--r-- | docs/specs/MESA_framebuffer_flip_y.txt | 32 | ||||
-rw-r--r-- | src/mapi/glapi/gen/apiexec.py | 4 | ||||
-rw-r--r-- | src/mapi/glapi/gen/es_EXT.xml | 15 | ||||
-rw-r--r-- | src/mapi/glapi/gen/static_data.py | 2 | ||||
-rw-r--r-- | src/mesa/main/extensions_table.h | 2 | ||||
-rw-r--r-- | src/mesa/main/fbobject.c | 59 | ||||
-rw-r--r-- | src/mesa/main/fbobject.h | 6 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 8 |
8 files changed, 108 insertions, 20 deletions
diff --git a/docs/specs/MESA_framebuffer_flip_y.txt b/docs/specs/MESA_framebuffer_flip_y.txt index 0866203689f..891cc43fe5f 100644 --- a/docs/specs/MESA_framebuffer_flip_y.txt +++ b/docs/specs/MESA_framebuffer_flip_y.txt @@ -23,7 +23,7 @@ Status Version - Version 2, June 4, 2019 + Version 3, August, 2019 Number @@ -32,7 +32,7 @@ Number Dependencies - OpenGL ES 3.1 or OpenGL 4.3 is required, for FramebufferParameteri. + Requires OpenGL ES 3.0, OpenGL 4.3, or ARB_framebuffer_no_attachments. Overview @@ -59,7 +59,10 @@ Issues New Procedures and Functions - None + OpenGL ES must provide the following functions: + + void FramebufferParameteriMESA(enum target, enum pname, int param); + void GetFramebufferParameterivMESA(enum target, enum pname, int *params); New Types @@ -67,20 +70,35 @@ New Types New Tokens - Accepted by the <pname> argument of FramebufferParameteri and - GetFramebufferParameteriv: + Accepted by the <pname> argument of FramebufferParameteriMESA and + GetFramebufferParameterivMESA: GL_FRAMEBUFFER_FLIP_Y_MESA 0x8BBB +Interactions with OpenGL 4.3, OpenGL ES 3.1, ARB_framebuffer_no_attachments +and any other versions and extensions that provide the entry points +FramebufferParameteri and GetFramebufferParameteriv + + Token GL_FRAMEBUFFER_FLIP_Y_MESA is accepted as the <pname> argument of + FramebufferParameteri and GetFramebufferParameteriv. + Errors - An INVALID_OPERATION error is generated by GetFramebufferParameteriv if the - default framebuffer is bound to <target> and <pname> is FRAMEBUFFER_FLIP_Y_MESA. + An INVALID_OPERATION error is generated by GetFramebufferParameteriv or + GetFramebufferParameterivMESA if the default framebuffer is bound + to <target> and <pname> is GL_FRAMEBUFFER_FLIP_Y_MESA. + + Revision History + Version 3, August, 2019 + Allow OpenGL ES 3.0 to implement by adding functions + FramebufferParameteriMESA and GetFramebufferParameterivMESA which were + previously only available in OpenGL ES 3.1. + Version 2, June, 2019 Enable extension for OpenGL 4.3 and beyond diff --git a/src/mapi/glapi/gen/apiexec.py b/src/mapi/glapi/gen/apiexec.py index 4f9229d5fcd..26adb00ae21 100644 --- a/src/mapi/glapi/gen/apiexec.py +++ b/src/mapi/glapi/gen/apiexec.py @@ -150,6 +150,10 @@ functions = { "FramebufferParameteri": exec_info(compatibility=30, core=31, es2=31), "GetFramebufferParameteriv": exec_info(compatibility=30, core=31, es2=31), + # OpenGL 4.3 / GL_MESA_framebuffer_flip_y. + "FramebufferParameteriMESA": exec_info(core=31, es2=30), + "GetFramebufferParameterivMESA": exec_info(core=31, es2=30), + # OpenGL 4.5 / GL_ARB_direct_state_access. Mesa can expose the extension # with core profile. "CreateTransformFeedbacks": exec_info(compatibility=31, core=31), diff --git a/src/mapi/glapi/gen/es_EXT.xml b/src/mapi/glapi/gen/es_EXT.xml index be466e34ae8..e3cad15679d 100644 --- a/src/mapi/glapi/gen/es_EXT.xml +++ b/src/mapi/glapi/gen/es_EXT.xml @@ -1499,4 +1499,19 @@ </function> </category> +<!-- 302. GL_MESA_framebuffer_flip_y --> +<category name="GL_MESA_framebuffer_flip_y" number="302"> + <enum name="GL_FRAMEBUFFER_FLIP_Y_MESA" value="0x8BBB"/> + <function name="FramebufferParameteriMESA" es2="3.0"> + <param name="target" type="GLenum"/> + <param name="pname" type="GLenum"/> + <param name="param" type="GLint" /> + </function> + <function name="GetFramebufferParameterivMESA" es2="3.0"> + <param name="target" type="GLenum" /> + <param name="pname" type="GLenum" /> + <param name="params" type="GLint *" output="true" /> + </function> +</category> + </OpenGLAPI> diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index c1b3c6a5119..2f3e448750a 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1567,6 +1567,8 @@ offsets = { "GetCompressedMultiTexImageEXT": 1531, "GetMultiTexLevelParameterivEXT": 1532, "GetMultiTexLevelParameterfvEXT": 1533, + "FramebufferParameteriMESA": 1534, + "GetFramebufferParameterivMESA": 1535, } functions = [ diff --git a/src/mesa/main/extensions_table.h b/src/mesa/main/extensions_table.h index 41d066174e6..991adfc9098 100644 --- a/src/mesa/main/extensions_table.h +++ b/src/mesa/main/extensions_table.h @@ -356,7 +356,7 @@ EXT(KHR_texture_compression_astc_hdr , KHR_texture_compression_astc_hdr EXT(KHR_texture_compression_astc_ldr , KHR_texture_compression_astc_ldr , GLL, GLC, x , ES2, 2012) EXT(KHR_texture_compression_astc_sliced_3d , KHR_texture_compression_astc_sliced_3d , GLL, GLC, x , ES2, 2015) -EXT(MESA_framebuffer_flip_y , MESA_framebuffer_flip_y , 43, 43, x , 31, 2018) +EXT(MESA_framebuffer_flip_y , MESA_framebuffer_flip_y , 43, 43, x , 30, 2018) EXT(MESA_pack_invert , MESA_pack_invert , GLL, GLC, x , x , 2002) EXT(MESA_shader_integer_functions , MESA_shader_integer_functions , GLL, GLC, x , 30, 2016) EXT(MESA_texture_signed_rgba , EXT_texture_snorm , GLL, GLC, x , x , 2009) diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index 088b45aa732..bc4f69c149e 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -1625,18 +1625,46 @@ invalid_pname_enum: _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname); } +static bool +validate_framebuffer_parameter_extensions(GLenum pname, const char *func) +{ + GET_CURRENT_CONTEXT(ctx); + + if (!ctx->Extensions.ARB_framebuffer_no_attachments && + !ctx->Extensions.ARB_sample_locations && + !ctx->Extensions.MESA_framebuffer_flip_y) { + _mesa_error(ctx, GL_INVALID_OPERATION, + "%s not supported " + "(none of ARB_framebuffer_no_attachments," + " ARB_sample_locations, or" + " MESA_framebuffer_flip_y extensions are available)", + func); + return false; + } + + /* + * If only the MESA_framebuffer_flip_y extension is enabled + * pname can only be GL_FRAMEBUFFER_FLIP_Y_MESA + */ + if (ctx->Extensions.MESA_framebuffer_flip_y && + pname != GL_FRAMEBUFFER_FLIP_Y_MESA && + !(ctx->Extensions.ARB_framebuffer_no_attachments || + ctx->Extensions.ARB_sample_locations)) { + _mesa_error(ctx, GL_INVALID_ENUM, "%s(pname=0x%x)", func, pname); + return false; + } + + return true; +} + void GLAPIENTRY _mesa_FramebufferParameteri(GLenum target, GLenum pname, GLint param) { GET_CURRENT_CONTEXT(ctx); struct gl_framebuffer *fb; - if (!ctx->Extensions.ARB_framebuffer_no_attachments && - !ctx->Extensions.ARB_sample_locations) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glFramebufferParameteriv not supported " - "(neither ARB_framebuffer_no_attachments nor ARB_sample_locations" - " is available)"); + if (!validate_framebuffer_parameter_extensions(pname, + "glFramebufferParameteri")) { return; } @@ -1650,6 +1678,12 @@ _mesa_FramebufferParameteri(GLenum target, GLenum pname, GLint param) framebuffer_parameteri(ctx, fb, pname, param, "glFramebufferParameteri"); } +void GLAPIENTRY +_mesa_FramebufferParameteriMESA(GLenum target, GLenum pname, GLint param) +{ + _mesa_FramebufferParameteri(target, pname, param); +} + static bool validate_get_framebuffer_parameteriv_pname(struct gl_context *ctx, struct gl_framebuffer *fb, @@ -1779,12 +1813,8 @@ _mesa_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params) GET_CURRENT_CONTEXT(ctx); struct gl_framebuffer *fb; - if (!ctx->Extensions.ARB_framebuffer_no_attachments && - !ctx->Extensions.ARB_sample_locations) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetFramebufferParameteriv not supported " - "(neither ARB_framebuffer_no_attachments nor ARB_sample_locations" - " is available)"); + if (!validate_framebuffer_parameter_extensions(pname, + "glGetFramebufferParameteriv")) { return; } @@ -1799,6 +1829,11 @@ _mesa_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params) "glGetFramebufferParameteriv"); } +void GLAPIENTRY +_mesa_GetFramebufferParameterivMESA(GLenum target, GLenum pname, GLint *params) +{ + _mesa_GetFramebufferParameteriv(target, pname, params); +} /** * Remove the specified renderbuffer or texture from any attachment point in diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index dcbff85eccf..e44373e7dd3 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -405,9 +405,15 @@ extern void GLAPIENTRY _mesa_FramebufferParameteri(GLenum target, GLenum pname, GLint param); extern void GLAPIENTRY +_mesa_FramebufferParameteriMESA(GLenum target, GLenum pname, GLint param); + +extern void GLAPIENTRY _mesa_GetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params); extern void GLAPIENTRY +_mesa_GetFramebufferParameterivMESA(GLenum target, GLenum pname, GLint *params); + +extern void GLAPIENTRY _mesa_FramebufferSampleLocationsfvARB(GLenum target, GLuint start, GLsizei count, const GLfloat *v); diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 6ba5180592e..c3ac7beb73e 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -1412,6 +1412,10 @@ const struct function common_desktop_functions_possible[] = { /* GL_EXT_shader_image_load_store */ { "glBindImageTextureEXT", 30, -1 }, + /* GL_MESA_framebuffer_flip_y */ + { "glFramebufferParameteriMESA", 43, -1 }, + { "glGetFramebufferParameterivMESA", 43, -1 }, + { NULL, 0, -1 } }; @@ -2653,6 +2657,10 @@ const struct function gles3_functions_possible[] = { { "glRenderbufferStorageMultisampleAdvancedAMD", 11, -1 }, { "glNamedRenderbufferStorageMultisampleAdvancedAMD", 11, -1 }, + /* GL_MESA_framebuffer_flip_y */ + { "glFramebufferParameteriMESA", 30, -1 }, + { "glGetFramebufferParameterivMESA", 30, -1 }, + { NULL, 0, -1 } }; |