aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/svga
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/svga
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/svga')
-rw-r--r--src/gallium/drivers/svga/svga_screen.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/gallium/drivers/svga/svga_screen.c b/src/gallium/drivers/svga/svga_screen.c
index f747ff78bcf..02c1a99b2db 100644
--- a/src/gallium/drivers/svga/svga_screen.c
+++ b/src/gallium/drivers/svga/svga_screen.c
@@ -221,18 +221,18 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
return 256;
- case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
+ case PIPE_CAP_MAX_TEXTURE_2D_SIZE:
{
- unsigned levels = SVGA_MAX_TEXTURE_LEVELS;
+ unsigned size = 1 << (SVGA_MAX_TEXTURE_LEVELS - 1);
if (sws->get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_WIDTH, &result))
- levels = MIN2(util_logbase2(result.u) + 1, levels);
+ size = MIN2(result.u, size);
else
- levels = 12 /* 2048x2048 */;
+ size = 2048;
if (sws->get_cap(sws, SVGA3D_DEVCAP_MAX_TEXTURE_HEIGHT, &result))
- levels = MIN2(util_logbase2(result.u) + 1, levels);
+ size = MIN2(result.u, size);
else
- levels = 12 /* 2048x2048 */;
- return levels;
+ size = 2048;
+ return size;
}
case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
@@ -245,7 +245,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
* No mechanism to query the host, and at least limited to 2048x2048 on
* certain hardware.
*/
- return MIN2(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_LEVELS),
+ return MIN2(util_last_bit(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_2D_SIZE)),
12 /* 2048x2048 */);
case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: