Module: Mesa Branch: staging/22.2 Commit: fa4c94915014bccb56a65db70959803bbd782a2c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=fa4c94915014bccb56a65db70959803bbd782a2c
Author: Marek Olšák <[email protected]> Date: Tue Aug 9 19:10:35 2022 -0400 glthread: unbind framebuffers in glDeleteFramebuffers Tests: dEQP-GLES2.functional.lifetime.delete_bound.framebuffer dEQP-GLES2.functional.state_query.integers.framebuffer_binding_getinteger Fixes: e48f676835d - glthread: don't sync for more glGetIntegerv enums for glretrace Reviewed-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17976> (cherry picked from commit eb4036ea5b9a55c1d965e0917d21c502c8635b47) --- .pick_status.json | 2 +- src/mapi/glapi/gen/ARB_framebuffer_object.xml | 3 ++- src/mesa/main/glthread_marshal.h | 14 ++++++++++++++ 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 49c59fe53ea..929204d9772 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -373,7 +373,7 @@ "description": "glthread: unbind framebuffers in glDeleteFramebuffers", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "e48f676835d110f907e5cd55d659dae511e4af2d" }, diff --git a/src/mapi/glapi/gen/ARB_framebuffer_object.xml b/src/mapi/glapi/gen/ARB_framebuffer_object.xml index 7cacf14a8a5..c7a117dcd02 100644 --- a/src/mapi/glapi/gen/ARB_framebuffer_object.xml +++ b/src/mapi/glapi/gen/ARB_framebuffer_object.xml @@ -209,7 +209,8 @@ <glx rop="236"/> </function> - <function name="DeleteFramebuffers" es2="2.0"> + <function name="DeleteFramebuffers" es2="2.0" + marshal_call_after="_mesa_glthread_DeleteFramebuffers(ctx, n, framebuffers);"> <param name="n" type="GLsizei" counter="true"/> <param name="framebuffers" type="const GLuint *" count="n"/> <glx rop="4320"/> diff --git a/src/mesa/main/glthread_marshal.h b/src/mesa/main/glthread_marshal.h index 80022c1cea6..5268ae2a472 100644 --- a/src/mesa/main/glthread_marshal.h +++ b/src/mesa/main/glthread_marshal.h @@ -779,6 +779,20 @@ _mesa_glthread_DeleteLists(struct gl_context *ctx, GLsizei range) _mesa_glthread_flush_batch(ctx); } +static inline void +_mesa_glthread_DeleteFramebuffers(struct gl_context *ctx, GLsizei n, + const GLuint *ids) +{ + if (ctx->GLThread.CurrentDrawFramebuffer) { + for (int i = 0; i < n; i++) { + if (ctx->GLThread.CurrentDrawFramebuffer == ids[i]) { + ctx->GLThread.CurrentDrawFramebuffer = 0; + break; + } + } + } +} + struct marshal_cmd_CallList { struct marshal_cmd_base cmd_base;
