@@ -1138,14 +1138,15 @@ void retrace_vkSyncBufferTRACETOOLTEST(lava_file_reader& reader)
11381138void retrace_vkAssertBufferARM (lava_file_reader& reader)
11391139{
11401140 const uint32_t device_index = reader.read_handle (DEBUGPARAM (" VkDevice" ));
1141+ const auto & device_data = VkDevice_index.at (device_index);
11411142 const uint32_t buffer_index = reader.read_handle (DEBUGPARAM (" VkBuffer" ));
11421143 const VkDeviceSize offset = reader.read_uint64_t ();
11431144 VkDeviceSize size = reader.read_uint64_t ();
11441145 const char * comment = reader.read_string ();
11451146 const uint32_t checksum = reader.read_uint32_t ();
11461147 trackedobject& tbuf = VkBuffer_index.at (buffer_index);
11471148 VkDevice device = index_to_VkDevice.at (device_index);
1148- suballoc_location loc = reader. parent -> allocator . find_buffer_memory (buffer_index);
1149+ suballoc_location loc = device_data. allocator -> find_buffer_memory (buffer_index);
11491150 if (size == VK_WHOLE_SIZE)
11501151 {
11511152 size = tbuf.size - offset; // set to remaining size
@@ -1436,11 +1437,16 @@ void replay_postprocess_vkCmdBindDescriptorSets2(lava_file_reader& reader, VkCom
14361437
14371438void replay_postprocess_vkQueueSubmit2 (lava_file_reader& reader, VkResult result, VkQueue queue, uint32_t submitCount, const VkSubmitInfo2* pSubmits, VkFence fence)
14381439{
1440+ const uint32_t queue_index = index_to_VkQueue.index (queue);
1441+ auto & queue_data = VkQueue_index.at (queue_index);
1442+ const uint32_t device_index = queue_data.device_index ;
1443+ assert (device_index != UINT32_MAX);
1444+ auto & device_data = VkDevice_index.at (device_index);
14391445 for (uint32_t i = 0 ; i < submitCount; i++)
14401446 {
14411447 for (uint32_t j = 0 ; j < pSubmits[i].commandBufferInfoCount ; j++)
14421448 {
1443- execute_commands (reader, pSubmits[i].pCommandBufferInfos [j].commandBuffer );
1449+ execute_commands (reader, device_data, pSubmits[i].pCommandBufferInfos [j].commandBuffer );
14441450 }
14451451 }
14461452}
@@ -1452,11 +1458,16 @@ void replay_postprocess_vkQueueSubmit2KHR(lava_file_reader& reader, VkResult res
14521458
14531459void replay_postprocess_vkQueueSubmit (lava_file_reader& reader, VkResult result, VkQueue queue, uint32_t submitCount, const VkSubmitInfo* pSubmits, VkFence fence)
14541460{
1461+ const uint32_t queue_index = index_to_VkQueue.index (queue);
1462+ auto & queue_data = VkQueue_index.at (queue_index);
1463+ const uint32_t device_index = queue_data.device_index ;
1464+ assert (device_index != UINT32_MAX);
1465+ auto & device_data = VkDevice_index.at (device_index);
14551466 for (uint32_t i = 0 ; i < submitCount; i++)
14561467 {
14571468 for (uint32_t j = 0 ; j < pSubmits[i].commandBufferCount ; j++)
14581469 {
1459- execute_commands (reader, pSubmits[i].pCommandBuffers [j]);
1470+ execute_commands (reader, device_data, pSubmits[i].pCommandBuffers [j]);
14601471 }
14611472 }
14621473}
@@ -1908,6 +1919,7 @@ void retrace_vkGetSwapchainImagesKHR(lava_file_reader& reader)
19081919 const uint32_t device_index = reader.read_handle (DEBUGPARAM (" VkDevice" ));
19091920 const uint32_t swapchain_index = reader.read_handle (DEBUGPARAM (" VkSwapchainKHR" ));
19101921 VkDevice device = index_to_VkDevice.at (device_index);
1922+ auto & device_data = VkDevice_index.at (device_index);
19111923 const uint8_t do_call = reader.read_uint8_t ();
19121924 const VkResult stored_retval = (VkResult)reader.read_uint32_t ();
19131925 const uint32_t stored_image_count = reader.read_uint32_t ();
@@ -1953,7 +1965,7 @@ void retrace_vkGetSwapchainImagesKHR(lava_file_reader& reader)
19531965 result = wrap_vkCreateImage (device, &pinfo, nullptr , &data.virtual_images [i]);
19541966 assert (result == VK_SUCCESS);
19551967 }
1956- reader. parent -> allocator . virtualswap_images (device, data.virtual_images );
1968+ device_data. allocator -> virtualswap_images (data.virtual_images );
19571969
19581970 if (is_noscreen ())
19591971 {
@@ -2458,18 +2470,20 @@ void retrace_vkGetPhysicalDeviceXlibPresentationSupportKHR(lava_file_reader& rea
24582470
24592471void image_update (lava_file_reader& reader, uint32_t device_index, uint32_t image_index, uint64_t size, const VkBaseOutStructure* sptr)
24602472{
2461- suballoc_location loc = reader.parent ->allocator .find_image_memory (image_index);
2473+ VkDevice device = index_to_VkDevice.at (device_index);
2474+ const auto & device_data = VkDevice_index.at (device_index);
2475+ suballoc_location loc = device_data.allocator ->find_image_memory (image_index);
24622476 DLOG2 (" image update idx=%u flush=%s init=%s size=%lu" , image_index, loc.needs_flush ? " yes" : " no" , loc.needs_init ? " yes" : " no" , (unsigned long )loc.size );
24632477 assert (sptr == nullptr );
2464- VkDevice device = index_to_VkDevice.at (device_index);
24652478 char * ptr = mem_map (reader, device, loc);
24662479 int32_t changed = reader.read_patch (ptr, loc.size );
24672480 mem_unmap (reader, device, loc, nullptr , ptr);
24682481}
24692482
24702483void buffer_update (lava_file_reader& reader, uint32_t device_index, uint32_t buffer_index, uint64_t size, const VkBaseOutStructure* sptr)
24712484{
2472- suballoc_location loc = reader.parent ->allocator .find_buffer_memory (buffer_index);
2485+ const auto & device_data = VkDevice_index.at (device_index);
2486+ suballoc_location loc = device_data.allocator ->find_buffer_memory (buffer_index);
24732487 DLOG2 (" buffer update idx=%u flush=%s init=%s size=%lu" , buffer_index, loc.needs_flush ? " yes" : " no" , loc.needs_init ? " yes" : " no" , (unsigned long )loc.size );
24742488 assert (sptr == nullptr || sptr->sType == VK_STRUCTURE_TYPE_MARKED_OFFSETS_ARM);
24752489 VkDevice device = index_to_VkDevice.at (device_index);
@@ -2486,7 +2500,8 @@ void buffer_update(lava_file_reader& reader, uint32_t device_index, uint32_t buf
24862500
24872501void tensor_update (lava_file_reader& reader, uint32_t device_index, uint32_t tensor_index, uint64_t size, const VkBaseOutStructure* sptr)
24882502{
2489- suballoc_location loc = reader.parent ->allocator .find_tensor_memory (tensor_index);
2503+ const auto & device_data = VkDevice_index.at (device_index);
2504+ suballoc_location loc = device_data.allocator ->find_tensor_memory (tensor_index);
24902505 DLOG2 (" tensor update idx=%u flush=%s init=%s size=%lu" , tensor_index, loc.needs_flush ? " yes" : " no" , loc.needs_init ? " yes" : " no" , (unsigned long )loc.size );
24912506 assert (sptr == nullptr );
24922507 VkDevice device = index_to_VkDevice.at (device_index);
0 commit comments