diff options
author | Marek Olšák <marek.olsak@amd.com> | 2020-12-21 01:34:38 -0500 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-01-20 21:53:13 +0000 |
commit | ac2b4aa08f5f51dcbb287c127e0c70571cdba6b4 (patch) | |
tree | 9947373a2d914721cc6c5ec8e20a0620f98b0193 | |
parent | facd34431b74b9790d3769fd643356483db184e9 (diff) |
radeonsi: unify uploaders on APUs too
const_uploader and stream_uploader point to the same uploader.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8600>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index cd8f52a88cf..9c904b077b6 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -499,15 +499,21 @@ static struct pipe_context *si_create_context(struct pipe_screen *screen, unsign goto fail; /* Initialize public allocators. */ + /* Unify uploaders as follows: + * - dGPUs with Smart Access Memory: there is only one uploader instance writing to VRAM. + * - APUs: There is only one uploader instance writing to RAM. VRAM has the same perf on APUs. + * - Other chips: The const uploader writes to VRAM and the stream uploader writes to RAM. + */ bool smart_access_memory = sscreen->info.smart_access_memory; + bool is_apu = !sscreen->info.has_dedicated_vram; sctx->b.stream_uploader = u_upload_create(&sctx->b, 1024 * 1024, 0, - smart_access_memory ? PIPE_USAGE_DEFAULT : PIPE_USAGE_STREAM, + smart_access_memory && !is_apu ? PIPE_USAGE_DEFAULT : PIPE_USAGE_STREAM, SI_RESOURCE_FLAG_32BIT); /* same flags as const_uploader */ if (!sctx->b.stream_uploader) goto fail; - if (smart_access_memory) { + if (smart_access_memory || is_apu) { sctx->b.const_uploader = sctx->b.stream_uploader; } else { sctx->b.const_uploader = |