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 2658d02516 is now explicitly checking for
MaxCubeTextureLevels >= 15 for GL4.1 context.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20600>
This commit is contained in:
Charmaine Lee
2023-01-09 20:46:33 -08:00
committed by Marge Bot
parent 1aa163ebb5
commit 32b23d8fb2

View File

@@ -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 :