[vulkan] Record resource memory size

It's useful mainly for information reports, but might be useful
elsewhere.
This commit is contained in:
Bill Currie 2022-10-27 11:32:00 +09:00
parent 1f27622309
commit fa057cb121
3 changed files with 4 additions and 2 deletions

View file

@ -59,6 +59,7 @@ typedef struct qfv_resource_s {
unsigned num_objects;
qfv_resobj_t *objects;
VkDeviceMemory memory;
VkDeviceSize size;
} qfv_resource_t;
struct qfv_device_s;

View file

@ -129,6 +129,7 @@ QFV_CreateResource (qfv_device_t *device, qfv_resource_t *resource)
}
}
}
resource->size = size;
QFV_duSetObjectName (device, VK_OBJECT_TYPE_DEVICE_MEMORY,
resource->memory, va (resource->va_ctx, "memory:%s",
resource->name));

View file

@ -669,7 +669,6 @@ build_shadow_maps (lightingctx_t *lctx, vulkan_ctx_t *ctx)
int numLayers = 0;
int totalLayers = 0;
int *imageMap = alloca (numLights * sizeof (int));
size_t memsize = 0;
int *lightMap = alloca (numLights * sizeof (int));
int numMaps = 0;
mapdesc_t *maps = alloca (numLights * sizeof (mapdesc_t));
@ -828,7 +827,8 @@ build_shadow_maps (lightingctx_t *lctx, vulkan_ctx_t *ctx)
}
Sys_MaskPrintf (SYS_vulkan,
"shadow maps: %d layers in %zd images: %zd\n",
totalLayers, lctx->light_images.size, memsize);
totalLayers, lctx->light_images.size,
lctx->shadow_resources->size);
}
void