summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2020-10-11 21:23:40 -0400
committerMarek Olšák <marek.olsak@amd.com>2020-12-01 15:33:02 -0500
commit2f50dea2188c7d777249bcec8c3a70aed50ce7b4 (patch)
tree98c0c2cabb31c5e396af1101092f83b85daec732
parentebcca77d4badfb3b1eb4e8753a3b553126ff109d (diff)
radeonsi: always use a staging texture for linear 1D textures in VRAM
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7721>
-rw-r--r--src/gallium/drivers/radeonsi/si_texture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c
index ee555f17772..16157d443f7 100644
--- a/src/gallium/drivers/radeonsi/si_texture.c
+++ b/src/gallium/drivers/radeonsi/si_texture.c
@@ -1861,13 +1861,17 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, struct pipe_resou
/* Tiled textures need to be converted into a linear texture for CPU
* access. The staging texture is always linear and is placed in GART.
*
+ * Always use a staging texture for VRAM, so that we don't map it and
+ * don't relocate it to GTT.
+ *
* Reading from VRAM or GTT WC is slow, always use the staging
* texture in this case.
*
* Use the staging texture for uploads if the underlying BO
* is busy.
*/
- if (!tex->surface.is_linear || (tex->buffer.flags & RADEON_FLAG_ENCRYPTED))
+ if (!tex->surface.is_linear || (tex->buffer.flags & RADEON_FLAG_ENCRYPTED) ||
+ tex->buffer.domains & RADEON_DOMAIN_VRAM)
use_staging_texture = true;
else if (usage & PIPE_MAP_READ)
use_staging_texture =