[Mesa-dev] [PATCH] i965: Don't disable CCS for RT dependencies when dispatching compute.

Iago Toral itoral at igalia.com
Tue Oct 24 10:44:20 UTC 2017


Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>

BTW, thanks for fixing the original dependency issue, I was about to
start looking into those test failures when you landed the fix :)

Iago

On Mon, 2017-10-23 at 22:21 -0700, Kenneth Graunke wrote:
> Compute shaders don't have access to the framebuffer, so there's no
> point in worrying whether a texture is bound as a render target.
> 
> This saves a bunch of resolves in GFXBench4 Manhattan 3.1, but
> doesn't
> seem to impact performance at all, at least on Apollolake.
> ---
>  src/mesa/drivers/dri/i965/brw_compute.c | 2 +-
>  src/mesa/drivers/dri/i965/brw_context.h | 2 +-
>  src/mesa/drivers/dri/i965/brw_draw.c    | 6 +++---
>  3 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_compute.c
> b/src/mesa/drivers/dri/i965/brw_compute.c
> index c1b2df590b7..9be7523bab3 100644
> --- a/src/mesa/drivers/dri/i965/brw_compute.c
> +++ b/src/mesa/drivers/dri/i965/brw_compute.c
> @@ -177,7 +177,7 @@ brw_dispatch_compute_common(struct gl_context
> *ctx)
>  
>     brw_validate_textures(brw);
>  
> -   brw_predraw_resolve_inputs(brw);
> +   brw_predraw_resolve_inputs(brw, false);
>  
>     /* Flush the batch if the batch/state buffers are nearly
> full.  We can
>      * grow them if needed, but this is not free, so we'd like to
> avoid it.
> diff --git a/src/mesa/drivers/dri/i965/brw_context.h
> b/src/mesa/drivers/dri/i965/brw_context.h
> index 26e71e62b54..0102f154248 100644
> --- a/src/mesa/drivers/dri/i965/brw_context.h
> +++ b/src/mesa/drivers/dri/i965/brw_context.h
> @@ -1234,7 +1234,7 @@ void intel_update_renderbuffers(__DRIcontext
> *context,
>                                  __DRIdrawable *drawable);
>  void intel_prepare_render(struct brw_context *brw);
>  
> -void brw_predraw_resolve_inputs(struct brw_context *brw);
> +void brw_predraw_resolve_inputs(struct brw_context *brw, bool
> rendering);
>  
>  void intel_resolve_for_dri2_flush(struct brw_context *brw,
>                                    __DRIdrawable *drawable);
> diff --git a/src/mesa/drivers/dri/i965/brw_draw.c
> b/src/mesa/drivers/dri/i965/brw_draw.c
> index b74ab8bde23..80d4891f6f6 100644
> --- a/src/mesa/drivers/dri/i965/brw_draw.c
> +++ b/src/mesa/drivers/dri/i965/brw_draw.c
> @@ -381,7 +381,7 @@ intel_disable_rb_aux_buffer(struct brw_context
> *brw,
>   * enabled depth texture, and flush the render cache for any dirty
> textures.
>   */
>  void
> -brw_predraw_resolve_inputs(struct brw_context *brw)
> +brw_predraw_resolve_inputs(struct brw_context *brw, bool rendering)
>  {
>     struct gl_context *ctx = &brw->ctx;
>     struct intel_texture_object *tex_obj;
> @@ -416,7 +416,7 @@ brw_predraw_resolve_inputs(struct brw_context
> *brw)
>           num_layers = INTEL_REMAINING_LAYERS;
>        }
>  
> -      const bool disable_aux =
> +      const bool disable_aux = rendering &&
>           intel_disable_rb_aux_buffer(brw, tex_obj->mt, min_level,
> num_levels,
>                                       "for sampling");
>  
> @@ -678,7 +678,7 @@ brw_prepare_drawing(struct gl_context *ctx,
>      * and finalizing textures but before setting up any hardware
> state for
>      * this draw call.
>      */
> -   brw_predraw_resolve_inputs(brw);
> +   brw_predraw_resolve_inputs(brw, true);
>     brw_predraw_resolve_framebuffer(brw);
>  
>     /* Bind all inputs, derive varying and size information:


More information about the mesa-dev mailing list