panfrost: implement a driver-specific max-miplevel

The previous define was common for all panfrost code, but for Vulkan we
should probably use the real hardware-limits. So let's introduce a
GL-driver specific define here, and use that instead. This lets us
change the other define to the real HW limitation.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28417>
This commit is contained in:
Erik Faye-Lund 2024-04-04 13:20:38 +02:00 committed by Marge Bot
parent 2b1db3de7b
commit d5c2d152a5
4 changed files with 10 additions and 8 deletions

View file

@ -56,6 +56,12 @@ extern "C" {
/* Driver limits */
#define PAN_MAX_CONST_BUFFERS 16
/* Mali hardware can texture up to 65536 x 65536 x 65536 and render up to 16384
* x 16384, but 8192 x 8192 should be enough for anyone. The OpenGL game
* "Cathedral" requires a texture of width 8192 to start.
*/
#define PAN_MAX_MIP_LEVELS 14
/* How many power-of-two levels in the BO cache do we want? 2^12
* minimum chosen as it is the page size that all allocations are
* rounded to */

View file

@ -66,7 +66,7 @@ struct panfrost_resource {
bool crc;
/* Has anything been written to this slice? */
BITSET_DECLARE(data, MAX_MIP_LEVELS);
BITSET_DECLARE(data, PAN_MAX_MIP_LEVELS);
} valid;
/* Whether the modifier can be changed */

View file

@ -236,11 +236,11 @@ panfrost_get_param(struct pipe_screen *screen, enum pipe_cap param)
return 1;
case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
return 1 << (MAX_MIP_LEVELS - 1);
return 1 << (PAN_MAX_MIP_LEVELS - 1);
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
return MAX_MIP_LEVELS;
return PAN_MAX_MIP_LEVELS;
case PIPE_CAP_FS_COORD_ORIGIN_LOWER_LEFT:
case PIPE_CAP_FS_COORD_PIXEL_CENTER_INTEGER:

View file

@ -42,11 +42,7 @@ typedef uint64_t mali_ptr;
#define MALI_EXTRACT_TYPE(fmt) ((fmt)&0xe0)
#define MALI_EXTRACT_INDEX(pixfmt) (((pixfmt) >> 12) & 0xFF)
/* Mali hardware can texture up to 65536 x 65536 x 65536 and render up to 16384
* x 16384, but 8192 x 8192 should be enough for anyone. The OpenGL game
* "Cathedral" requires a texture of width 8192 to start.
*/
#define MAX_MIP_LEVELS (14)
#define MAX_MIP_LEVELS (17)
#define MAX_IMAGE_PLANES (3)