lavapipe: store memory allocation size onto lvp_device_memory
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Wed, 17 May 2023 12:36:32 +0000 (08:36 -0400)
committerMarge Bot <emma+marge@anholt.net>
Tue, 23 May 2023 21:09:28 +0000 (21:09 +0000)
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23077>

src/gallium/frontends/lavapipe/lvp_device.c
src/gallium/frontends/lavapipe/lvp_private.h

index 3828aff..1d2675c 100644 (file)
@@ -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;
index d1c2443..e54f52d 100644 (file)
@@ -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;