gallium: add cap for driver specified max combined shader resources.
authorDave Airlie <airlied@redhat.com>
Tue, 31 Oct 2017 23:40:33 +0000 (09:40 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 1 Nov 2017 00:07:03 +0000 (10:07 +1000)
Some hw (evergreen) has a limit on how many combined (images/buffers/mrts)
a fragment shader can access.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
18 files changed:
src/gallium/docs/source/screen.rst
src/gallium/drivers/etnaviv/etnaviv_screen.c
src/gallium/drivers/freedreno/freedreno_screen.c
src/gallium/drivers/i915/i915_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/drivers/swr/swr_screen.cpp
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/vc5/vc5_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index bc0db429b38435d11d062dbca3a6585f71e7c08d..376b95e89ddfe010939e41231536a9e153dbe47e 100644 (file)
@@ -411,7 +411,9 @@ The integer capabilities:
 * ``PIPE_CAP_TILE_RASTER_ORDER``: Whether the driver supports
   GL_MESA_tile_raster_order, using the tile_raster_order_* fields in
   pipe_rasterizer_state.
-
+* ``PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES``: Limit on combined shader
+  output resources (images + buffers + fragment outputs). If 0 the state
+  tracker works it out.
 
 .. _pipe_capf:
 
index 4f55c2a96f6e07f9e3f070310a81cdea8d49a9ab..68973be5c7541a74b1325445d491f89a8ab5fbbb 100644 (file)
@@ -266,6 +266,7 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
 
    /* Stream output. */
index 4efd41f32b5855f1a1c774bc810bda7569320990..30b2dede118f79d2b424b59230e4e004ebf5978b 100644 (file)
@@ -327,6 +327,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_LOAD_CONSTBUF:
        case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
        case PIPE_CAP_TILE_RASTER_ORDER:
+       case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 8b9574e1415819779e62fba7378e9a0a23ed14f0..d7bd8102c7199861d41ee59f0045c77900fb496f 100644 (file)
@@ -319,6 +319,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
 
    case PIPE_CAP_MAX_VIEWPORTS:
index bffc6b52792b3f5b25b38f2329a8959220f46eb4..fc11317687167516fb600bc42914f60ae1a6e22c 100644 (file)
@@ -362,6 +362,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
    }
    /* should only get here on unhandled cases */
index fedd3c142fbcdf5585d753c0667e6eec4d45c308..6ebce573ada52fbc05dfd120a4f6064190cfb9c0 100644 (file)
@@ -226,6 +226,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d1e6e8b5eb51c76684c725b8f09719b69af844f9..2066cf3f6e1e416b3faa51b5e5dbb49da40d7be6 100644 (file)
@@ -278,6 +278,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index d49131c79e3a0a2680416931196e4df0c4f39a4f..d62a5552536296bd885e4e718d0962feb4659a91 100644 (file)
@@ -307,6 +307,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index c0cf6e54468362d8797d1ab5c36581553c5a20d5..a245c10748185cf48a6f22bc4f185d5a4093da64 100644 (file)
@@ -248,6 +248,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_LOAD_CONSTBUF:
         case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
         case PIPE_CAP_TILE_RASTER_ORDER:
+        case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
             return 0;
 
         /* SWTCL-only features. */
index ffcaa15ec9b3d115dc48910050b17a5cd718c61c..3648f7d14eea20350a25562605079473cd8e39e8 100644 (file)
@@ -404,6 +404,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_LOAD_CONSTBUF:
        case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
        case PIPE_CAP_TILE_RASTER_ORDER:
+       case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
                return 0;
 
        case PIPE_CAP_DOUBLES:
index a6c3aa03d305b039a7410ef9b5de3eb485ae5058..875aff655ddc16530d6c26f5138e0e74a6222e6f 100644 (file)
@@ -589,6 +589,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
        case PIPE_CAP_POST_DEPTH_COVERAGE:
        case PIPE_CAP_TILE_RASTER_ORDER:
+       case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
                return 0;
 
        case PIPE_CAP_NATIVE_FENCE_FD:
index fe354b1c137727b46148997031b7fcc92b64ff14..c50d644b51de6ca4a2fef568683eb1e75abaa291 100644 (file)
@@ -313,6 +313,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index 834a6a56c9598aeec8c48d0d2ba6900846cd247c..aede584610fe00eb662d057ea257b8eaea9b8bae 100644 (file)
@@ -454,6 +454,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
    }
 
index b21c35eec80707a2151962d2b6922878cdddb1e6..63d9f625e819fa8f8c56a110e4052d20eff4d97a 100644 (file)
@@ -344,6 +344,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 9879a4db174980d231f572325e51d566232ad639..9ac678d5b9774af9e31e231c2d23e26835236b2d 100644 (file)
@@ -286,6 +286,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MEMOBJ:
         case PIPE_CAP_LOAD_CONSTBUF:
        case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
+       case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
                 return 0;
 
                 /* Stream output. */
index 4fcfec0f29dd6adcbbd47cabcb3cb293cd9f751b..e8bcef0d8fe6062d03420baed33503059917589d 100644 (file)
@@ -246,6 +246,7 @@ vc5_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_LOAD_CONSTBUF:
         case PIPE_CAP_TILE_RASTER_ORDER:
         case PIPE_CAP_STREAM_OUTPUT_INTERLEAVE_BUFFERS:
+        case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
                 return 0;
 
                 /* Geometry shader output, unsupported. */
index 28023f81119f9c7c3d8534952cca8dcb85402a72..47e61aa81e99a562a5d243f73bb2f2635ad13099 100644 (file)
@@ -271,6 +271,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_LOAD_CONSTBUF:
    case PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS:
    case PIPE_CAP_TILE_RASTER_ORDER:
+   case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index 11af6c8d0d89f7d78c1be88e21d1eac78601565a..2db73c183d701e24bbbcac06760b3dcfe7bb4bc5 100644 (file)
@@ -779,6 +779,7 @@ enum pipe_cap
    PIPE_CAP_LOAD_CONSTBUF,
    PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS,
    PIPE_CAP_TILE_RASTER_ORDER,
+   PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)