gallium: add PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE and corresponding cap
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 26 Jul 2017 17:16:14 +0000 (19:16 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 2 Aug 2017 07:37:10 +0000 (09:37 +0200)
v2: rename cap to PIPE_CAP_QUERY_SO_OVERFLOW and be a bit more explicit
    in the documentation

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
21 files changed:
src/gallium/auxiliary/util/u_dump_defines.c
src/gallium/auxiliary/util/u_inlines.h
src/gallium/docs/source/context.rst
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_pipe.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/trace/tr_dump_state.c
src/gallium/drivers/vc4/vc4_screen.c
src/gallium/drivers/virgl/virgl_screen.c
src/gallium/include/pipe/p_defines.h

index 9d831efcf514c0727500db3785c296454e4ee9c8..9126febbd54a6179a45c5768e8d63ce6b88144c1 100644 (file)
@@ -372,6 +372,7 @@ util_dump_query_type_names[] = {
    "PIPE_QUERY_PRIMITIVES_EMITTED",
    "PIPE_QUERY_SO_STATISTICS",
    "PIPE_QUERY_SO_OVERFLOW_PREDICATE",
+   "PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE",
    "PIPE_QUERY_GPU_FINISHED",
    "PIPE_QUERY_PIPELINE_STATISTICS",
 };
index d57f61e954c720e2bff234213137fb51c03e77ff..e0ed594c9fedc5b88c4ef6f524e04509e3826c31 100644 (file)
@@ -537,6 +537,7 @@ util_query_clear_result(union pipe_query_result *result, unsigned type)
    switch (type) {
    case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+   case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
    case PIPE_QUERY_GPU_FINISHED:
       result->b = FALSE;
       break;
index a46131c31fe2aeebcf6fa33a401db17fbc45acc5..7002802248e75c8c5c9e8e3ae49fb9615e0a6b7d 100644 (file)
@@ -428,9 +428,17 @@ XXX the 2nd value is equivalent to ``PIPE_QUERY_PRIMITIVES_GENERATED`` but it is
 unclear if it should be increased if stream output is not active.
 
 ``PIPE_QUERY_SO_OVERFLOW_PREDICATE`` returns a boolean value indicating
-whether the stream output targets have overflowed as a result of the
+whether a selected stream output target has overflowed as a result of the
 commands issued between ``begin_query`` and ``end_query``.
-This query can be used with ``render_condition``.
+This query can be used with ``render_condition``. The output stream is
+selected by the stream number passed to ``create_query``.
+
+``PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE`` returns a boolean value indicating
+whether any stream output target has overflowed as a result of the commands
+issued between ``begin_query`` and ``end_query``. This query can be used
+with ``render_condition``, and its result is the logical OR of multiple
+``PIPE_QUERY_SO_OVERFLOW_PREDICATE`` queries, one for each stream output
+target.
 
 ``PIPE_QUERY_GPU_FINISHED`` returns a boolean value indicating whether
 all commands issued before ``end_query`` have completed. However, this
index ee7accba5e966ec62c764b226a110c2856a4a1dc..5c5c7909f0d46c281f0796ce76a4f4f694a8c27b 100644 (file)
@@ -398,6 +398,11 @@ The integer capabilities:
   supported.
 * ``PIPE_CAP_NIR_SAMPLERS_AS_DEREF``: Whether NIR tex instructions should
   reference texture and sampler as NIR derefs instead of by indices.
+* ``PIPE_CAP_QUERY_SO_OVERFLOW``: Whether the
+  ``PIPE_QUERY_SO_OVERFLOW_PREDICATE`` and
+  ``PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE`` query types are supported. Note that
+  for a driver that does not support multiple output streams (i.e.,
+  ``PIPE_CAP_MAX_VERTEX_STREAMS`` is 1), both query types are identical.
 
 
 .. _pipe_capf:
index 0e3d5d84cf219834344b7429061ada6d272e9a86..65aab838682131312e3dba1bdd668132900f52f4 100644 (file)
@@ -261,6 +261,7 @@ etna_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
 
    /* Stream output. */
index c5772d25ce834cace8db4ebfdf7924b5afa2b115..2a1b1e7be1f73712e82717c25900b0c329e531f8 100644 (file)
@@ -322,6 +322,7 @@ fd_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
        case PIPE_CAP_POST_DEPTH_COVERAGE:
        case PIPE_CAP_BINDLESS_TEXTURE:
        case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+       case PIPE_CAP_QUERY_SO_OVERFLOW:
                return 0;
 
        case PIPE_CAP_MAX_VIEWPORTS:
index 3a0dade81f6fd00749e8667807455f2588e43b92..f16141b9b8b3269dc755556c32958df7920281ab 100644 (file)
@@ -311,6 +311,7 @@ i915_get_param(struct pipe_screen *screen, enum pipe_cap cap)
    case PIPE_CAP_ALLOW_MAPPED_BUFFERS_DURING_EXECUTION:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
 
    case PIPE_CAP_MAX_VIEWPORTS:
index 08edc087d28e8b1d332be86b87349b2f745c8aad..fc4441f04e198621a0681d9323b570fdbb06ecd4 100644 (file)
@@ -357,6 +357,7 @@ llvmpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
    }
    /* should only get here on unhandled cases */
index 570a5d459a21482c8b0558635d315be939d70f27..0b2e35b67a48b802f51152c62e9bd4e7a2fbca54 100644 (file)
@@ -221,6 +221,7 @@ nv30_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index fbda514fa3eb30da50277ce4d7e29df301445dc4..8862967a9c3e3cdc8576c6a991739b93c16bff9a 100644 (file)
@@ -273,6 +273,7 @@ nv50_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 6a7a57538e26d668be097dc835b534b4d421e464..3b3b38174dfe13bbf66aedc14e546917b449b019 100644 (file)
@@ -302,6 +302,7 @@ nvc0_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
    case PIPE_CAP_SPARSE_BUFFER_PAGE_SIZE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index a994a05b5dc910073bc0c49d58520e38c8949902..c78c484b82cb8022418f17c1589cea4c80310758 100644 (file)
@@ -243,6 +243,7 @@ static int r300_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
         case PIPE_CAP_POST_DEPTH_COVERAGE:
         case PIPE_CAP_BINDLESS_TEXTURE:
         case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+        case PIPE_CAP_QUERY_SO_OVERFLOW:
             return 0;
 
         /* SWTCL-only features. */
index f09e46833f2fff40c2f3e79d0e577b74b2163850..0f30d0985c1193045a63416c5390c898d14a4570 100644 (file)
@@ -399,6 +399,7 @@ static int r600_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_POST_DEPTH_COVERAGE:
        case PIPE_CAP_BINDLESS_TEXTURE:
        case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+       case PIPE_CAP_QUERY_SO_OVERFLOW:
                return 0;
 
        case PIPE_CAP_DOUBLES:
index 877c23bcb2da6121aa94931c696273f147525aeb..2904127eefb630cf794f020c78aaf51193d04607 100644 (file)
@@ -603,6 +603,7 @@ static int si_get_param(struct pipe_screen* pscreen, enum pipe_cap param)
        case PIPE_CAP_UMA:
        case PIPE_CAP_POLYGON_MODE_FILL_RECTANGLE:
        case PIPE_CAP_POST_DEPTH_COVERAGE:
+       case PIPE_CAP_QUERY_SO_OVERFLOW:
                return 0;
 
        case PIPE_CAP_QUERY_BUFFER_OBJECT:
index 6ed2ce12b5e34426ecfd5b095161e9ba442cf795..5b387bbfc57a6d9b4d6ad6b8e84f514138477108 100644 (file)
@@ -307,6 +307,7 @@ softpipe_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
    case PIPE_CAP_SHADER_BUFFER_OFFSET_ALIGNMENT:
       return 4;
index fd849db38c777be32ee4abfb96f094d707d2a927..9849fe375916ed1185f824f9ad374b6aab5b0b31 100644 (file)
@@ -451,6 +451,7 @@ svga_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
    }
 
index f44f5832a199375a518501e4d955bbe5d010b08c..1013403147947921a1462a17b66f7c983a818047 100644 (file)
@@ -340,6 +340,7 @@ swr_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
 
    case PIPE_CAP_VENDOR_ID:
index 41f7faf513b0618819105372cc79946f28254452..0650f63d26627d3a6ff2ba072ec5aac65ec8f7c7 100644 (file)
@@ -879,6 +879,7 @@ trace_dump_query_result(unsigned query_type,
    switch (query_type) {
    case PIPE_QUERY_OCCLUSION_PREDICATE:
    case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
+   case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
    case PIPE_QUERY_GPU_FINISHED:
       trace_dump_bool(result->b);
       break;
index f5e913a87ded119a63a9c628c1061545f672c044..8a5c0fdee8841b7b59d2397b89a207f112563de5 100644 (file)
@@ -262,6 +262,7 @@ vc4_screen_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
         case PIPE_CAP_POST_DEPTH_COVERAGE:
         case PIPE_CAP_BINDLESS_TEXTURE:
         case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+        case PIPE_CAP_QUERY_SO_OVERFLOW:
                 return 0;
 
                 /* Stream output. */
index bad57e07b95494061ec44a2bee098d6afab571d4..d23df42b988975f9e185c4ad60ee527bc95e7fcb 100644 (file)
@@ -266,6 +266,7 @@ virgl_get_param(struct pipe_screen *screen, enum pipe_cap param)
    case PIPE_CAP_POST_DEPTH_COVERAGE:
    case PIPE_CAP_BINDLESS_TEXTURE:
    case PIPE_CAP_NIR_SAMPLERS_AS_DEREF:
+   case PIPE_CAP_QUERY_SO_OVERFLOW:
       return 0;
    case PIPE_CAP_VENDOR_ID:
       return 0x1af4;
index b39612f10fb4bcb8c34096ec6f4b12f6d76bd42c..5a5b03c6ca713c4cecc0788b96a9b064658065d9 100644 (file)
@@ -546,6 +546,7 @@ enum pipe_query_type {
    PIPE_QUERY_PRIMITIVES_EMITTED,
    PIPE_QUERY_SO_STATISTICS,
    PIPE_QUERY_SO_OVERFLOW_PREDICATE,
+   PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE,
    PIPE_QUERY_GPU_FINISHED,
    PIPE_QUERY_PIPELINE_STATISTICS,
    PIPE_QUERY_TYPES,
@@ -781,6 +782,7 @@ enum pipe_cap
    PIPE_CAP_POST_DEPTH_COVERAGE,
    PIPE_CAP_BINDLESS_TEXTURE,
    PIPE_CAP_NIR_SAMPLERS_AS_DEREF,
+   PIPE_CAP_QUERY_SO_OVERFLOW,
 };
 
 #define PIPE_QUIRK_TEXTURE_BORDER_COLOR_SWIZZLE_NV50 (1 << 0)
@@ -952,6 +954,7 @@ union pipe_query_result
 {
    /* PIPE_QUERY_OCCLUSION_PREDICATE */
    /* PIPE_QUERY_SO_OVERFLOW_PREDICATE */
+   /* PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE */
    /* PIPE_QUERY_GPU_FINISHED */
    boolean b;