gallium: add packed uniform CAP
authorTimothy Arceri <tarceri@itsqueeze.com>
Fri, 18 Aug 2017 05:51:48 +0000 (15:51 +1000)
committerTimothy Arceri <tarceri@itsqueeze.com>
Tue, 20 Mar 2018 03:17:34 +0000 (14:17 +1100)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
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/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
src/mesa/state_tracker/st_context.c

index e375d67a4b62ff7f2e912e0792ee4a25575fea0c..3837360fb40c0a9e98b69b84e343ae8f3a771f34 100644 (file)
@@ -418,6 +418,8 @@ The integer capabilities:
   set when binding that buffer as constant buffer 0. If the buffer doesn't have
   those bits set, pipe_context::set_constant_buffer(.., 0, ..) is ignored
   by the driver, and the driver can throw assertion failures.
+* ``PIPE_CAP_PACKED_UNIFORMS``: True if the driver supports packed uniforms
+  as opposed to padding to vec4s.
 
 
 .. _pipe_capf:
index 6c5c00bf2d58e84e02ea24a592721a35bdc41519..2ae4e86c6315d3fbad0da224f35c4c3638c6359d 100644 (file)
@@ -269,6 +269,7 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
 
    /* Stream output. */
index f9cafbabeb308029e948ad6716d61d048f4cc8d0..f338d756dfef1572b6e870b0435e05562a1a684d 100644 (file)
@@ -339,6 +339,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_SIGNED_VERTEX_BUFFER_OFFSET:
        case PIPE_CAP_FENCE_SIGNAL:
        case PIPE_CAP_CONSTBUF0_FLAGS:
+       case PIPE_CAP_PACKED_UNIFORMS:
                return 0;
 
        case PIPE_CAP_CONTEXT_PRIORITY_MASK:
index 345e82b573eeef968b14a17728fa8cd5c08b2a52..59d2ec662840177e855eef0f6f5546b87b268abc 100644 (file)
@@ -326,6 +326,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
 
    case PIPE_CAP_MAX_VIEWPORTS:
index 01ef348e3b0b45726200bc34c6458bfe8787c4eb..3f5d0327bf9bcedf32aa67c4b929e423189409be 100644 (file)
@@ -361,6 +361,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
    }
    /* should only get here on unhandled cases */
index d7fcff16fb64f05dccadb8012347dcce09c9d525..1d1fbaad6077690cc60d6d0536bb8daf21b77e47 100644 (file)
@@ -228,6 +228,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index a9a4dde508a157f4d78a2eaef30cff4353a98066..6fd2982e3cbdff05e532af0b5eb45eb6916db635 100644 (file)
@@ -280,6 +280,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 2052e84b586dbf1c3c1724634d56be1c2a0995bf..b4a2c676f59485b42f15e036ea8fd14b8e3fd7be 100644 (file)
@@ -308,6 +308,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index fdfc5cf64d23182380a869807e0b7b4298f6a9dd..8ea2e87ce681c69283ac2a24ac2425648540de49 100644 (file)
@@ -250,6 +250,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_CONTEXT_PRIORITY_MASK:
         case PIPE_CAP_FENCE_SIGNAL:
         case PIPE_CAP_CONSTBUF0_FLAGS:
+        case PIPE_CAP_PACKED_UNIFORMS:
             return 0;
 
         /* SWTCL-only features. */
index 1f81b70c628ed312cd1ac734c5e5b9c450467725..43f2dfae7ec57abad4c408993798e5ce0f5e370e 100644 (file)
@@ -414,6 +414,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_CONTEXT_PRIORITY_MASK:
        case PIPE_CAP_FENCE_SIGNAL:
        case PIPE_CAP_CONSTBUF0_FLAGS:
+       case PIPE_CAP_PACKED_UNIFORMS:
                return 0;
 
        case PIPE_CAP_DOUBLES:
index e9657602f371dc311be922ba00603e4d1be08ffa..323700d425076de065180b1d39235877b4910f1f 100644 (file)
@@ -269,6 +269,7 @@ static int si_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_TILE_RASTER_ORDER:
        case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
        case PIPE_CAP_CONTEXT_PRIORITY_MASK:
+       case PIPE_CAP_PACKED_UNIFORMS:
                return 0;
 
        case PIPE_CAP_FENCE_SIGNAL:
index 12824a8c28fb3658204268e52d5be2436c8bc94c..25f6f74f3668a44dc8595d3d5e15bd99102f8e3d 100644 (file)
@@ -313,6 +313,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index 0c55112a37b8c61b728b38f3ebcc775b989bf82e..f5f07fa75eb10a9127393b3cf9c4060b9e2ed109 100644 (file)
@@ -451,6 +451,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
    }
 
index 55f8d4b5cf019703868cde2ed91e7dbf35e1101c..dd2d003d15df22a3095d033d530d69976d24f6f0 100644 (file)
@@ -346,6 +346,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 397be545d9a047816064f590241d45e6be0730c8..cead71b77cda444d21a1a5ba1e9b77c29b388383 100644 (file)
@@ -288,6 +288,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_CONTEXT_PRIORITY_MASK:
         case PIPE_CAP_FENCE_SIGNAL:
        case PIPE_CAP_CONSTBUF0_FLAGS:
+        case PIPE_CAP_PACKED_UNIFORMS:
                 return 0;
 
                 /* Stream output. */
index 5d63fb6ec0b299bd02dee76b0bc20bc35a7501f2..5f505c9a3d52662641d7f891cc59e5de50d82af4 100644 (file)
@@ -260,6 +260,7 @@ vc5_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_COMBINED_SHADER_OUTPUT_RESOURCES:
         case PIPE_CAP_CONTEXT_PRIORITY_MASK:
        case PIPE_CAP_CONSTBUF0_FLAGS:
+        case PIPE_CAP_PACKED_UNIFORMS:
                 return 0;
 
                 /* Geometry shader output, unsupported. */
index 49a0c57cda9687d2610e7b50738ebe5e75ea9cda..1878def4745b7efce06ac0ea222cd2634f02d62d 100644 (file)
@@ -274,6 +274,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_CONTEXT_PRIORITY_MASK:
    case PIPE_CAP_FENCE_SIGNAL:
    case PIPE_CAP_CONSTBUF0_FLAGS:
+   case PIPE_CAP_PACKED_UNIFORMS:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index ed8eeb89f9273457aed070d4ed0667f5093ef1e8..c4ae053206021843bff98584e234782b03529347 100644 (file)
@@ -794,6 +794,7 @@ enum pipe_cap
    PIPE_CAP_CONTEXT_PRIORITY_MASK,
    PIPE_CAP_FENCE_SIGNAL,
    PIPE_CAP_CONSTBUF0_FLAGS,
+   PIPE_CAP_PACKED_UNIFORMS,
 };
 
 /**
index dfdd92f31b0bfcc1711646d1f76b7f9309b2df5d..de30905dd2248dc23781e6f4e3d17bb1a875b337 100644 (file)
@@ -433,6 +433,9 @@ st_create_context_priv(struct gl_context *ctx, struct pipe_context *pipe,
    if (no_error)
       ctx->Const.ContextFlags |= GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR;
 
+   ctx->Const.PackedDriverUniformStorage =
+      screen->get_param(screen, PIPE_CAP_PACKED_UNIFORMS);
+
    st->has_stencil_export =
       screen->get_param(screen, PIPE_CAP_SHADER_STENCIL_EXPORT);
    st->has_shader_model3 = screen->get_param(screen, PIPE_CAP_SM3);