mesa: remove MaxTextureMbytes, use the cap instead

Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38587>
This commit is contained in:
Marek Olšák 2025-11-27 22:51:19 -05:00 committed by Marge Bot
parent 00f5f0980a
commit 24ba57259f
6 changed files with 2 additions and 8 deletions

View file

@ -189,6 +189,7 @@ u_init_pipe_screen_caps(struct pipe_screen *pscreen, int accel)
caps->max_vma = 0;
caps->max_label_length = 256;
caps->max_texture_mb = 1024;
}
uint64_t u_default_get_timestamp(UNUSED struct pipe_screen *screen)

View file

@ -95,9 +95,6 @@
/** Line width granularity */
#define LINE_WIDTH_GRANULARITY 0.1
/** Max memory to allow for a single texture image (in megabytes) */
#define MAX_TEXTURE_MBYTES 1024
/** Number of texture mipmap levels */
#define MAX_TEXTURE_LEVELS 15

View file

@ -400,7 +400,6 @@ struct gl_constants
*/
GLbitfield DriverSupportedPrimMask;
GLuint MaxTextureMbytes; /**< Max memory per image, in MB */
GLuint MaxTextureSize; /**< Max 1D/2D texture size, in pixels*/
GLuint Max3DTextureLevels; /**< Max mipmap levels for 3D textures */
GLuint MaxCubeTextureLevels; /**< Max mipmap levels for cube textures */

View file

@ -376,7 +376,6 @@ _mesa_init_constants(struct gl_constants *consts, gl_api api)
assert(consts);
/* Constants, may be overriden (usually only reduced) by device drivers */
consts->MaxTextureMbytes = MAX_TEXTURE_MBYTES;
consts->MaxTextureSize = 1 << (MAX_TEXTURE_LEVELS - 1);
consts->Max3DTextureLevels = MAX_TEXTURE_LEVELS;
consts->MaxCubeTextureLevels = MAX_TEXTURE_LEVELS;

View file

@ -1369,7 +1369,7 @@ _mesa_test_proxy_teximage(struct gl_context *ctx, GLenum target,
/* We just check if the image size is less than MaxTextureMbytes.
* Some drivers may do more specific checks.
*/
return mbytes <= (uint64_t) ctx->Const.MaxTextureMbytes;
return mbytes <= (uint64_t) ctx->screen->caps.max_texture_mb;
}

View file

@ -123,8 +123,6 @@ void st_init_limits(struct pipe_screen *screen,
c->MaxTextureSize = screen->caps.max_texture_2d_size;
c->MaxTextureSize = MIN2(c->MaxTextureSize, 1 << (MAX_TEXTURE_LEVELS - 1));
c->MaxTextureMbytes = MAX2(c->MaxTextureMbytes,
screen->caps.max_texture_mb);
c->Max3DTextureLevels
= _min(screen->caps.max_texture_3d_levels,