mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 04:48:08 +02:00
radeonsi: don't use staging texture when we can't blit
Reviewed-by: David Rosca <david.rosca@amd.com> Reviewed-by: Qiang Yu <yuq825@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/41133>
This commit is contained in:
parent
3a1c466084
commit
6e2d8c04be
2 changed files with 8 additions and 0 deletions
|
|
@ -57,6 +57,10 @@ void si_init_resource_fields(struct si_screen *sscreen, struct si_resource *res,
|
|||
break;
|
||||
}
|
||||
|
||||
/* If no compute/graphics -> use GTT since we can't copy/blit. */
|
||||
if (!sscreen->has_gfx_compute)
|
||||
res->domains = RADEON_DOMAIN_GTT;
|
||||
|
||||
if (res->b.b.target == PIPE_BUFFER && res->b.b.flags & PIPE_RESOURCE_FLAG_MAP_PERSISTENT) {
|
||||
/* Use GTT for all persistent mappings with older
|
||||
* kernels, because they didn't always flush the HDP
|
||||
|
|
|
|||
|
|
@ -2127,6 +2127,10 @@ static void *si_texture_transfer_map(struct pipe_context *ctx, struct pipe_resou
|
|||
if (tex->is_depth || tex->buffer.flags & RADEON_FLAG_SPARSE) {
|
||||
/* Depth and sparse textures use staging unconditionally. */
|
||||
use_staging_texture = true;
|
||||
} else if (!sctx->screen->has_gfx_compute) {
|
||||
if (!tex->surface.is_linear)
|
||||
return NULL;
|
||||
use_staging_texture = false;
|
||||
} else {
|
||||
/* Degrade the tile mode if we get too many transfers on APUs.
|
||||
* On dGPUs, the staging texture is always faster.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue