From fb9d86299b44e77e37f8b9032cb839099ca482de Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Mon, 8 Jul 2024 14:18:39 -0700 Subject: [PATCH] freedreno: Use LINEAR for staging resources These are for CPU access, so no point in having additional staging blit to convert from/to linear. Depth formats are an exception, as normally they cannot be linear. Signed-off-by: Rob Clark Part-of: --- src/gallium/drivers/freedreno/freedreno_resource.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/freedreno/freedreno_resource.c b/src/gallium/drivers/freedreno/freedreno_resource.c index f953451f7f6..68735df7a79 100644 --- a/src/gallium/drivers/freedreno/freedreno_resource.c +++ b/src/gallium/drivers/freedreno/freedreno_resource.c @@ -1263,6 +1263,10 @@ get_best_layout(struct fd_screen *screen, if (tmpl->target == PIPE_BUFFER) return LINEAR; + if ((tmpl->usage == PIPE_USAGE_STAGING) && + !util_format_is_depth_or_stencil(tmpl->format)) + return LINEAR; + if (tmpl->bind & PIPE_BIND_LINEAR) { if (tmpl->usage != PIPE_USAGE_STAGING) perf_debug("%" PRSC_FMT ": forcing linear: bind flags",