Version
- Version 2, June 4, 2019
+ Version 3, August, 2019
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
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
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
"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),
</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>
"GetCompressedMultiTexImageEXT": 1531,
"GetMultiTexLevelParameterivEXT": 1532,
"GetMultiTexLevelParameterfvEXT": 1533,
+ "FramebufferParameteriMESA": 1534,
+ "GetFramebufferParameterivMESA": 1535,
}
functions = [
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)
_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;
}
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,
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;
}
"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
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);
/* GL_EXT_shader_image_load_store */
{ "glBindImageTextureEXT", 30, -1 },
+ /* GL_MESA_framebuffer_flip_y */
+ { "glFramebufferParameteriMESA", 43, -1 },
+ { "glGetFramebufferParameterivMESA", 43, -1 },
+
{ NULL, 0, -1 }
};
{ "glRenderbufferStorageMultisampleAdvancedAMD", 11, -1 },
{ "glNamedRenderbufferStorageMultisampleAdvancedAMD", 11, -1 },
+ /* GL_MESA_framebuffer_flip_y */
+ { "glFramebufferParameteriMESA", 30, -1 },
+ { "glGetFramebufferParameterivMESA", 30, -1 },
+
{ NULL, 0, -1 }
};