[Mesa-dev] [PATCH 1/2] softpipe: enable PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE

Ilia Mirkin imirkin at alum.mit.edu
Tue Aug 15 15:32:56 UTC 2017


On Tue, Aug 15, 2017 at 11:27 AM,  <sroland at vmware.com> wrote:
> From: Roland Scheidegger <sroland at vmware.com>
>
> The driver was supposed to support this since way before the GL spec for it
> existed, albeit it was apparently broken, so fix and enable it.
> ---
>  docs/features.txt                        | 2 +-
>  src/gallium/drivers/softpipe/sp_query.c  | 8 +++++++-
>  src/gallium/drivers/softpipe/sp_screen.c | 3 ++-
>  3 files changed, 10 insertions(+), 3 deletions(-)
>
> diff --git a/docs/features.txt b/docs/features.txt
> index ac7645d..ace4669 100644
> --- a/docs/features.txt
> +++ b/docs/features.txt
> @@ -232,7 +232,7 @@ GL 4.6, GLSL 4.60
>    GL_ARB_shader_group_vote                              DONE (i965, nvc0, radeonsi)
>    GL_ARB_spirv_extensions                               in progress (Nicolai Hähnle, Ian Romanick)
>    GL_ARB_texture_filter_anisotropic                     not started
> -  GL_ARB_transform_feedback_overflow_query              DONE (i965/gen6+, radeonsi)
> +  GL_ARB_transform_feedback_overflow_query              DONE (i965/gen6+, radeonsi, softpipe)
>    GL_KHR_no_error                                       started (Timothy Arceri)
>
>  These are the extensions cherry-picked to make GLES 3.1
> diff --git a/src/gallium/drivers/softpipe/sp_query.c b/src/gallium/drivers/softpipe/sp_query.c
> index bec0116..b174aef 100644
> --- a/src/gallium/drivers/softpipe/sp_query.c
> +++ b/src/gallium/drivers/softpipe/sp_query.c
> @@ -63,6 +63,7 @@ softpipe_create_query(struct pipe_context *pipe,
>            type == PIPE_QUERY_TIME_ELAPSED ||
>            type == PIPE_QUERY_SO_STATISTICS ||
>            type == PIPE_QUERY_SO_OVERFLOW_PREDICATE ||
> +          type == PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE ||
>            type == PIPE_QUERY_PRIMITIVES_EMITTED ||
>            type == PIPE_QUERY_PRIMITIVES_GENERATED ||
>            type == PIPE_QUERY_PIPELINE_STATISTICS ||
> @@ -102,7 +103,10 @@ softpipe_begin_query(struct pipe_context *pipe, struct pipe_query *q)
>        sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
>        break;
>     case PIPE_QUERY_SO_OVERFLOW_PREDICATE:
> -      sq->end = FALSE;
> +   case PIPE_QUERY_SO_OVERFLOW_ANY_PREDICATE:
> +      sq->so.num_primitives_written = softpipe->so_stats.num_primitives_written;
> +      sq->so.primitives_storage_needed = softpipe->so_stats.primitives_storage_needed;
> +      break;
>        break;

One break has always been enough for me...

  -ilia


More information about the mesa-dev mailing list