mesa/st: clamp GL_RENDERBUFFER to GL_TEXTURE_2D for sparse queries

this is a legal query that cts uses, so don't just abort

Fixes: b1c32a6c8c ("mesa: add ARB_sparse_texture query in glGetInternalformativ")

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16097>
(cherry picked from commit 272f6ede0d)
This commit is contained in:
Mike Blumenkrantz 2022-04-21 13:11:18 -04:00 committed by Dylan Baker
parent e07d4a02fe
commit 5d8a4ce3c4
2 changed files with 4 additions and 1 deletions

View file

@ -22,7 +22,7 @@
"description": "mesa/st: clamp GL_RENDERBUFFER to GL_TEXTURE_2D for sparse queries",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "b1c32a6c8c2ffb38627a560bc738ffde2c5e25a4"
},

View file

@ -1491,6 +1491,9 @@ st_QueryInternalFormat(struct gl_context *ctx, GLenum target,
case GL_VIRTUAL_PAGE_SIZE_X_ARB:
case GL_VIRTUAL_PAGE_SIZE_Y_ARB:
case GL_VIRTUAL_PAGE_SIZE_Z_ARB: {
/* this is used only for passing CTS */
if (target == GL_RENDERBUFFER)
target = GL_TEXTURE_2D;
mesa_format format = st_ChooseTextureFormat(ctx, target, internalFormat, GL_NONE, GL_NONE);
enum pipe_format pformat = st_mesa_format_to_pipe_format(st, format);