From 32b23d8fb21d13ccd84da131070cc6c9bca137d5 Mon Sep 17 00:00:00 2001 From: Charmaine Lee Date: Mon, 9 Jan 2023 20:46:33 -0800 Subject: [PATCH] svga: fix max number of texture cube levels The maximum number of mipmap levels supported for cubemap can be determined from the maximum 2D texture size. There is no need to limit the max to 12. This fixes a regression in creating GL4.1 and up context since commit 2658d025166c is now explicitly checking for MaxCubeTextureLevels >= 15 for GL4.1 context. Reviewed-by: Neha Bhende Part-of: --- src/gallium/drivers/svga/svga_screen.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c index f12f36b..f70b406 100644 --- a/src/gallium/drivers/svga/svga_screen.c +++ b/src/gallium/drivers/svga/svga_screen.c @@ -1,5 +1,5 @@ /********************************************************** - * Copyright 2008-2009 VMware, Inc. All rights reserved. + * Copyright 2008-2023 VMware, Inc. All rights reserved. * * Permission is hereby granted, free of charge, to any person * obtaining a copy of this software and associated documentation @@ -250,12 +250,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param) return MIN2(util_logbase2(result.u) + 1, SVGA_MAX_TEXTURE_LEVELS); case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS: - /* - * No mechanism to query the host, and at least limited to 2048x2048 on - * certain hardware. - */ - return MIN2(util_last_bit(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE)), - 12 /* 2048x2048 */); + return util_last_bit(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE)); case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: return sws->have_sm5 ? SVGA3D_SM5_MAX_SURFACE_ARRAYSIZE : -- 2.7.4