gallium: add PIPE_CAP_MAX_SHADER_BUFFER_SIZE
authorMarek Olšák <marek.olsak@amd.com>
Mon, 6 Aug 2018 12:38:54 +0000 (08:38 -0400)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 23 Aug 2018 20:56:17 +0000 (16:56 -0400)
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
19 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_get.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/v3d/v3d_screen.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index a4d71b3a84952e135b0c6bb656a39c8965fab139..6caa7d5f3512af13b7dcacf4934038201147aa10 100644 (file)
@@ -454,6 +454,8 @@ subpixel precision bias in bits during conservative rasterization.
   ```set_sample_locations```.
 * ``PIPE_CAP_MAX_GS_INVOCATIONS``: Maximum supported value of
   TGSI_PROPERTY_GS_INVOCATIONS.
+* ``PIPE_CAP_MAX_SHADER_BUFFER_SIZE``: Maximum supported size for binding
+  with set_shader_buffers.
 
 .. _pipe_capf:
 
index e8bc6a5cae84cce07270a90ba984221e931c7e91..03449778c70d43dd098074e95b54f77067f8d03d 100644 (file)
@@ -288,6 +288,9 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
 
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
+
    /* Stream output. */
    case PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS:
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
index 96d4adaa73df713d75eb4dcc15a32e17e521b358..d0d202d5b07d5b6206398d6a8630a3bf7f0eb371 100644 (file)
@@ -375,6 +375,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_GS_INVOCATIONS:
                return 32;
 
+       case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+                return 1 << 27;
+
        case PIPE_CAP_CONTEXT_PRIORITY_MASK:
                return screen->priority_mask;
 
index 6b850064019d94065c9e5b5d768b3c4af8336cfc..fcca8b998137b68f01df940697ce496ec8e23e30 100644 (file)
@@ -340,6 +340,9 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
 
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
+
    case PIPE_CAP_MAX_VIEWPORTS:
       return 1;
 
index 1181f1c0a6e0a38a32ab15b80c5f6a6da020b6ba..d0f3ce9aeb8969f58c3683f0a7955b6b41f4f275 100644 (file)
@@ -375,6 +375,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    }
    /* should only get here on unhandled cases */
    debug_printf("Unexpected PIPE_CAP %d query\n", param);
index fc89bfbc1b26f6ce0a0b0ac40a9f5c488d9f6750..613d716153323435cd7e3513fb6b969250cd7dd8 100644 (file)
@@ -242,6 +242,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
 
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    case PIPE_CAP_VENDOR_ID:
       return 0x10de;
    case PIPE_CAP_DEVICE_ID: {
index 6f3fdf3495147aa8ba21e9665466b38ad0dc4c59..cdd2771baa1a9383bf11b3c4c0866744faf90aaf 100644 (file)
@@ -296,6 +296,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
 
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    case PIPE_CAP_VENDOR_ID:
       return 0x10de;
    case PIPE_CAP_DEVICE_ID: {
index 8c1cd878bd0ab0b1ff340a348de2fc52b9ec71a3..0c3ade35170f8dabe0306ab8d822f18efaf1bdae 100644 (file)
@@ -269,6 +269,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return class_3d >= GM200_3D_CLASS;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    case PIPE_CAP_CONSERVATIVE_RASTER_PRE_SNAP_TRIANGLES:
       return class_3d >= GP100_3D_CLASS;
    case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
index 73e80f2dd4c1d0471fe907472ca309ba29d4eb74..8477379a2137f0281cc4918b87fbc9057cd2fb43 100644 (file)
@@ -264,6 +264,8 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 
         case PIPE_CAP_MAX_GS_INVOCATIONS:
             return 32;
+       case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+            return 1 << 27;
 
         /* SWTCL-only features. */
         case PIPE_CAP_PRIMITIVE_RESTART:
index 69cfb8028a800c2a3181080f3a77002ddd2522fd..cf9324df35d003ffdcbd5ee87821e90848be2789 100644 (file)
@@ -378,6 +378,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
 
        case PIPE_CAP_MAX_GS_INVOCATIONS:
                return 32;
+       case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+               return 1 << 27;
 
        /* Unsupported features. */
        case PIPE_CAP_TGSI_FS_COORD_ORIGIN_LOWER_LEFT:
index d27ce474b054406a9133ac07fbf40c74f5d2a4eb..e2e53514239c18abb176558dec48663ab694babc 100644 (file)
@@ -189,6 +189,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
                return 420;
 
        case PIPE_CAP_MAX_TEXTURE_BUFFER_SIZE:
+       case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
                return MIN2(sscreen->info.max_alloc_size, INT_MAX);
 
        case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
index 1fe807d81f16848f1ba8caa57503e580df19185d..984efb810f49967736f8ef48ac707724c8d457bc 100644 (file)
@@ -327,6 +327,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
    }
index 884aa595ae9184e09147f542c57ded9b5dd8df97..098d9d71b24b5a17106a997a3a9c76fbffc3bd75 100644 (file)
@@ -473,6 +473,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    }
 
    debug_printf("Unexpected PIPE_CAP_ query %u\n", param);
index f6d1f1c5f719b354b9d73e7c7c4262cb4934a7b2..53275939b9e1bf66eeac3c8ca24b5b9d0dc90a59 100644 (file)
@@ -364,6 +364,8 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
 
    case PIPE_CAP_VENDOR_ID:
       return 0xFFFFFFFF;
index e54e9802ecf392f200067b760670ebf8f6b82533..03e0195a9f3eb16f3a9052ad1118872167006995 100644 (file)
@@ -279,6 +279,8 @@ v3d_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
        case PIPE_CAP_MAX_GS_INVOCATIONS:
                 return 0;
+       case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+               return 1 << 27;
 
                 /* Texturing. */
         case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index 89ebc84477be721e4d98fc6d39017276cfb46fe6..0a10d898fe1022f41560c59e354d3eec7e023a61 100644 (file)
@@ -315,6 +315,8 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
        case PIPE_CAP_MAX_GS_INVOCATIONS:
                 return 0;
+       case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+               return 1 << 27;
 
                 /* Texturing. */
         case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index 257cc147bf83e82d8a25bf848997706e8238937a..d016d22670cec0970e9e6815561d3c27d62c485e 100644 (file)
@@ -310,6 +310,8 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 0;
    case PIPE_CAP_MAX_GS_INVOCATIONS:
       return 32;
+   case PIPE_CAP_MAX_SHADER_BUFFER_SIZE:
+      return 1 << 27;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
    case PIPE_CAP_DEVICE_ID:
index c008f9d66f25c30c154b09c4eb1ba506a4c5fefb..f7ca1a97709c6588e10da612e23abe796e1a3a1e 100644 (file)
@@ -816,6 +816,7 @@ enum pipe_cap
    PIPE_CAP_CONSERVATIVE_RASTER_POST_DEPTH_COVERAGE,
    PIPE_CAP_PROGRAMMABLE_SAMPLE_LOCATIONS,
    PIPE_CAP_MAX_GS_INVOCATIONS,
+   PIPE_CAP_MAX_SHADER_BUFFER_SIZE,
 };
 
 /**
index ba0e89c700ccd638531258e1601ef1dbbb28d0f7..8efd281eaad17b56ce2f7f8ac43d042d33516cd2 100644 (file)
@@ -468,7 +468,8 @@ void st_init_limits(struct pipe_screen *screen,
             c->MaxCombinedAtomicBuffers;
       c->MaxCombinedShaderOutputResources +=
          c->MaxCombinedShaderStorageBlocks;
-      c->MaxShaderStorageBlockSize = 1 << 27;
+      c->MaxShaderStorageBlockSize =
+         screen->get_param(screen, PIPE_CAP_MAX_SHADER_BUFFER_SIZE);
       extensions->ARB_shader_storage_buffer_object = GL_TRUE;
    }