[Mesa-dev] [PATCH 1/2] panfrost: Identify MALI_OCCLUSION_PRECISE bit
Ilia Mirkin
imirkin at alum.mit.edu
Thu Feb 14 03:12:01 UTC 2019
On Wed, Feb 13, 2019 at 9:52 PM Alyssa Rosenzweig <alyssa at rosenzweig.io> wrote:
>
> Setting this is required for desktop-style occlusion queries.
>
> Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
> ---
> src/gallium/drivers/panfrost/include/panfrost-job.h | 10 ++++++----
> src/gallium/drivers/panfrost/pan_context.c | 2 +-
> 2 files changed, 7 insertions(+), 5 deletions(-)
>
> diff --git a/src/gallium/drivers/panfrost/include/panfrost-job.h b/src/gallium/drivers/panfrost/include/panfrost-job.h
> index dbb5486bfa4..41bdb1da2c5 100644
> --- a/src/gallium/drivers/panfrost/include/panfrost-job.h
> +++ b/src/gallium/drivers/panfrost/include/panfrost-job.h
> @@ -71,14 +71,16 @@ enum mali_draw_mode {
>
> /* Applies to tiler_gl_enables */
>
> -#define MALI_CULL_FACE_BACK 0x80
> -#define MALI_CULL_FACE_FRONT 0x40
>
> -#define MALI_FRONT_FACE(v) (v << 5)
> +#define MALI_OCCLUSION_QUERY (1 << 3)
> +#define MALI_OCCLUSION_PRECISE (1 << 4)
> +
> +#define MALI_FRONT_FACE(v) (v << 5)
> #define MALI_CCW (0)
> #define MALI_CW (1)
>
> -#define MALI_OCCLUSION_BOOLEAN 0x8
> +#define MALI_CULL_FACE_FRONT (1 << 6)
> +#define MALI_CULL_FACE_BACK (1 << 7)
>
> /* TODO: Might this actually be a finer bitfield? */
> #define MALI_DEPTH_STENCIL_ENABLE 0x6400
> diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
> index 565e6541b6c..73e7d4aaa8f 100644
> --- a/src/gallium/drivers/panfrost/pan_context.c
> +++ b/src/gallium/drivers/panfrost/pan_context.c
> @@ -1031,7 +1031,7 @@ panfrost_emit_for_draw(struct panfrost_context *ctx, bool with_vertex_data)
> }
>
> if (ctx->occlusion_query) {
> - ctx->payload_tiler.gl_enables |= MALI_OCCLUSION_BOOLEAN;
> + ctx->payload_tiler.gl_enables |= MALI_OCCLUSION_QUERY | MALI_OCCLUSION_PRECISE;
> ctx->payload_tiler.postfix.occlusion_counter = ctx->occlusion_query->transfer.gpu;
FYI there's PIPE_QUERY_OCCLUSION_COUNTER, which is the precise thing,
and there's PIPE_QUERY_OCCLUSION_PREDICATE, which is the boolean
version.
Cheers,
-ilia
More information about the mesa-dev
mailing list