diff --git a/src/gallium/drivers/panfrost/pan_job.c b/src/gallium/drivers/panfrost/pan_job.c index ba07c6cfc65..3ba8948387a 100644 --- a/src/gallium/drivers/panfrost/pan_job.c +++ b/src/gallium/drivers/panfrost/pan_job.c @@ -762,9 +762,7 @@ panfrost_batch_submit(struct panfrost_context *ctx, /* Shared depth/stencil resources are not supported, and would * break this optimisation. */ - assert(!(z_rsrc->base.bind & (PIPE_BIND_SHARED | - PIPE_BIND_SCANOUT | - PIPE_BIND_DISPLAY_TARGET))); + assert(!(z_rsrc->base.bind & PAN_BIND_SHARED_MASK)); if (batch->clear & PIPE_CLEAR_STENCIL) { z_rsrc->stencil_value = batch->clear_stencil; diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index fcf5114eb11..65d8be8127b 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -619,8 +619,7 @@ panfrost_resource_create_with_modifier(struct pipe_screen *screen, util_range_init(&so->valid_buffer_range); - if (template->bind & (PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | - PIPE_BIND_SHARED)) { + if (template->bind & PAN_BIND_SHARED_MASK) { /* For compatibility with older consumers that may not be * modifiers aware, treat INVALID as LINEAR for shared * resources. @@ -814,7 +813,7 @@ pan_alloc_staging(struct panfrost_context *ctx, struct panfrost_resource *rsc, } tmpl.last_level = 0; tmpl.bind |= PIPE_BIND_LINEAR; - tmpl.bind &= ~(PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | PIPE_BIND_SHARED); + tmpl.bind &= ~PAN_BIND_SHARED_MASK; struct pipe_resource *pstaging = pctx->screen->resource_create(pctx->screen, &tmpl); diff --git a/src/gallium/drivers/panfrost/pan_resource.h b/src/gallium/drivers/panfrost/pan_resource.h index 06ced7bd5af..beeb233fccc 100644 --- a/src/gallium/drivers/panfrost/pan_resource.h +++ b/src/gallium/drivers/panfrost/pan_resource.h @@ -35,6 +35,9 @@ #define LAYOUT_CONVERT_THRESHOLD 8 #define PAN_MAX_BATCHES 32 +#define PAN_BIND_SHARED_MASK (PIPE_BIND_DISPLAY_TARGET | PIPE_BIND_SCANOUT | \ + PIPE_BIND_SHARED) + struct panfrost_resource { struct pipe_resource base; struct {