Lines Matching refs:stateBlock
125 void saveImageContent(android::base::Stream* stream, StateBlock* stateBlock, VkImage image, in saveImageContent() argument
134 VulkanDispatch* dispatch = stateBlock->deviceDispatch; in saveImageContent()
138 .commandPool = stateBlock->commandPool, in saveImageContent()
143 _RUN_AND_CHECK(dispatch->vkAllocateCommandBuffers(stateBlock->device, &allocInfo, in saveImageContent()
149 _RUN_AND_CHECK(dispatch->vkCreateFence(stateBlock->device, &fenceCreateInfo, nullptr, &fence)); in saveImageContent()
160 dispatch->vkCreateBuffer(stateBlock->device, &bufferCreateInfo, nullptr, &readbackBuffer)); in saveImageContent()
163 dispatch->vkGetBufferMemoryRequirements(stateBlock->device, readbackBuffer, in saveImageContent()
167 GetMemoryType(*stateBlock->physicalDeviceInfo, readbackBufferMemoryRequirements, in saveImageContent()
177 _RUN_AND_CHECK(dispatch->vkAllocateMemory(stateBlock->device, &readbackBufferMemoryAllocateInfo, in saveImageContent()
180 dispatch->vkBindBufferMemory(stateBlock->device, readbackBuffer, readbackMemory, 0)); in saveImageContent()
183 _RUN_AND_CHECK(dispatch->vkMapMemory(stateBlock->device, readbackMemory, 0, VK_WHOLE_SIZE, in saveImageContent()
263 _RUN_AND_CHECK(dispatch->vkQueueSubmit(stateBlock->queue, 1, &submitInfo, fence)); in saveImageContent()
265 dispatch->vkWaitForFences(stateBlock->device, 1, &fence, VK_TRUE, 3000000000L)); in saveImageContent()
266 _RUN_AND_CHECK(dispatch->vkResetFences(stateBlock->device, 1, &fence)); in saveImageContent()
273 dispatch->vkDestroyFence(stateBlock->device, fence, nullptr); in saveImageContent()
274 dispatch->vkUnmapMemory(stateBlock->device, readbackMemory); in saveImageContent()
275 dispatch->vkDestroyBuffer(stateBlock->device, readbackBuffer, nullptr); in saveImageContent()
276 dispatch->vkFreeMemory(stateBlock->device, readbackMemory, nullptr); in saveImageContent()
277 dispatch->vkFreeCommandBuffers(stateBlock->device, stateBlock->commandPool, 1, &commandBuffer); in saveImageContent()
280 void loadImageContent(android::base::Stream* stream, StateBlock* stateBlock, VkImage image, in loadImageContent() argument
285 VulkanDispatch* dispatch = stateBlock->deviceDispatch; in loadImageContent()
289 .commandPool = stateBlock->commandPool, in loadImageContent()
294 _RUN_AND_CHECK(dispatch->vkAllocateCommandBuffers(stateBlock->device, &allocInfo, in loadImageContent()
300 _RUN_AND_CHECK(dispatch->vkCreateFence(stateBlock->device, &fenceCreateInfo, nullptr, &fence)); in loadImageContent()
340 _RUN_AND_CHECK(dispatch->vkQueueSubmit(stateBlock->queue, 1, &submitInfo, fence)); in loadImageContent()
342 dispatch->vkWaitForFences(stateBlock->device, 1, &fence, VK_TRUE, 3000000000L)); in loadImageContent()
343 dispatch->vkDestroyFence(stateBlock->device, fence, nullptr); in loadImageContent()
344 dispatch->vkFreeCommandBuffers(stateBlock->device, stateBlock->commandPool, 1, in loadImageContent()
358 dispatch->vkCreateBuffer(stateBlock->device, &bufferCreateInfo, nullptr, &stagingBuffer)); in loadImageContent()
361 dispatch->vkGetBufferMemoryRequirements(stateBlock->device, stagingBuffer, in loadImageContent()
365 GetMemoryType(*stateBlock->physicalDeviceInfo, stagingBufferMemoryRequirements, in loadImageContent()
376 _RUN_AND_CHECK(dispatch->vkAllocateMemory(stateBlock->device, &stagingBufferMemoryAllocateInfo, in loadImageContent()
379 dispatch->vkBindBufferMemory(stateBlock->device, stagingBuffer, stagingMemory, 0)); in loadImageContent()
382 _RUN_AND_CHECK(dispatch->vkMapMemory(stateBlock->device, stagingMemory, 0, VK_WHOLE_SIZE, in loadImageContent()
463 _RUN_AND_CHECK(dispatch->vkQueueSubmit(stateBlock->queue, 1, &submitInfo, fence)); in loadImageContent()
465 dispatch->vkWaitForFences(stateBlock->device, 1, &fence, VK_TRUE, 3000000000L)); in loadImageContent()
466 _RUN_AND_CHECK(dispatch->vkResetFences(stateBlock->device, 1, &fence)); in loadImageContent()
469 dispatch->vkDestroyFence(stateBlock->device, fence, nullptr); in loadImageContent()
470 dispatch->vkUnmapMemory(stateBlock->device, stagingMemory); in loadImageContent()
471 dispatch->vkDestroyBuffer(stateBlock->device, stagingBuffer, nullptr); in loadImageContent()
472 dispatch->vkFreeMemory(stateBlock->device, stagingMemory, nullptr); in loadImageContent()
473 dispatch->vkFreeCommandBuffers(stateBlock->device, stateBlock->commandPool, 1, &commandBuffer); in loadImageContent()
476 void saveBufferContent(android::base::Stream* stream, StateBlock* stateBlock, VkBuffer buffer, in saveBufferContent() argument
483 VulkanDispatch* dispatch = stateBlock->deviceDispatch; in saveBufferContent()
486 .commandPool = stateBlock->commandPool, in saveBufferContent()
491 _RUN_AND_CHECK(dispatch->vkAllocateCommandBuffers(stateBlock->device, &allocInfo, in saveBufferContent()
497 _RUN_AND_CHECK(dispatch->vkCreateFence(stateBlock->device, &fenceCreateInfo, nullptr, &fence)); in saveBufferContent()
506 dispatch->vkCreateBuffer(stateBlock->device, &bufferCreateInfo, nullptr, &readbackBuffer)); in saveBufferContent()
509 dispatch->vkGetBufferMemoryRequirements(stateBlock->device, readbackBuffer, in saveBufferContent()
513 GetMemoryType(*stateBlock->physicalDeviceInfo, readbackBufferMemoryRequirements, in saveBufferContent()
523 _RUN_AND_CHECK(dispatch->vkAllocateMemory(stateBlock->device, &readbackBufferMemoryAllocateInfo, in saveBufferContent()
526 dispatch->vkBindBufferMemory(stateBlock->device, readbackBuffer, readbackMemory, 0)); in saveBufferContent()
529 _RUN_AND_CHECK(dispatch->vkMapMemory(stateBlock->device, readbackMemory, 0, VK_WHOLE_SIZE, in saveBufferContent()
566 _RUN_AND_CHECK(dispatch->vkQueueSubmit(stateBlock->queue, 1, &submitInfo, fence)); in saveBufferContent()
567 _RUN_AND_CHECK(dispatch->vkWaitForFences(stateBlock->device, 1, &fence, VK_TRUE, 3000000000L)); in saveBufferContent()
568 _RUN_AND_CHECK(dispatch->vkResetFences(stateBlock->device, 1, &fence)); in saveBufferContent()
572 dispatch->vkDestroyFence(stateBlock->device, fence, nullptr); in saveBufferContent()
573 dispatch->vkUnmapMemory(stateBlock->device, readbackMemory); in saveBufferContent()
574 dispatch->vkDestroyBuffer(stateBlock->device, readbackBuffer, nullptr); in saveBufferContent()
575 dispatch->vkFreeMemory(stateBlock->device, readbackMemory, nullptr); in saveBufferContent()
576 dispatch->vkFreeCommandBuffers(stateBlock->device, stateBlock->commandPool, 1, &commandBuffer); in saveBufferContent()
579 void loadBufferContent(android::base::Stream* stream, StateBlock* stateBlock, VkBuffer buffer, in loadBufferContent() argument
586 VulkanDispatch* dispatch = stateBlock->deviceDispatch; in loadBufferContent()
589 .commandPool = stateBlock->commandPool, in loadBufferContent()
594 _RUN_AND_CHECK(dispatch->vkAllocateCommandBuffers(stateBlock->device, &allocInfo, in loadBufferContent()
600 _RUN_AND_CHECK(dispatch->vkCreateFence(stateBlock->device, &fenceCreateInfo, nullptr, &fence)); in loadBufferContent()
609 dispatch->vkCreateBuffer(stateBlock->device, &bufferCreateInfo, nullptr, &stagingBuffer)); in loadBufferContent()
612 dispatch->vkGetBufferMemoryRequirements(stateBlock->device, stagingBuffer, in loadBufferContent()
616 GetMemoryType(*stateBlock->physicalDeviceInfo, stagingBufferMemoryRequirements, in loadBufferContent()
626 _RUN_AND_CHECK(dispatch->vkAllocateMemory(stateBlock->device, &stagingBufferMemoryAllocateInfo, in loadBufferContent()
629 dispatch->vkBindBufferMemory(stateBlock->device, stagingBuffer, stagingMemory, 0)); in loadBufferContent()
632 _RUN_AND_CHECK(dispatch->vkMapMemory(stateBlock->device, stagingMemory, 0, VK_WHOLE_SIZE, in loadBufferContent()
672 _RUN_AND_CHECK(dispatch->vkQueueSubmit(stateBlock->queue, 1, &submitInfo, fence)); in loadBufferContent()
673 _RUN_AND_CHECK(dispatch->vkWaitForFences(stateBlock->device, 1, &fence, VK_TRUE, 3000000000L)); in loadBufferContent()
674 _RUN_AND_CHECK(dispatch->vkResetFences(stateBlock->device, 1, &fence)); in loadBufferContent()
676 dispatch->vkDestroyFence(stateBlock->device, fence, nullptr); in loadBufferContent()
677 dispatch->vkUnmapMemory(stateBlock->device, stagingMemory); in loadBufferContent()
678 dispatch->vkDestroyBuffer(stateBlock->device, stagingBuffer, nullptr); in loadBufferContent()
679 dispatch->vkFreeMemory(stateBlock->device, stagingMemory, nullptr); in loadBufferContent()
680 dispatch->vkFreeCommandBuffers(stateBlock->device, stateBlock->commandPool, 1, &commandBuffer); in loadBufferContent()