From 362ffb5f81aa30c3401ef1d215ff01df27df376a Mon Sep 17 00:00:00 2001 From: Yahan Zhou Date: Tue, 30 Jan 2024 15:23:59 -0800 Subject: [PATCH] Snapshot vk image content in common situation This commit snapshots vk image content by allocating a staging buffer and copying the bytes on snapshot. It only works in the simplest setup. Many situations are not considered in this commit, they include: (1) the image does not support VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL layout; (2) the image does not support VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL layout; (3) the queue is dirty. Also there is no performance optimization. Implementation-wise, snapshot happens in VkDecoderGlobalState after recording / playing back all create / bind commands. It borrows an existing queue to run the extra vk copy commands. A temporary staging buffer is also created for copying. Later we could optimize the code by reusing most of the temporary objects. Reviewed-by: Aaron Ruby Acked-by: Yonggang Luo Acked-by: Adam Jackson Part-of: --- src/gfxstream/codegen/scripts/cereal/decodersnapshot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py b/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py index dcf8f0e4f0f..a9660829e3b 100644 --- a/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py +++ b/src/gfxstream/codegen/scripts/cereal/decodersnapshot.py @@ -113,6 +113,7 @@ apiSequences = { apiModifies = { "vkMapMemoryIntoAddressSpaceGOOGLE" : ["memory"], "vkGetBlobGOOGLE" : ["memory"], + "vkBindImageMemory": ["image"], } def is_modify_operation(api, param):