From 3fa7ce4d46da0db62eae5f0884949707a1f181f4 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Tue, 2 Feb 2021 12:46:51 -0500 Subject: [PATCH] zink: use better usage flags for staging resources enforce linear bind more logically and mark with more accurate usage Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_resource.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index b2bd1fbb3b1..2cf907bb974 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -950,9 +950,9 @@ zink_transfer_map(struct pipe_context *pctx, struct pipe_resource templ = *pres; templ.format = format; - templ.usage = PIPE_USAGE_STAGING; + templ.usage = usage & PIPE_MAP_READ ? PIPE_USAGE_STAGING : PIPE_USAGE_STREAM; templ.target = PIPE_BUFFER; - templ.bind = 0; + templ.bind = PIPE_BIND_LINEAR; templ.width0 = trans->base.b.layer_stride * box->depth; templ.height0 = templ.depth0 = 0; templ.last_level = 0;