From 54c981e4a026f4b257df84522c39ac2e646f9f66 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 17 May 2023 08:36:32 -0400 Subject: [PATCH] lavapipe: store memory allocation size onto lvp_device_memory Reviewed-by: Dave Airlie Part-of: --- src/gallium/frontends/lavapipe/lvp_device.c | 1 + src/gallium/frontends/lavapipe/lvp_private.h | 1 + 2 files changed, 2 insertions(+) diff --git a/src/gallium/frontends/lavapipe/lvp_device.c b/src/gallium/frontends/lavapipe/lvp_device.c index 3828aff..1d2675c 100644 --- a/src/gallium/frontends/lavapipe/lvp_device.c +++ b/src/gallium/frontends/lavapipe/lvp_device.c @@ -1590,6 +1590,7 @@ VKAPI_ATTR VkResult VKAPI_CALL lvp_AllocateMemory( mem->memory_type = LVP_DEVICE_MEMORY_TYPE_DEFAULT; mem->backed_fd = -1; + mem->size = pAllocateInfo->allocationSize; if (host_ptr_info) { mem->pmem = host_ptr_info->pHostPointer; diff --git a/src/gallium/frontends/lavapipe/lvp_private.h b/src/gallium/frontends/lavapipe/lvp_private.h index d1c2443..e54f52d 100644 --- a/src/gallium/frontends/lavapipe/lvp_private.h +++ b/src/gallium/frontends/lavapipe/lvp_private.h @@ -208,6 +208,7 @@ struct lvp_device_memory { struct pipe_memory_allocation *pmem; uint32_t type_index; VkDeviceSize map_size; + VkDeviceSize size; void * map; enum lvp_device_memory_type memory_type; int backed_fd; -- 2.7.4