[Mesa-dev] [PATCH] radv: don't overallocate 5 bpe formats (d32/s8)

Dave Airlie airlied at gmail.com
Thu Jul 6 06:24:47 UTC 2017


From: Dave Airlie <airlied at redhat.com>

This was getting passed into the ac_surface code, and used to
calculate bpp for the surface, however in this case the bpe
is really only 4, the surface code will allocate stencil separately.

This reduces the side of d32s8 allocates to something closer to pro.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 src/amd/vulkan/radv_image.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index e656bd6..e929728 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -74,7 +74,7 @@ radv_init_surface(struct radv_device *device,
 
 	surface->bpe = vk_format_get_blocksize(pCreateInfo->format);
 	/* align byte per element on dword */
-	if (surface->bpe == 3) {
+	if (surface->bpe == 3 || surface->bpe == 5) {
 		surface->bpe = 4;
 	}
 	surface->flags = RADEON_SURF_SET(array_mode, MODE);
-- 
2.9.4



More information about the mesa-dev mailing list