radv: do not expose GTT as device local memory mostly for APUs
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Wed, 22 Apr 2020 14:54:28 +0000 (16:54 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Apr 2020 22:41:41 +0000 (22:41 +0000)
commit7a0a6a718035e1a754972fbbad8b91d19f39fa42
tree82be50020d80bbdac58072ec771ced78337bb2b5
parent4a523baa00fcf12dabd2e7b054ce73ac238c11a7
radv: do not expose GTT as device local memory mostly for APUs

On APUs, the memory is unified (all heaps are equally fast) and
apps should count all memory heaps together. But some games like
Id Tech games (Youngblood and such) don't manage memory correctly
on APUs and they spill everything when one VRAM heap is full.

Instead of spilling buffers, they should just allocate new buffers
in the second heap but it seems like these games are confused if
two memory heaps have the DEVICE_LOCAL_BIT set.

This is probably a first step towards better memory management on
APUs but there is still some work to do if we want to run most apps
with a small dedicated VRAM (256MB or so).

This gives a huge boost for Id Tech games on APUs, and doesn't
seem to reduce Feral games performance.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4771>
src/amd/vulkan/radv_device.c