Mesa (main): mesa/st: clamp GL_RENDERBUFFER to GL_TEXTURE_2D for sparse queries
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sun Apr 24 16:26:59 UTC 2022
Module: Mesa
Branch: main
Commit: 272f6ede0d828f95549f26c0c47c24f08d6a6174
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=272f6ede0d828f95549f26c0c47c24f08d6a6174
Author: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Date: Thu Apr 21 13:11:18 2022 -0400
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: b1c32a6c8c2 ("mesa: add ARB_sparse_texture query in glGetInternalformativ")
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Reviewed-by: Qiang Yu <yuq825 at gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16097>
---
src/mesa/state_tracker/st_format.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
index 794ae63841d..fadd03073aa 100644
--- a/src/mesa/state_tracker/st_format.c
+++ b/src/mesa/state_tracker/st_format.c
@@ -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);
More information about the mesa-commit
mailing list