Mesa (master): radv: Set the RADEON_SURF_OPTIMIZE_FOR_SPACE flag for images

Dave Airlie airlied at kemper.freedesktop.org
Tue Jul 18 06:20:00 UTC 2017


Module: Mesa
Branch: master
Commit: f25c7f9f3e3cb8c650a54338575342fa377d7983
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f25c7f9f3e3cb8c650a54338575342fa377d7983

Author: Alex Smith <asmith at feralinteractive.com>
Date:   Mon Jul 17 11:14:33 2017 +0100

radv: Set the RADEON_SURF_OPTIMIZE_FOR_SPACE flag for images

This looks like a regression from df301237940 ("radv: use
ac_compute_surface"). Before that, the opt4Space addrlib flag was set
to true unless the image has FMASK (ac_compute_surface will similarly
only set that flag for images without FMASK).

This saves multiple gigabytes of VRAM on one of our games, and brings
its VRAM utilisation on RADV in line with AMDGPU-PRO and NVIDIA.

Signed-off-by: Alex Smith <asmith at feralinteractive.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/vulkan/radv_image.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index e6ad31ebaa..f5fb790dda 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -109,6 +109,7 @@ radv_init_surface(struct radv_device *device,
 		surface->flags |= RADEON_SURF_SBUFFER;
 
 	surface->flags |= RADEON_SURF_HAS_TILE_MODE_INDEX;
+	surface->flags |= RADEON_SURF_OPTIMIZE_FOR_SPACE;
 
 	if ((pCreateInfo->usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
 	                           VK_IMAGE_USAGE_STORAGE_BIT)) ||




More information about the mesa-commit mailing list