<enum name="MAX_TEXTURE_LOD_BIAS_EXT" value="0x84FD"/>
</category>
+<!-- 64. GL_EXT_discard_framebuffer -->
+
+<category name="GL_EXT_discard_framebuffer" number="64">
+ <function name="DiscardFramebufferEXT" es1="1.0" es2="2.0" offset="assign" desktop="false">
+ <param name="target" type="GLenum"/>
+ <param name="numAttachments" type="GLsizei"/>
+ <param name="attachments" type="const GLenum *" count="numAttachments"/>
+ </function>
+ <enum name="COLOR_EXT" value="0x1800"/>
+ <enum name="DEPTH_EXT" value="0x1801"/>
+ <enum name="STENCIL_EXT" value="0x1802"/>
+</category>
+
<!-- 65. GL_EXT_blend_minmax -->
<category name="GL_EXT_read_format_bgra" number="66">
driver->ValidateFramebuffer = _mesa_validate_framebuffer;
driver->BlitFramebuffer = _swrast_BlitFramebuffer;
+ driver->DiscardFramebuffer = NULL;
_mesa_init_texture_barrier_functions(driver);
/*@}*/
/**
- * \name Functions for GL_EXT_framebuffer_{object,blit}.
+ * \name Functions for GL_EXT_framebuffer_{object,blit,discard}.
*/
/*@{*/
struct gl_framebuffer * (*NewFramebuffer)(struct gl_context *ctx, GLuint name);
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1,
GLbitfield mask, GLenum filter);
+ void (*DiscardFramebuffer)(struct gl_context *ctx,
+ GLenum target, GLsizei numAttachments, const GLenum *attachments);
/**
* \name Query objects
{ "GL_EXT_blend_color", o(EXT_blend_color), GLL, 1995 },
{ "GL_EXT_blend_equation_separate", o(EXT_blend_equation_separate), GL, 2003 },
{ "GL_EXT_blend_func_separate", o(EXT_blend_func_separate), GLL, 1999 },
+ { "GL_EXT_discard_framebuffer", o(EXT_framebuffer_object), ES1 | ES2, 2009 },
{ "GL_EXT_blend_minmax", o(EXT_blend_minmax), GLL | ES1 | ES2, 1995 },
{ "GL_EXT_blend_subtract", o(dummy_true), GLL, 1995 },
{ "GL_EXT_clip_volume_hint", o(EXT_clip_volume_hint), GL, 1996 },
0, 0, MAX_VIEWPORT_WIDTH, MAX_VIEWPORT_HEIGHT,
"glInvalidateFramebuffer");
}
+
+void GLAPIENTRY
+_mesa_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments,
+ const GLenum *attachments)
+{
+ struct gl_framebuffer *fb;
+ GLint i;
+
+ GET_CURRENT_CONTEXT(ctx);
+
+ fb = get_framebuffer_target(ctx, target);
+ if (!fb) {
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glDiscardFramebufferEXT(target %s)",
+ _mesa_lookup_enum_by_nr(target));
+ return;
+ }
+
+ if (numAttachments < 0) {
+ _mesa_error(ctx, GL_INVALID_VALUE,
+ "glDiscardFramebufferEXT(numAttachments < 0)");
+ return;
+ }
+
+ for (i = 0; i < numAttachments; i++) {
+ switch (attachments[i]) {
+ case GL_COLOR:
+ case GL_DEPTH:
+ case GL_STENCIL:
+ if (_mesa_is_user_fbo(fb))
+ goto invalid_enum;
+ break;
+ case GL_COLOR_ATTACHMENT0:
+ case GL_DEPTH_ATTACHMENT:
+ case GL_STENCIL_ATTACHMENT:
+ if (_mesa_is_winsys_fbo(fb))
+ goto invalid_enum;
+ break;
+ default:
+ goto invalid_enum;
+ }
+ }
+
+ if (ctx->Driver.DiscardFramebuffer)
+ ctx->Driver.DiscardFramebuffer(ctx, target, numAttachments, attachments);
+
+ return;
+
+invalid_enum:
+ _mesa_error(ctx, GL_INVALID_ENUM,
+ "glDiscardFramebufferEXT(attachment %s)",
+ _mesa_lookup_enum_by_nr(attachments[i]));
+}
_mesa_InvalidateFramebuffer(GLenum target, GLsizei numAttachments,
const GLenum *attachments);
+extern void GLAPIENTRY
+_mesa_DiscardFramebufferEXT(GLenum target, GLsizei numAttachments,
+ const GLenum *attachments);
+
#endif /* FBOBJECT_H */
{ "glDepthRangef", 11, -1 },
{ "glDepthRangex", 11, -1 },
{ "glDisable", 11, _gloffset_Disable },
+ { "glDiscardFramebufferEXT", 11, -1 },
{ "glDisableClientState", 11, _gloffset_DisableClientState },
{ "glDrawArrays", 11, _gloffset_DrawArrays },
{ "glDrawElements", 11, _gloffset_DrawElements },
{ "glDepthRangef", 20, -1 },
{ "glDetachShader", 20, -1 },
{ "glDisable", 20, _gloffset_Disable },
+ { "glDiscardFramebufferEXT", 20, -1 },
{ "glDisableVertexAttribArray", 20, -1 },
{ "glDrawArrays", 20, _gloffset_DrawArrays },
{ "glDrawBuffersNV", 20, -1 },