From d44f725ea65c8aa5bc010743887a1d939aabc880 Mon Sep 17 00:00:00 2001 From: Qiang Yu Date: Thu, 30 Dec 2021 15:52:17 +0800 Subject: [PATCH] mesa/main: relax alignment check when ARB_sparse_texture2 available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewed-by: Marek Olšák Signed-off-by: Qiang Yu Part-of: --- src/mesa/main/texstorage.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c index 0ce9e3cd3d4..da70da97a22 100644 --- a/src/mesa/main/texstorage.c +++ b/src/mesa/main/texstorage.c @@ -387,7 +387,9 @@ sparse_texture_error_check(struct gl_context *ctx, GLuint dims, } } - if (width % px || height % py || depth % pz) { + /* ARB_sparse_texture2 allow non-page-aligned base texture size. */ + if (!_mesa_has_ARB_sparse_texture2(ctx) && + (width % px || height % py || depth % pz)) { _mesa_error(ctx, GL_INVALID_VALUE, "glTex%sStorage%uD(sparse page size)", suffix, dims); return GL_TRUE;