softpipe: set max cube texture size to 4Kx4K
authorBrian Paul <brianp@vmware.com>
Sun, 18 Mar 2012 16:45:11 +0000 (10:45 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 20 Mar 2012 14:23:32 +0000 (08:23 -0600)
The max size was 16Kx16K so a 4 byte/pixel, six-sided cube would require
6 GBytes of memory.  If mipmapped, 8 GB.  Reduce the max size to 4K to
make the total size more reasonable.

Fixes a crash with the new piglit max-texture-size test.

Reviewed-by: Yuanhan Liu <yuanhan.liu@linux.intel.com>
src/gallium/drivers/softpipe/sp_limits.h
src/gallium/drivers/softpipe/sp_screen.c

index a7a24c98d57805b3bd71e4b0f0c3d22b6ce59d4f..ada5c0c7abb8b497a947ce90d8b4573a5af7fdcc 100644 (file)
@@ -32,6 +32,7 @@
 
 #define SP_MAX_TEXTURE_2D_LEVELS 15  /* 16K x 16K */
 #define SP_MAX_TEXTURE_3D_LEVELS 9   /* 512 x 512 x 512 */
+#define SP_MAX_TEXTURE_CUBE_LEVELS 13  /* 4K x 4K */
 
 
 /** Max surface size */
index c983ef5b16018b7d64350b0d5e4d7eba02b919e1..183ed9ae774ab6be4a63a53fc4e77fc73d9a826c 100644 (file)
@@ -94,7 +94,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
       return SP_MAX_TEXTURE_3D_LEVELS;
    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-      return SP_MAX_TEXTURE_2D_LEVELS;
+      return SP_MAX_TEXTURE_CUBE_LEVELS;
    case PIPE_CAP_BLEND_EQUATION_SEPARATE:
       return 1;
    case PIPE_CAP_INDEP_BLEND_ENABLE: