[Mesa-dev] [PATCH v5 58/63] radeonsi: only decompress resident textures/images when used

Marek Olšák maraeo at gmail.com
Tue Jun 13 22:04:10 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Jun 13, 2017 at 11:26 PM, Samuel Pitoiset
<samuel.pitoiset at gmail.com> wrote:
> When the current bound shaders don't use any bindless textures
> or images, it's useless to decompress the resident resources.
>
> v5: - fix conditionals
> v4: - inline si_*_uses_bindless_*()
> v3: - rebased and updated check for compute
>
> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
> Reviewed-by: Marek Olšák <marek.olsak at amd.com> (v2)
> ---
>  src/gallium/drivers/radeonsi/si_blit.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/drivers/radeonsi/si_blit.c b/src/gallium/drivers/radeonsi/si_blit.c
> index 8fdc3f268b1..9c38ae9edc8 100644
> --- a/src/gallium/drivers/radeonsi/si_blit.c
> +++ b/src/gallium/drivers/radeonsi/si_blit.c
> @@ -792,8 +792,17 @@ static void si_decompress_textures(struct si_context *sctx, unsigned shader_mask
>                 }
>         }
>
> -       si_decompress_resident_textures(sctx);
> -       si_decompress_resident_images(sctx);
> +       if (shader_mask & u_bit_consecutive(0, SI_NUM_GRAPHICS_SHADERS)) {
> +               if (sctx->uses_bindless_samplers)
> +                       si_decompress_resident_textures(sctx);
> +               if (sctx->uses_bindless_images)
> +                       si_decompress_resident_images(sctx);
> +       } else if (shader_mask & (1 << PIPE_SHADER_COMPUTE)) {
> +               if (sctx->cs_shader_state.program->uses_bindless_samplers)
> +                       si_decompress_resident_textures(sctx);
> +               if (sctx->cs_shader_state.program->uses_bindless_images)
> +                       si_decompress_resident_images(sctx);
> +       }
>
>         si_check_render_feedback(sctx);
>  }
> --
> 2.13.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list