summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/common
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-05-01 14:00:33 -0700
committerEric Anholt <[email protected]>2019-05-13 12:03:05 -0700
commitf33cb272f0890f115c36fb96173123bc699b7b2c (patch)
tree853d429e345213757c8427388e2ab870a5ea227a /src/mesa/drivers/common
parentce6dbc0417586cc1ceb015b631384ffdfb22e981 (diff)
mesa: Replace MaxTextureLevels with MaxTextureSize.
In most places (glGetInteger, max_legal_texture_dimensions), we wanted the number of pixels, not the number of levels. Number of levels is easily recovered with util_next_power_of_two() and ffs(). More importantly, for V3D we want to be able to expose a non-power-of-two maximum texture size to cover 2x4k displays on HW that can't quite do 8192 wide. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/drivers/common')
-rw-r--r--src/mesa/drivers/common/meta.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c
index 3515e312023..302c5fffeb9 100644
--- a/src/mesa/drivers/common/meta.c
+++ b/src/mesa/drivers/common/meta.c
@@ -1245,7 +1245,7 @@ init_temp_texture(struct gl_context *ctx, struct temp_texture *tex)
else {
/* use 2D texture, NPOT if possible */
tex->Target = GL_TEXTURE_2D;
- tex->MaxSize = 1 << (ctx->Const.MaxTextureLevels - 1);
+ tex->MaxSize = ctx->Const.MaxTextureSize;
tex->NPOT = ctx->Extensions.ARB_texture_non_power_of_two;
}
tex->MinSize = 16; /* 16 x 16 at least */