gallium: add PIPE_CAP_SHAREABLE_SHADERS
authorMarek Olšák <marek.olsak@amd.com>
Sun, 27 Sep 2015 19:02:15 +0000 (21:02 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 20 Oct 2015 10:51:51 +0000 (12:51 +0200)
I'll let drivers figure out how to do it.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
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/drivers/vc4/vc4_screen.c
src/gallium/include/pipe/p_defines.h

index e08844b2f0bfbbf0148273823dd6ba0bd5813d75..72f7596886dd26109e4a20d7abe89f693d31e7ea 100644 (file)
@@ -276,6 +276,8 @@ The integer capabilities:
   GL4 hardware will likely need to emulate it with a shader variant, or by
   selecting the interpolation weights with a conditional assignment
   in the shader.
+* ``PIPE_CAP_SHAREABLE_SHADERS``: Whether shader CSOs can be used by any
+  pipe_context.
 
 
 
index b64f78ca32b699045dedc6ad7156b5ba0f20eb3b..f85e4586413e65feda695c230e91362033fc0c9b 100644 (file)
@@ -237,6 +237,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_DEPTH_BOUNDS_TEST:
        case PIPE_CAP_TGSI_TXQS:
        case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+       case PIPE_CAP_SHAREABLE_SHADERS:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 9d6b3d391839bb06fbd845d44f226fc30c3770d5..c91408d3d9bfe3ee797101bc492f5792e6445f9e 100644 (file)
@@ -249,6 +249,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_DEPTH_BOUNDS_TEST:
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
 
    case PIPE_CAP_MAX_DUAL_SOURCE_RENDER_TARGETS:
index 76812a666a07d69977345104250745094c3617aa..acf688fc02c13b3d4a75751a90c88b2469749509 100644 (file)
@@ -471,6 +471,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_DEPTH_BOUNDS_TEST:
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 50c3781f5f84b83e4a9fe4e02de75bd2c975a478..e2ed267da7899d27ada1721b91e9dfb9127ac03e 100644 (file)
@@ -298,6 +298,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_DEPTH_BOUNDS_TEST:
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
    }
    /* should only get here on unhandled cases */
index 335c163b66187111ea2c36f435727f54c801ce82..d4cf143b9a35ddc54e03d603d966c84cb3d13dd4 100644 (file)
@@ -171,6 +171,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_TEXTURE_HALF_FLOAT_LINEAR:
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 812b246ea0e00c23970218fae667077fcc7a53ef..a4431f20e14c04756275c47485775cecf78e66bf 100644 (file)
@@ -216,6 +216,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index f34ad0ed5d1914d54b1addc80214028790996957..d34c8a2b07b79285a75bdf8d59bdbd1636e883a8 100644 (file)
@@ -202,6 +202,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_RESOURCE_FROM_USER_MEMORY:
    case PIPE_CAP_DEVICE_RESET_STATUS_QUERY:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 1165ac8a9c02d201101d167ef24a92c8954e60e0..c1c522b0a3a81613061f94ed1aa78d4a5decbd28 100644 (file)
@@ -197,6 +197,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_DEPTH_BOUNDS_TEST:
         case PIPE_CAP_TGSI_TXQS:
         case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+        case PIPE_CAP_SHAREABLE_SHADERS:
             return 0;
 
         /* SWTCL-only features. */
index 32ce76a9e0788f49ed81822225f2cba37ce9ddbc..75de553be2babc72652d7cbaa49384b8ba1c7484 100644 (file)
@@ -343,6 +343,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
        case PIPE_CAP_DEPTH_BOUNDS_TEST:
        case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+       case PIPE_CAP_SHAREABLE_SHADERS:
                return 0;
 
        /* Stream output. */
index 6be78afe4a9b008ca5cddc22c4b039af7235b8c5..37e793a22047c54e107224c16344b4d8b5e724f1 100644 (file)
@@ -337,6 +337,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_FAKE_SW_MSAA:
        case PIPE_CAP_TEXTURE_GATHER_OFFSETS:
        case PIPE_CAP_VERTEXID_NOBASE:
+       case PIPE_CAP_SHAREABLE_SHADERS:
                return 0;
 
        case PIPE_CAP_MAX_SHADER_PATCH_VARYINGS:
index d468cf4de5485158bd37c7823a84f8111871e125..e7006d2fa0da91a5acb1f38833c1305b03c2ebd8 100644 (file)
@@ -248,6 +248,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_DEPTH_BOUNDS_TEST:
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
    }
    /* should only get here on unhandled cases */
index dab898143348eae969adf5629d687ebbf45aa982..9bf661fab8c994607667ac6a1ca5025069ca8624 100644 (file)
@@ -381,6 +381,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_DEPTH_BOUNDS_TEST:
    case PIPE_CAP_TGSI_TXQS:
    case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+   case PIPE_CAP_SHAREABLE_SHADERS:
       return 0;
    }
 
index 739ac86193a2be049ed3131bb03e8e8515ad883f..3b12464a2f651a4e2e7de3a12afd48a94028998c 100644 (file)
@@ -182,6 +182,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_DEPTH_BOUNDS_TEST:
        case PIPE_CAP_TGSI_TXQS:
        case PIPE_CAP_FORCE_PERSAMPLE_INTERP:
+       case PIPE_CAP_SHAREABLE_SHADERS:
                 return 0;
 
                 /* Stream output. */
index a4947154f17e1c283ff9697bef0d3738cc7be278..3a1265dcc22927743672f29b8ba0f77eac6a3375 100644 (file)
@@ -632,6 +632,7 @@ enum pipe_cap
    PIPE_CAP_DEPTH_BOUNDS_TEST,
    PIPE_CAP_TGSI_TXQS,
    PIPE_CAP_FORCE_PERSAMPLE_INTERP,
+   PIPE_CAP_SHAREABLE_SHADERS,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)