From 1ab94ca17b974a4ae2ecd145a566e4ea4f2daaaf Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 20 Feb 2024 11:10:44 -0500 Subject: [PATCH] mesa: add more driver support checks for more format queries fixes #10641 cc: mesa-stable Acked-by: Lionel Landwerlin Acked-by: Jesse Natalie Part-of: --- src/mesa/main/formatquery.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/mesa/main/formatquery.c b/src/mesa/main/formatquery.c index 396fa0a4014..3e8635f2644 100644 --- a/src/mesa/main/formatquery.c +++ b/src/mesa/main/formatquery.c @@ -1030,6 +1030,14 @@ _mesa_GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, baseformat = _mesa_base_fbo_format(ctx, internalformat); } + /* If the internal format is unsupported, or if a particular component + * is not present in the format, 0 is written to params. + */ + if (!st_QueryTextureFormatSupport(ctx, target, internalformat)) { + buffer[0] = GL_NONE; + break; + } + /* Let the driver choose the texture format. * * Disclaimer: I am considering that drivers use for renderbuffers the