[vulkan] deferred command buffers (guest)

bug: 111137294

When we get "ANDROID_EMU_deferred_vulkan_commands" in the
renderControl string from the host, enable
deferred command buffer recording, where we
avoid a round trip + immediate recording on
vkBegin/End/ResetCommandBuffer; this has the effect of
delaying command submission to the next round trip, which
is no later than when these commands are submitted.

To the guest, command recording will feel much faster.

It is true that we will end up delaying command buffer submission
on host until the next vkQueueSubmit; however, it may work out,
because we can record + submit on the host with possibly less
scheduling overhead than before.

Test: glmark2 ANGLE score rose from high 400s-500s to 600s

Change-Id: Ib76be4de05c768d395135ad2c9525d3e156daf31
diff --git a/system/vulkan_enc/ResourceTracker.h b/system/vulkan_enc/ResourceTracker.h
index 3217f45..200bfb6 100644
--- a/system/vulkan_enc/ResourceTracker.h
+++ b/system/vulkan_enc/ResourceTracker.h
@@ -321,6 +321,18 @@
         const VkPhysicalDeviceImageFormatInfo2* pImageFormatInfo,
         VkImageFormatProperties2* pImageFormatProperties);
 
+    VkResult on_vkBeginCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer,
+        const VkCommandBufferBeginInfo* pBeginInfo);
+    VkResult on_vkEndCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer);
+    VkResult on_vkResetCommandBuffer(
+        void* context, VkResult input_result,
+        VkCommandBuffer commandBuffer,
+        VkCommandBufferResetFlags flags);
+
     bool isMemoryTypeHostVisible(VkDevice device, uint32_t typeIndex) const;
     uint8_t* getMappedPointer(VkDeviceMemory memory);
     VkDeviceSize getMappedSize(VkDeviceMemory memory);