summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/softpipe
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-04-29 15:38:24 -0700
committerEric Anholt <[email protected]>2019-05-13 12:03:08 -0700
commit0c31fe9ee743f699bcabcb638ccc83e515f0d1bd (patch)
tree7a8e3fba596796d27e75bc40ba110c24a13c0dec /src/gallium/drivers/softpipe
parentf33cb272f0890f115c36fb96173123bc699b7b2c (diff)
gallium: Redefine the max texture 2d cap from _LEVELS to _SIZE.
The _LEVELS assumes that the max is always power of two. For V3D 4.2, we can support up to 7680 non-power-of-two MSAA textures, which will let X11 support dual 4k displays on newer hardware. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/softpipe')
-rw-r--r--src/gallium/drivers/softpipe/sp_screen.c4
-rw-r--r--src/gallium/drivers/softpipe/sp_tile_cache.c7
2 files changed, 4 insertions, 7 deletions
diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c
index 5d44824e202..b1b777b4755 100644
--- a/src/gallium/drivers/softpipe/sp_screen.c
+++ b/src/gallium/drivers/softpipe/sp_screen.c
@@ -95,8 +95,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_TEXTURE_BORDER_COLOR_QUIRK:
case PIPE_CAP_MAX_TEXTURE_UPLOAD_MEMORY_BUDGET:
return 0;
- case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
- return SP_MAX_TEXTURE_2D_LEVELS;
+ case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
+ return 1 << (SP_MAX_TEXTURE_2D_LEVELS - 1);
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
return SP_MAX_TEXTURE_3D_LEVELS;
case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c
index 998939bdf30..075d322f802 100644
--- a/src/gallium/drivers/softpipe/sp_tile_cache.c
+++ b/src/gallium/drivers/softpipe/sp_tile_cache.c
@@ -92,13 +92,10 @@ sp_create_tile_cache( struct pipe_context *pipe )
{
struct softpipe_tile_cache *tc;
uint pos;
- MAYBE_UNUSED int maxTexSize;
- int maxLevels;
/* sanity checking: max sure MAX_WIDTH/HEIGHT >= largest texture image */
- maxLevels = pipe->screen->get_param(pipe->screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS);
- maxTexSize = 1 << (maxLevels - 1);
- assert(MAX_WIDTH >= maxTexSize);
+ assert(MAX_WIDTH >= pipe->screen->get_param(pipe->screen,
+ PIPE_CAP_MAX_TEXTURE_2D_SIZE));
STATIC_ASSERT(sizeof(union tile_address) == 4);