gallium: add cap for MAX_VERTEX_ATTRIB_STRIDE
authorTimothy Arceri <t_arceri@yahoo.com.au>
Wed, 20 Aug 2014 07:09:58 +0000 (21:09 -1000)
committerTimothy Arceri <t_arceri@yahoo.com.au>
Thu, 28 Aug 2014 06:35:59 +0000 (20:35 -1000)
Signed-off-by: Timothy Arceri <t_arceri@yahoo.com.au>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
16 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
src/mesa/state_tracker/st_extensions.c

index eee254e473aa7e573233c838412fab0bb2ec3eab..13bf705a87d196e2034ede9920b86c42eb98c290 100644 (file)
@@ -225,6 +225,7 @@ The integer capabilities:
   memory and GART.
 * ``PIPE_CAP_CONDITIONAL_RENDER_INVERTED``: Whether the driver supports inverted
   condition for conditional rendering.
+* ``PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE``: The maximum supported vertex stride.
 
 
 .. _pipe_capf:
index ab1a7402120783983bdedcbcec75b51db9cda1ba..34594aebc4fff11e546ad1472c0bd4116dc23fbd 100644 (file)
@@ -233,6 +233,9 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_VERTEX_STREAMS:
                return 0;
 
+       case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+               return 2048;
+
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
        case PIPE_CAP_MAX_TEXTURE_3D_LEVELS:
index 40976b3cb7d0578227bfc527698929b52a0c6638..24e444f1ca49fcd9ef06f42ee939c1f997c97dcc 100644 (file)
@@ -275,6 +275,9 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 0;
 
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
+
    /* Fragment coordinate conventions. */
    case PIPE_CAP_TGSI_FS_COORD_ORIGIN_UPPER_LEFT:
    case PIPE_CAP_TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER:
index 1ab14cffaf72c8e041d11d9eba6f82497b424842..3f997a11dac3dfcf8254167bc4e326eda09be766 100644 (file)
@@ -382,6 +382,8 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
    case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
       return false;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    case PIPE_CAP_COMPUTE:
       return false; /* TODO */
    case PIPE_CAP_USER_INDEX_BUFFERS:
index 74707a6ce2b2fbad93a3efd057ab7c583f8e942f..b1749c0187a6488f1f128e79178c4144119c94b0 100644 (file)
@@ -196,6 +196,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1024;
    case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 1;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
       return 1;
    case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
index 80d6943dd32794ad7d96ff0a74195ba705c758fb..036ce9ea473ad74e19379ef8cd925aca363c3f50 100644 (file)
@@ -71,6 +71,8 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 16;
    case PIPE_CAP_MAX_VIEWPORTS:
       return 1;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    /* supported capabilities */
    case PIPE_CAP_TWO_SIDED_STENCIL:
    case PIPE_CAP_ANISOTROPIC_FILTER:
index 99dcdc59258f90771e0dd3e90d11971acb320c6a..abc34070d20eda5d49a1e1f2707f2622c03b4a6c 100644 (file)
@@ -117,6 +117,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 1024;
    case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 1;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
       return 256;
    case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
index 84025ef976f5e5d8d9b9fd8358f994a019ecf277..5416ef919f775a23b2b9250a77fa6104a7fb7006 100644 (file)
@@ -104,6 +104,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
       return 1024;
    case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 4;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
       return 256;
    case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
index f8a7ef1b17ce49484762ffa2e4681260e9b9f8e1..b4ccbeee35c78cc3558a837f52e6786f6c032772 100644 (file)
@@ -211,6 +211,9 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_VIEWPORTS:
             return 1;
 
+        case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+            return 2048;
+
         case PIPE_CAP_VENDOR_ID:
                 return 0x1002;
         case PIPE_CAP_DEVICE_ID:
index e02c053deb00de7d631f7dafac055ef36b5c7587..566e724d02bf58a0d59265c31182b637bd5302d2 100644 (file)
@@ -339,6 +339,9 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_VERTEX_STREAMS:
                return 1;
 
+       case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+               return 2047;
+
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
        case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
index ae1d043e83942ff30e1a543ec0654ff256d8d379..6c0011238ed5ccf5ebd86a36b36eaaefc80c8140 100644 (file)
@@ -278,6 +278,9 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_MAX_VERTEX_STREAMS:
                return 1;
 
+       case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+               return 2048;
+
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
        case PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS:
index be9a6c8c77b98c8f310af767c8110b1e91c5336c..f6fddfe66c123c80fa4d97a7b3d91cf0f2d8f74b 100644 (file)
@@ -123,6 +123,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 1024;
    case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 1;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    case PIPE_CAP_PRIMITIVE_RESTART:
       return 1;
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
index 544d9295b68695ebc58ae6e6dd56074596e3c8a2..edd0a39c105188648cebaacbc22cfa44ccb6a7da 100644 (file)
@@ -285,6 +285,8 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return 64;
    case PIPE_CAP_VERTEX_ELEMENT_SRC_OFFSET_4BYTE_ALIGNED_ONLY:
       return 1;
+   case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+      return 2048;
    case PIPE_CAP_MAX_VIEWPORTS:
       return 1;
    case PIPE_CAP_ENDIANNESS:
index c28481564b02ff0e3ecd62f8dfcf6784399f1836..46cd4c55b971c9cab3fdd5306c3e2b8f8bb647d2 100644 (file)
@@ -195,6 +195,9 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_MIN_TEXEL_OFFSET:
                 return 0;
 
+        case PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE:
+                return 2048;
+
         case PIPE_CAP_ENDIANNESS:
                 return PIPE_ENDIAN_LITTLE;
 
index 04e47986fdd12d6616a495693650fc3f3703ba9c..aae8229a4e2e7f74dd9ae4237149c3d2f4865e93 100644 (file)
@@ -569,6 +569,7 @@ enum pipe_cap {
    PIPE_CAP_VIDEO_MEMORY = 106,
    PIPE_CAP_UMA = 107,
    PIPE_CAP_CONDITIONAL_RENDER_INVERTED = 108,
+   PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE = 109,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
index 4110eb5dd5fec3663c291c45cef4073abc642dbf..9db648c036f26035159df4089f79e146863c7e63 100644 (file)
@@ -289,6 +289,9 @@ void st_init_limits(struct pipe_screen *screen,
    /* The vertex stream must fit into pipe_stream_output_info::stream */
    assert(c->MaxVertexStreams <= 4);
 
+   c->MaxVertexAttribStride
+      = screen->get_param(screen, PIPE_CAP_MAX_VERTEX_ATTRIB_STRIDE);
+
    c->StripTextureBorder = GL_TRUE;
 
    c->GLSLSkipStrictMaxUniformLimitCheck =