From 0c7994bb2ddb082cdd72ab7b4de6de8b0d55c204 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 14 Mar 2023 16:53:15 -0400 Subject: [PATCH] mapi: add InternalInvalidateFramebufferAncillaryMESA MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit this allows glthread to handle ancillary buffer invalidation Reviewed-by: Marek Olšák Part-of: --- src/mapi/glapi/gen/gl_API.xml | 4 ++++ src/mapi/glapi/gen/static_data.py | 1 + src/mesa/main/fbobject.c | 9 +++++++++ src/mesa/main/fbobject.h | 3 +++ 4 files changed, 17 insertions(+) diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 897386333ce..de868e45fc2 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -12972,6 +12972,10 @@ + + + + diff --git a/src/mapi/glapi/gen/static_data.py b/src/mapi/glapi/gen/static_data.py index a98f901bcc8..b4c85358c9d 100644 --- a/src/mapi/glapi/gen/static_data.py +++ b/src/mapi/glapi/gen/static_data.py @@ -1703,6 +1703,7 @@ offsets = { "MultiDrawElementsUserBuf": 1667, "DrawArraysInstancedBaseInstanceDrawID": 1668, "DrawElementsInstancedBaseVertexBaseInstanceDrawID": 1669, + "InternalInvalidateFramebufferAncillaryMESA": 1670, } functions = [ diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index e011453a21d..42cbc20bbb5 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -5524,6 +5524,15 @@ _mesa_InvalidateFramebuffer(GLenum target, GLsizei numAttachments, discard_framebuffer(ctx, fb, numAttachments, attachments); } +void GLAPIENTRY +_mesa_InternalInvalidateFramebufferAncillaryMESA(void) +{ + GET_CURRENT_CONTEXT(ctx); + + struct gl_framebuffer *fb = get_framebuffer_target(ctx, GL_FRAMEBUFFER); + discard_attachments(ctx, fb, BITFIELD_BIT(BUFFER_DEPTH) | BITFIELD_BIT(BUFFER_STENCIL)); +} + void GLAPIENTRY _mesa_InvalidateNamedFramebufferData(GLuint framebuffer, diff --git a/src/mesa/main/fbobject.h b/src/mesa/main/fbobject.h index bcc4e08eb69..7dedf1006ea 100644 --- a/src/mesa/main/fbobject.h +++ b/src/mesa/main/fbobject.h @@ -133,4 +133,7 @@ _mesa_bind_framebuffers(struct gl_context *ctx, struct gl_framebuffer *newDrawFb, struct gl_framebuffer *newReadFb); +void GLAPIENTRY +_mesa_InternalInvalidateFramebufferAncillaryMESA(void); + #endif /* FBOBJECT_H */