gallium: add PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS
authorMarek Olšák <maraeo@gmail.com>
Mon, 5 Sep 2011 20:52:21 +0000 (22:52 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 10 Sep 2011 06:53:29 +0000 (08:53 +0200)
v2: remove PIPE_CAP_ARRAY_TEXTURES in favor of the new CAP.

src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/nv50/nv50_screen.c
src/gallium/drivers/nvc0/nvc0_screen.c
src/gallium/drivers/nvfx/nvfx_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index c108c70298358350dd8fe388d33872812c5c597e..4e55e16eefccb4364b8d5621c2cdac6a446e7fd3 100644 (file)
@@ -124,7 +124,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
       return is->debug.lie ? 1 : 0;
 
    /* Unsupported features (boolean caps). */
-   case PIPE_CAP_ARRAY_TEXTURES:
+   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
    case PIPE_CAP_DEPTH_CLAMP:
    case PIPE_CAP_INDEP_BLEND_ENABLE:
    case PIPE_CAP_INDEP_BLEND_FUNC:
index aa791ae7ede638aa80d569ca123d13044241ce3e..98189303cc6198bb6d06f421b5b74f5a427e95d9 100644 (file)
@@ -88,7 +88,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 10;
    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
       return 13;
-   case PIPE_CAP_ARRAY_TEXTURES: /* shader support missing */
+   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS: /* shader support missing */
       return 0;
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
    case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
index d3027de156ca92dd661607dd95ba69b14f13c1e1..a8bd09234c2c8d6b32b7d8780da70fa6ceb50b39 100644 (file)
@@ -79,8 +79,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 10;
    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
       return 13;
-   case PIPE_CAP_ARRAY_TEXTURES:
-      return 1;
+   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
+      return 8192;
    case PIPE_CAP_TEXTURE_MIRROR_CLAMP:
    case PIPE_CAP_TEXTURE_MIRROR_REPEAT:
    case PIPE_CAP_TEXTURE_SWIZZLE:
index 3b77c9600c6066e6a9a7204dd8b2d50b93e3d12e..5729e664e0ea0f17b4d0194bb5196a8b93ee6de1 100644 (file)
@@ -85,7 +85,7 @@ nvfx_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return 0; // TODO: implement depth clamp
        case PIPE_CAP_PRIMITIVE_RESTART:
                return 0; // TODO: implement primitive restart
-       case PIPE_CAP_ARRAY_TEXTURES:
+       case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
        case PIPE_CAP_TGSI_INSTANCEID:
        case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
        case PIPE_CAP_FRAGMENT_COLOR_CLAMP_CONTROL:
index 8c0500c7dfd63ac9172318e3a8fe7ccc07cfc9e5..896ee9aa69d4dec1acf5fd6e1b1847098c11ef84 100644 (file)
@@ -135,7 +135,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_DEPTH_CLAMP:
         case PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE:
         case PIPE_CAP_SHADER_STENCIL_EXPORT:
-        case PIPE_CAP_ARRAY_TEXTURES:
+        case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
         case PIPE_CAP_TGSI_INSTANCEID:
         case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
         case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
index e02da6e4d980f79698f4ab907a6c6ea161a4bde0..cfbeae5a4fab58b7b308e5b5c63caf94512b7769 100644 (file)
@@ -380,9 +380,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_INTEGER:
                return 0;
 
-       case PIPE_CAP_ARRAY_TEXTURES:
-               /* fix once the CS checker upstream is fixed */
-               return debug_get_bool_option("R600_ARRAY_TEXTURE", FALSE);
+       case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
+               return 0; /* will be re-enabled in the following commits. */
 
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index d22ed4cdcafe03ac668b75172134c91409d1b807..54bcf657eb145a8185de31cab8376e03e985aa84 100644 (file)
@@ -129,8 +129,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_TGSI_INSTANCEID:
    case PIPE_CAP_VERTEX_ELEMENT_INSTANCE_DIVISOR:
       return 1;
-   case PIPE_CAP_ARRAY_TEXTURES:
-      return 1;
+   case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
+      return 64; /* matches core Mesa defaults */
    case PIPE_CAP_MIN_TEXEL_OFFSET:
       return -8;
    case PIPE_CAP_MAX_TEXEL_OFFSET:
index 19c0cab3d3c3f42ad0e862340259491348f540a0..777a177a90fd216ed0d1928048d8083c84c14b7e 100644 (file)
@@ -458,7 +458,7 @@ enum pipe_cap {
    /** different blend funcs per rendertarget */
    PIPE_CAP_INDEP_BLEND_FUNC = 34,
    PIPE_CAP_DEPTHSTENCIL_CLEAR_SEPARATE = 35,
-   PIPE_CAP_ARRAY_TEXTURES = 36,
+   PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS = 36,
    PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT = 37,
    PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT = 38,
    PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER = 39,
index 9f5567652ef95cbf2cfd6961c96eb3d1b87b1da3..0ad9e1286ea0337a614e7058177b0f5acca3f5ab 100644 (file)
@@ -85,6 +85,9 @@ void st_init_limits(struct st_context *st)
    c->MaxTextureRectSize
       = _min(1 << (c->MaxTextureLevels - 1), MAX_TEXTURE_RECT_SIZE);
 
+   c->MaxArrayTextureLayers
+      = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
+
    c->MaxTextureImageUnits
       = _min(screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS),
             MAX_TEXTURE_IMAGE_UNITS);
@@ -505,7 +508,7 @@ void st_init_extensions(struct st_context *st)
    }
 
    /* GL_EXT_texture_array */
-   if (screen->get_param(screen, PIPE_CAP_ARRAY_TEXTURES)) {
+   if (screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS) > 1) {
       ctx->Extensions.EXT_texture_array = GL_TRUE;
       ctx->Extensions.MESA_texture_array = GL_TRUE;
    }