gallium: add a cap for max vertex streams
authorIlia Mirkin <imirkin@alum.mit.edu>
Fri, 27 Jun 2014 00:01:50 +0000 (20:01 -0400)
committerIlia Mirkin <imirkin@alum.mit.edu>
Tue, 1 Jul 2014 15:34:35 +0000 (11:34 -0400)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
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/include/pipe/p_defines.h
src/mesa/state_tracker/st_extensions.c

index 1a80b04942949c9b82093bbaedc3d40ce201abdc..5e01df50875ca7827697c0751890c1270ec9243b 100644 (file)
@@ -205,6 +205,9 @@ The integer capabilities:
 * ``PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION``: Whether
   TGSI_PROPERTY_VS_WINDOW_SPACE_POSITION is supported, which disables clipping
   and viewport transformation.
+* ``PIPE_CAP_MAX_VERTEX_STREAMS``: The maximum number of vertex streams
+  supported by the geometry shader. If stream-out is supported, this should be
+  at least 1. If stream-out is not supported, this should be 0.
 
 
 .. _pipe_capf:
index e7a185df00dcfe98e94de313ff19babad7e9ad1b..9200962fc3cfabf485ebceefca95bbafcd25d32c 100644 (file)
@@ -227,6 +227,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        /* Geometry shader output, unsupported. */
        case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
        case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+       case PIPE_CAP_MAX_VERTEX_STREAMS:
                return 0;
 
        /* Texturing. */
index 79d8659522a3327c0d5c1de86cc2c930ee56fc1b..036f706bccd5ae73de7edeb841ca2b0c80054f41 100644 (file)
@@ -270,6 +270,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    /* Geometry shader output, unsupported. */
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 0;
 
    /* Fragment coordinate conventions. */
index b08ae206a7d8c818ca496c4e33e1f2d5a6cfba26..8f8e1527934dda3ed26377fe963faf7aacb1e312 100644 (file)
@@ -375,6 +375,7 @@ ilo_get_param(struct pipe_screen *screen, enum pipe_cap param)
       return ILO_MAX_SO_BINDINGS;
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
       return 0;
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
       if (is->dev.gen >= ILO_GEN(7))
index a6b712a81267b9444b23bae99eaf34724ce25c0b..26ab2946af3b6a78c7da037228b0931f9d9f1746 100644 (file)
@@ -192,6 +192,8 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
       return 1024;
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
+      return 1;
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
       return 1;
    case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
index 5c3d7838d62917e647320127a596e83d33576f23..c79626b67feb541f3f8cb36b1453d431f01ab26a 100644 (file)
@@ -117,6 +117,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
    case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
    case PIPE_CAP_TEXTURE_BARRIER:
    case PIPE_CAP_SEAMLESS_CUBE_MAP:
index c09a8c6cad9ac883f54c0683217b6d63e97d77ae..40ad4a4cc3b626a59dafb175c22391dd722c7368 100644 (file)
@@ -116,6 +116,8 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
       return 1024;
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
+      return 1;
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
       return 256;
    case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
index 52a067e3ad94c567343da83b3e7071ef1cd217ef..510368b9b833c553ca779b1fb2e959c6427ab623 100644 (file)
@@ -103,6 +103,8 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
       return 1024;
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
+      return 1;
    case PIPE_CAP_CONSTANT_BUFFER_OFFSET_ALIGNMENT:
       return 256;
    case PIPE_CAP_TEXTURE_BUFFER_OFFSET_ALIGNMENT:
index d4bb6abd71d4fd4f6cf470f71f6482564569989f..bcd0e8ed818db2743c63f2c9f913622591917289 100644 (file)
@@ -156,6 +156,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS:
         case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
         case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+        case PIPE_CAP_MAX_VERTEX_STREAMS:
         case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
         case PIPE_CAP_FRAGMENT_COLOR_CLAMPED:
         case PIPE_CAP_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION:
index 6f87c78bdd0def00a3a893022466a359b5ac4eff..78a85ab86ffbd50996c3b0ab58d8877977086c4f 100644 (file)
@@ -333,6 +333,8 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return 1024;
        case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
                return 16384;
+       case PIPE_CAP_MAX_VERTEX_STREAMS:
+               return 1;
 
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index 07f429164d73574c1daec34b067e6091621d18dc..d4dfdd6917460220c240ee9238775a86cfd8290c 100644 (file)
@@ -271,6 +271,8 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
                return 1024;
        case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
                return 4095;
+       case PIPE_CAP_MAX_VERTEX_STREAMS:
+               return 1;
 
        /* Texturing. */
        case PIPE_CAP_MAX_TEXTURE_2D_LEVELS:
index d82fed91d4a8913fc1c8558be8102d184373cb87..ee3e0f2aef62c833e8aebaca3cb7973ff914fdc9 100644 (file)
@@ -120,6 +120,8 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
       return 1024;
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
+      return 1;
    case PIPE_CAP_PRIMITIVE_RESTART:
       return 1;
    case PIPE_CAP_SHADER_STENCIL_EXPORT:
index 4e1e3316bca550fd07fdd600adabf01c01b40226..0e88132ccc307430b6b930dce1ee42c697cb30d5 100644 (file)
@@ -255,6 +255,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_STREAM_OUTPUT_PAUSE_RESUME:
    case PIPE_CAP_MAX_GEOMETRY_OUTPUT_VERTICES:
    case PIPE_CAP_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS:
+   case PIPE_CAP_MAX_VERTEX_STREAMS:
    case PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS:
    case PIPE_CAP_VERTEX_BUFFER_OFFSET_4BYTE_ALIGNED_ONLY:
    case PIPE_CAP_VERTEX_BUFFER_STRIDE_4BYTE_ALIGNED_ONLY:
index 90f64934afee8a5307e3e522468f6ce8e2cbf0e1..702bb0b830b9aade1b0706828237d083c2567247 100644 (file)
@@ -558,7 +558,8 @@ enum pipe_cap {
    PIPE_CAP_MAX_TEXTURE_GATHER_OFFSET = 96,
    PIPE_CAP_SAMPLE_SHADING = 97,
    PIPE_CAP_TEXTURE_GATHER_OFFSETS = 98,
-   PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION = 99
+   PIPE_CAP_TGSI_VS_WINDOW_SPACE_POSITION = 99,
+   PIPE_CAP_MAX_VERTEX_STREAMS = 100,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
index e938046892a458ae3df0f23ac72549bcfc648dc3..3b6681ea65b1623e618aeca350c7612bc463b70c 100644 (file)
@@ -287,6 +287,11 @@ void st_init_limits(struct st_context *st)
       screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_SEPARATE_COMPONENTS);
    c->MaxTransformFeedbackInterleavedComponents =
       screen->get_param(screen, PIPE_CAP_MAX_STREAM_OUTPUT_INTERLEAVED_COMPONENTS);
+   c->MaxVertexStreams =
+      MAX2(1, screen->get_param(screen, PIPE_CAP_MAX_VERTEX_STREAMS));
+
+   /* The vertex stream must fit into pipe_stream_output_info::stream */
+   assert(c->MaxVertexStreams <= 4);
 
    c->StripTextureBorder = GL_TRUE;