From 0f21dc1bd4862719ddfa1512fee28df341b2b3ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20Ondra=C4=8Dka?= Date: Fri, 13 Feb 2026 23:19:17 +0100 Subject: [PATCH] mesa: implement FRAMEBUFFER_RENDERABLE internalformat query MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Reviewed-by: Erik Faye-Lund Cc: mesa-stable (cherry picked from commit 2b76f2e4a77dee86ddd8a163b452cfcce52b8c6a) Part-of: --- .pick_status.json | 2 +- src/mesa/state_tracker/st_format.c | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index af6bcc6445a..f16e76023df 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3124,7 +3124,7 @@ "description": "mesa: implement FRAMEBUFFER_RENDERABLE internalformat query", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 1d783c10558..c9d0f22e85a 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -1717,6 +1717,7 @@ st_QueryInternalFormat(struct gl_context *ctx, GLenum target, params[0] = (GLint) num_rates; break; } + case GL_FRAMEBUFFER_RENDERABLE: case GL_FRAMEBUFFER_BLEND: { if (target == GL_RENDERBUFFER) target = GL_TEXTURE_2D; @@ -1724,9 +1725,14 @@ st_QueryInternalFormat(struct gl_context *ctx, GLenum target, mesa_format format = st_ChooseTextureFormat(ctx, target, internalFormat, GL_NONE, GL_NONE); enum pipe_format pformat = st_mesa_format_to_pipe_format(st, format); struct pipe_screen *screen = st->screen; + bool is_depth = util_format_is_depth_or_stencil(pformat); + + unsigned bind = is_depth ? PIPE_BIND_DEPTH_STENCIL : PIPE_BIND_RENDER_TARGET; + if (pname == GL_FRAMEBUFFER_BLEND) + bind |= PIPE_BIND_BLENDABLE; bool supported = pformat != PIPE_FORMAT_NONE && - screen->is_format_supported(screen, pformat, ptarget, 0, 0, - PIPE_BIND_BLENDABLE | PIPE_BIND_RENDER_TARGET); + screen->is_format_supported(screen, pformat, ptarget, 0, 0, bind); + params[0] = supported ? GL_FULL_SUPPORT : GL_NONE; break; }