[vulkan] VulkanHandleMapping abstract class

bug: 111137294
bug: 119104304
bug: 119157982

This sets the stage to easily generate code related to resource
tracking for the encoder.

The abstraction approach is as follows:

1. When we do anything to a Vulkan resource, it's going to be an
operation on one or more Vulkan handles, so the basic abstract method
is going to be some map operation on an array of Vulkan handles.
2. Sometimes we replace the handle with another, such as when we
are unwrapping the host Vulkan handle, or wrapping up a host Vulkan
handle in our internal structs. So the array of handles allows
write as well as read.
3. The most important operations are create/destroy/unwrap, which all
work well in terms of the handle mapping operation.

So, the VulkanHandleMapping abstract class consists of map operations
for each Vulkan handle type.

The actual classes that create/destroy/unwrap will implement this
interface.

Change-Id: If00e78e092d2eeba40f916c18c212893c73db073
diff --git a/system/vulkan_enc/VulkanHandleMapping.h b/system/vulkan_enc/VulkanHandleMapping.h
new file mode 100644
index 0000000..9ce5e65
--- /dev/null
+++ b/system/vulkan_enc/VulkanHandleMapping.h
@@ -0,0 +1,82 @@
+// Copyright (C) 2018 The Android Open Source Project
+// Copyright (C) 2018 Google Inc.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <vulkan/vulkan.h>
+
+namespace goldfish_vk {
+
+class VulkanHandleMapping {
+public:
+    VulkanHandleMapping() = default;
+    virtual ~VulkanHandleMapping() { }
+
+    virtual void mapHandles_VkInstance(VkInstance* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDevice(VkDevice* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkQueue(VkQueue* handles, size_t count = 1) = 0;
+
+    virtual void mapHandles_VkSemaphore(VkSemaphore* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkCommandBuffer(VkCommandBuffer* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDeviceMemory(VkDeviceMemory* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkBuffer(VkBuffer* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkImage(VkImage* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkShaderModule(VkShaderModule* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkPipelineLayout(VkPipelineLayout* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkRenderPass(VkRenderPass* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkPipeline(VkPipeline* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkPipelineCache(VkPipelineCache* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDescriptorSetLayout(VkDescriptorSetLayout* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkSampler(VkSampler* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDescriptorPool(VkDescriptorPool* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkImageView(VkImageView* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDescriptorSet(VkDescriptorSet* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkBufferView(VkBufferView* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkCommandPool(VkCommandPool* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkFramebuffer(VkFramebuffer* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkPhysicalDevice(VkPhysicalDevice* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkFence(VkFence* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkEvent(VkEvent* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkQueryPool(VkQueryPool* handles, size_t count = 1) = 0;
+
+    virtual void mapHandles_VkSamplerYcbcrConversion(VkSamplerYcbcrConversion* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDescriptorUpdateTemplate(VkDescriptorUpdateTemplate* handles, size_t count = 1) = 0;
+
+#ifdef VK_KHR_swapchain
+    virtual void mapHandles_VkSurfaceKHR(VkSurfaceKHR* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkSwapchainKHR(VkSwapchainKHR* handles, size_t count = 1) = 0;
+#endif
+
+#ifdef VK_KHR_display
+    virtual void mapHandles_VkDisplayKHR(VkDisplayKHR* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDisplayModeKHR(VkDisplayModeKHR* handles, size_t count = 1) = 0;
+#endif
+
+#ifdef VK_NVX_device_generated_commands
+    virtual void mapHandles_VkObjectTableNVX(VkObjectTableNVX* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkIndirectCommandsLayoutNVX(VkIndirectCommandsLayoutNVX* handles, size_t count = 1) = 0;
+#endif
+
+#ifdef VK_EXT_validation_cache
+    virtual void mapHandles_VkValidationCacheEXT(VkValidationCacheEXT* handles, size_t count = 1) = 0;
+#endif
+
+#ifdef VK_EXT_debug_report
+    virtual void mapHandles_VkDebugReportCallbackEXT(VkDebugReportCallbackEXT* handles, size_t count = 1) = 0;
+    virtual void mapHandles_VkDebugUtilsMessengerEXT(VkDebugUtilsMessengerEXT* handles, size_t count = 1) = 0;
+#endif
+
+};
+
+} // namespace goldfish_vk