mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 04:00:10 +01:00
radeon: use staging for mapping linear textures
Textures that likely reside in VRAM, are mapped for reading and don't require direct mapping should be staged into GTT, to avoid bad performance. This fixes readback performance of VDPAU surfaces. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
270fab5164
commit
f250fd59c4
1 changed files with 6 additions and 0 deletions
|
|
@ -852,6 +852,12 @@ static void *r600_texture_transfer_map(struct pipe_context *ctx,
|
|||
if (rtex->surface.level[level].mode >= RADEON_SURF_MODE_1D)
|
||||
use_staging_texture = TRUE;
|
||||
|
||||
/* Untiled buffers in VRAM, which is slow for CPU reads */
|
||||
if ((usage & PIPE_TRANSFER_READ) && !(usage & PIPE_TRANSFER_MAP_DIRECTLY) &&
|
||||
(rtex->resource.domains == RADEON_DOMAIN_VRAM)) {
|
||||
use_staging_texture = TRUE;
|
||||
}
|
||||
|
||||
/* Use a staging texture for uploads if the underlying BO is busy. */
|
||||
if (!(usage & PIPE_TRANSFER_READ) &&
|
||||
(r600_rings_is_buffer_referenced(rctx, rtex->resource.cs_buf, RADEON_USAGE_READWRITE) ||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue