gallium: remove PIPE_CAP_MAX_COMBINED_SAMPLERS
authorMarek Olšák <marek.olsak@amd.com>
Fri, 17 Jan 2014 21:52:28 +0000 (22:52 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 4 Feb 2014 19:19:16 +0000 (20:19 +0100)
This can be derived from the shader caps.

All GPUs from ATI/AMD, NVIDIA, and INTEL have separate texture slots
for each shader stage.

15 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_screen.c
src/gallium/drivers/ilo/ilo_screen.c
src/gallium/drivers/llvmpipe/lp_screen.c
src/gallium/drivers/nouveau/nv30/nv30_screen.c
src/gallium/drivers/nouveau/nv50/nv50_screen.c
src/gallium/drivers/nouveau/nvc0/nvc0_screen.c
src/gallium/drivers/r300/r300_screen.c
src/gallium/drivers/r600/r600_pipe.c
src/gallium/drivers/radeonsi/si_pipe.c
src/gallium/drivers/softpipe/sp_screen.c
src/gallium/drivers/svga/svga_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index ce96f6880d5961f203956d1d32d076acf7a75a1d..ed8e8322e8f132706e824e62777ee58e54286bc3 100644 (file)
@@ -53,8 +53,6 @@ The integer capabilities:
   opcodes to the Shader Model 3 specification. XXX oh god this is horrible
 * ``PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS``: The maximum number of stream buffers.
 * ``PIPE_CAP_PRIMITIVE_RESTART``: Whether primitive restart is supported.
-* ``PIPE_CAP_MAX_COMBINED_SAMPLERS``: The total number of samplers accessible from
-  the vertex and fragment shader, inclusive.
 * ``PIPE_CAP_INDEP_BLEND_ENABLE``: Whether per-rendertarget blend enabling and channel
   masks are supported. If 0, then the first rendertarget's blend mask is
   replicated across all MRTs.
index f1822268851b3a3e834a10329e66a5ec46f63206..aa294b33250a106f09d1f0748d2d9ed6b3e84699 100644 (file)
@@ -219,8 +219,6 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return MAX_MIP_LEVELS;
        case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
                return 9192;
-       case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-               return 20;
 
        /* Render targets. */
        case PIPE_CAP_MAX_RENDER_TARGETS:
index 300233e70d041cc0d17db251a39ab0857fb93146..a658b1bf3df8fdc4699df97994f1a5ed879d3320 100644 (file)
@@ -240,13 +240,6 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
       return is->debug.lie ? 1 : 0;
 
    /* Texturing. */
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return i915_get_shader_param(screen,
-                                   PIPE_SHADER_VERTEX,
-                                   PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS) +
-             i915_get_shader_param(screen,
-                                   PIPE_SHADER_FRAGMENT,
-                                   PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
       return I915_MAX_TEXTURE_2D_LEVELS;
    case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
index 1443ba350c6da32630c5da5b0c97162677a8561a..bc8f62d2c19018085e338ee57e6e72d1dfd3fb8b 100644 (file)
@@ -338,8 +338,6 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return ILO_MAX_SO_BUFFERS;
    case PIPE_CAP_PRIMITIVE_RESTART:
       return true;
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return ILO_MAX_SAMPLERS * 2;
    case PIPE_CAP_INDEP_BLEND_ENABLE:
    case PIPE_CAP_INDEP_BLEND_FUNC:
       return true;
index 31571a4ae663506f1be527b606a5b81297790368..3f84d740d27da12b52fed34fe739cd69270094f0 100644 (file)
@@ -106,8 +106,6 @@ static int
 llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return 2 * PIPE_MAX_SAMPLERS;  /* VS + FS samplers */
    case PIPE_CAP_NPOT_TEXTURES:
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
       return 1;
index 26ad33db0f45ffd1e46fbb2dfabce6e248a2d73e..787802d3b11251960f03a18ee17693f50c5ce082 100644 (file)
@@ -60,8 +60,6 @@ nv30_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_MAX_COMBINED_SAMPLERS:
-      return 16;
    case PIPE_CAP_GLSL_FEATURE_LEVEL:
       return 120;
    /* supported capabilities */
index 5bb341d549ccfd97611f768b56bb86a099bfc4a3..2b6ec3a11c0ba4a7e141ec4f32a47482fe8ea724 100644 (file)
@@ -85,8 +85,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    const uint16_t class_3d = nouveau_screen(pscreen)->class_3d;
 
    switch (param) {
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return 64;
    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
       return 14;
    case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
index 94950c5a84d12a78f652290b217fc59b8bbb3814..752d72b5944bc3fcbe918c661a2162bf21076a11 100644 (file)
@@ -71,8 +71,6 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    const uint16_t class_3d = nouveau_screen(pscreen)->class_3d;
 
    switch (param) {
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return 16 * 5;
    case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
    case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
       return 15;
index 0ab670b983942e9f4759b59e97a838fe08dea049..4b790aff17745a52064fcaa999258d6929b276d4 100644 (file)
@@ -180,8 +180,6 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
             return 0;
 
         /* Texturing. */
-        case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-            return r300screen->caps.num_tex_units;
         case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
         case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
         case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
index 07f6c1ce56640198265ba0ef8641fab4c4bf9604..49521e0eb5a6c21c8a47ab1030432465aa3140f2 100644 (file)
@@ -415,8 +415,6 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
                return rscreen->b.info.drm_minor >= 9 ?
                        (family >= CHIP_CEDAR ? 16384 : 8192) : 0;
-       case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-               return 32;
 
        /* Render targets. */
        case PIPE_CAP_MAX_RENDER_TARGETS:
index ff8788ea225f8bd9cb7bae77244a6323ea74154c..14dfd30bfb07e62fd24be1565c417edb47b523c9 100644 (file)
@@ -306,8 +306,6 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                        return 15;
        case PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS:
                return 16384;
-       case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-               return HAVE_LLVM >= 0x0305 ? 48 : 32;
 
        /* Render targets. */
        case PIPE_CAP_MAX_RENDER_TARGETS:
index ac019b585d7c3f18ae0382654ff97685425e84a0..dbdbbc93e4a3946cef4944bf1fca9a7b6f99ab8c 100644 (file)
@@ -66,8 +66,6 @@ static int
 softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
 {
    switch (param) {
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return 2 * PIPE_MAX_SAMPLERS;  /* VS + FS */
    case PIPE_CAP_NPOT_TEXTURES:
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
       return 1;
index e442ccc3020e87debd400df74949559e9a080e62..350ee5cad5b6533cdee140029fc6fd53c0cff3b3 100644 (file)
@@ -139,8 +139,6 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    SVGA3dDevCapResult result;
 
    switch (param) {
-   case PIPE_CAP_MAX_COMBINED_SAMPLERS:
-      return 16;
    case PIPE_CAP_NPOT_TEXTURES:
    case PIPE_CAP_MIXED_FRAMEBUFFER_SIZES:
       return 1;
index 91737a63038481137137cf5c78051a685bd74849..8d08a90595d1658d9d0726327bd9188ece823797 100644 (file)
@@ -469,9 +469,6 @@ enum pipe_cap {
    PIPE_CAP_SM3 = 29,  /*< Shader Model, supported */
    PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS = 30,
    PIPE_CAP_PRIMITIVE_RESTART = 31,
-   /** Maximum texture image units accessible from vertex and fragment shaders
-    * combined */
-   PIPE_CAP_MAX_COMBINED_SAMPLERS = 32,
    /** blend enables and write masks per rendertarget */
    PIPE_CAP_INDEP_BLEND_ENABLE = 33,
    /** different blend funcs per rendertarget */
index fe76073261f906833484e99048fe33f894217875..9829eb5960ad0d91f6bfe69176aefd941401263a 100644 (file)
@@ -89,10 +89,6 @@ void st_init_limits(struct st_context *st)
    c->MaxArrayTextureLayers
       = screen->get_param(screen, PIPE_CAP_MAX_TEXTURE_ARRAY_LAYERS);
 
-   c->MaxCombinedTextureImageUnits
-      = _min(screen->get_param(screen, PIPE_CAP_MAX_COMBINED_SAMPLERS),
-             MAX_COMBINED_TEXTURE_IMAGE_UNITS);
-
    /* Define max viewport size and max renderbuffer size in terms of
     * max texture size (note: max tex RECT size = max tex 2D size).
     * If this isn't true for some hardware we'll need new PIPE_CAP_ queries.
@@ -243,6 +239,12 @@ void st_init_limits(struct st_context *st)
       options->LowerClipDistance = true;
    }
 
+   c->MaxCombinedTextureImageUnits =
+         _min(c->Program[MESA_SHADER_VERTEX].MaxTextureImageUnits +
+              c->Program[MESA_SHADER_GEOMETRY].MaxTextureImageUnits +
+              c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits,
+              MAX_COMBINED_TEXTURE_IMAGE_UNITS);
+
    /* This depends on program constants. */
    c->MaxTextureCoordUnits
       = _min(c->Program[MESA_SHADER_FRAGMENT].MaxTextureImageUnits, MAX_TEXTURE_COORD_UNITS);