r600g,radeonsi: fix MAX_TEXTURE_3D_LEVELS and MAX_TEXTURE_ARRAY_LAYERS limits
authorMarek Olšák <marek.olsak@amd.com>
Sun, 9 Mar 2014 19:03:57 +0000 (20:03 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 11 Mar 2014 17:51:20 +0000 (18:51 +0100)
CB_COLORi_VIEW.SLICE_MAX can be at most 2047.

This fixes the maxlayers piglit test.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c

index 2fceb3c645a580fdb137cb62430a2a4b182adaed..88fbdd8d5fd2daf20416ae7e28ad10331d3735aa 100644 (file)
@@ -423,15 +423,17 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
-       case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
        case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
                if (family >= CHIP_CEDAR)
                        return 15;
                else
                        return 14;
+       case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
+               /* textures support 8192, but layered rendering supports 2048 */
+               return 12;
        case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
-               return rscreen->b.info.drm_minor >= 9 ?
-                       (family >= CHIP_CEDAR ? 16384 : 8192) : 0;
+               /* textures support 8192, but layered rendering supports 2048 */
+               return rscreen->b.info.drm_minor >= 9 ? 2048 : 0;
 
        /* Render targets. */
        case PIPE_CAP_MAX_RENDER_TARGETS:
index 040fc5c6535fdc00d057490cc455cd0d42af9219..95f022be8744632a592e05b4befa33a17c8f5650 100644 (file)
@@ -307,11 +307,14 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
-       case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
        case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
-                       return 15;
+               return 15; /* 16384 */
+       case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
+               /* textures support 8192, but layered rendering supports 2048 */
+               return 12;
        case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
-               return 16384;
+               /* textures support 8192, but layered rendering supports 2048 */
+               return 2048;
 
        /* Render targets. */
        case PIPE_CAP_MAX_RENDER_TARGETS: