| // 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. |
| |
| // Autogenerated module ResourceTracker |
| // (impl) generated by android/android-emugl/host/libs/libOpenglRender/vulkan-registry/xml/genvk.py -registry android/android-emugl/host/libs/libOpenglRender/vulkan-registry/xml/vk.xml cereal -o android/android-emugl/host/libs/libOpenglRender/vulkan/cereal |
| // Please do not modify directly; |
| // re-run android/scripts/generate-vulkan-sources.sh, |
| // or directly from Python by defining: |
| // VULKAN_REGISTRY_XML_DIR : Directory containing genvk.py and vk.xml |
| // CEREAL_OUTPUT_DIR: Where to put the generated sources. |
| // python3 $VULKAN_REGISTRY_XML_DIR/genvk.py -registry $VULKAN_REGISTRY_XML_DIR/vk.xml cereal -o $CEREAL_OUTPUT_DIR |
| |
| #include "ResourceTracker.h" |
| |
| |
| #include "Resources.h" |
| |
| |
| namespace goldfish_vk { |
| |
| class CreateMapping : public VulkanHandleMapping { |
| public: |
| virtual ~CreateMapping() { } |
| void mapHandles_VkBuffer(VkBuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkBuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkBufferView(VkBufferView* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkBufferView(handles[i]); |
| } |
| } |
| void mapHandles_VkCommandBuffer(VkCommandBuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkCommandBuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkCommandPool(VkCommandPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkCommandPool(handles[i]); |
| } |
| } |
| void mapHandles_VkDebugReportCallbackEXT(VkDebugReportCallbackEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDebugReportCallbackEXT(handles[i]); |
| } |
| } |
| void mapHandles_VkDebugUtilsMessengerEXT(VkDebugUtilsMessengerEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDebugUtilsMessengerEXT(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorPool(VkDescriptorPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDescriptorPool(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorSet(VkDescriptorSet* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDescriptorSet(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorSetLayout(VkDescriptorSetLayout* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDescriptorSetLayout(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorUpdateTemplate(VkDescriptorUpdateTemplate* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDescriptorUpdateTemplate(handles[i]); |
| } |
| } |
| void mapHandles_VkDevice(VkDevice* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDevice(handles[i]); |
| } |
| } |
| void mapHandles_VkDeviceMemory(VkDeviceMemory* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDeviceMemory(handles[i]); |
| } |
| } |
| void mapHandles_VkDisplayKHR(VkDisplayKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDisplayKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkDisplayModeKHR(VkDisplayModeKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkDisplayModeKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkEvent(VkEvent* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkEvent(handles[i]); |
| } |
| } |
| void mapHandles_VkFence(VkFence* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkFence(handles[i]); |
| } |
| } |
| void mapHandles_VkFramebuffer(VkFramebuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkFramebuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkImage(VkImage* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkImage(handles[i]); |
| } |
| } |
| void mapHandles_VkImageView(VkImageView* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkImageView(handles[i]); |
| } |
| } |
| void mapHandles_VkIndirectCommandsLayoutNVX(VkIndirectCommandsLayoutNVX* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkIndirectCommandsLayoutNVX(handles[i]); |
| } |
| } |
| void mapHandles_VkInstance(VkInstance* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkInstance(handles[i]); |
| } |
| } |
| void mapHandles_VkObjectTableNVX(VkObjectTableNVX* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkObjectTableNVX(handles[i]); |
| } |
| } |
| void mapHandles_VkPhysicalDevice(VkPhysicalDevice* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkPhysicalDevice(handles[i]); |
| } |
| } |
| void mapHandles_VkPipeline(VkPipeline* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkPipeline(handles[i]); |
| } |
| } |
| void mapHandles_VkPipelineCache(VkPipelineCache* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkPipelineCache(handles[i]); |
| } |
| } |
| void mapHandles_VkPipelineLayout(VkPipelineLayout* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkPipelineLayout(handles[i]); |
| } |
| } |
| void mapHandles_VkQueryPool(VkQueryPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkQueryPool(handles[i]); |
| } |
| } |
| void mapHandles_VkQueue(VkQueue* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkQueue(handles[i]); |
| } |
| } |
| void mapHandles_VkRenderPass(VkRenderPass* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkRenderPass(handles[i]); |
| } |
| } |
| void mapHandles_VkSampler(VkSampler* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkSampler(handles[i]); |
| } |
| } |
| void mapHandles_VkSamplerYcbcrConversion(VkSamplerYcbcrConversion* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkSamplerYcbcrConversion(handles[i]); |
| } |
| } |
| void mapHandles_VkSemaphore(VkSemaphore* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkSemaphore(handles[i]); |
| } |
| } |
| void mapHandles_VkShaderModule(VkShaderModule* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkShaderModule(handles[i]); |
| } |
| } |
| void mapHandles_VkSurfaceKHR(VkSurfaceKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkSurfaceKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkSwapchainKHR(VkSwapchainKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkSwapchainKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkValidationCacheEXT(VkValidationCacheEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = new_from_host_VkValidationCacheEXT(handles[i]); |
| } |
| } |
| }; |
| class UnwrapMapping : public VulkanHandleMapping { |
| public: |
| virtual ~UnwrapMapping() { } |
| void mapHandles_VkBuffer(VkBuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkBuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkBufferView(VkBufferView* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkBufferView(handles[i]); |
| } |
| } |
| void mapHandles_VkCommandBuffer(VkCommandBuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkCommandBuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkCommandPool(VkCommandPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkCommandPool(handles[i]); |
| } |
| } |
| void mapHandles_VkDebugReportCallbackEXT(VkDebugReportCallbackEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDebugReportCallbackEXT(handles[i]); |
| } |
| } |
| void mapHandles_VkDebugUtilsMessengerEXT(VkDebugUtilsMessengerEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDebugUtilsMessengerEXT(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorPool(VkDescriptorPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDescriptorPool(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorSet(VkDescriptorSet* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDescriptorSet(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorSetLayout(VkDescriptorSetLayout* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDescriptorSetLayout(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorUpdateTemplate(VkDescriptorUpdateTemplate* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDescriptorUpdateTemplate(handles[i]); |
| } |
| } |
| void mapHandles_VkDevice(VkDevice* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDevice(handles[i]); |
| } |
| } |
| void mapHandles_VkDeviceMemory(VkDeviceMemory* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDeviceMemory(handles[i]); |
| } |
| } |
| void mapHandles_VkDisplayKHR(VkDisplayKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDisplayKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkDisplayModeKHR(VkDisplayModeKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkDisplayModeKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkEvent(VkEvent* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkEvent(handles[i]); |
| } |
| } |
| void mapHandles_VkFence(VkFence* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkFence(handles[i]); |
| } |
| } |
| void mapHandles_VkFramebuffer(VkFramebuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkFramebuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkImage(VkImage* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkImage(handles[i]); |
| } |
| } |
| void mapHandles_VkImageView(VkImageView* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkImageView(handles[i]); |
| } |
| } |
| void mapHandles_VkIndirectCommandsLayoutNVX(VkIndirectCommandsLayoutNVX* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkIndirectCommandsLayoutNVX(handles[i]); |
| } |
| } |
| void mapHandles_VkInstance(VkInstance* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkInstance(handles[i]); |
| } |
| } |
| void mapHandles_VkObjectTableNVX(VkObjectTableNVX* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkObjectTableNVX(handles[i]); |
| } |
| } |
| void mapHandles_VkPhysicalDevice(VkPhysicalDevice* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkPhysicalDevice(handles[i]); |
| } |
| } |
| void mapHandles_VkPipeline(VkPipeline* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkPipeline(handles[i]); |
| } |
| } |
| void mapHandles_VkPipelineCache(VkPipelineCache* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkPipelineCache(handles[i]); |
| } |
| } |
| void mapHandles_VkPipelineLayout(VkPipelineLayout* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkPipelineLayout(handles[i]); |
| } |
| } |
| void mapHandles_VkQueryPool(VkQueryPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkQueryPool(handles[i]); |
| } |
| } |
| void mapHandles_VkQueue(VkQueue* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkQueue(handles[i]); |
| } |
| } |
| void mapHandles_VkRenderPass(VkRenderPass* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkRenderPass(handles[i]); |
| } |
| } |
| void mapHandles_VkSampler(VkSampler* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkSampler(handles[i]); |
| } |
| } |
| void mapHandles_VkSamplerYcbcrConversion(VkSamplerYcbcrConversion* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkSamplerYcbcrConversion(handles[i]); |
| } |
| } |
| void mapHandles_VkSemaphore(VkSemaphore* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkSemaphore(handles[i]); |
| } |
| } |
| void mapHandles_VkShaderModule(VkShaderModule* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkShaderModule(handles[i]); |
| } |
| } |
| void mapHandles_VkSurfaceKHR(VkSurfaceKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkSurfaceKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkSwapchainKHR(VkSwapchainKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkSwapchainKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkValidationCacheEXT(VkValidationCacheEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| handles[i] = get_host_VkValidationCacheEXT(handles[i]); |
| } |
| } |
| }; |
| class DestroyMapping : public VulkanHandleMapping { |
| public: |
| virtual ~DestroyMapping() { } |
| void mapHandles_VkBuffer(VkBuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkBuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkBufferView(VkBufferView* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkBufferView(handles[i]); |
| } |
| } |
| void mapHandles_VkCommandBuffer(VkCommandBuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkCommandBuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkCommandPool(VkCommandPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkCommandPool(handles[i]); |
| } |
| } |
| void mapHandles_VkDebugReportCallbackEXT(VkDebugReportCallbackEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDebugReportCallbackEXT(handles[i]); |
| } |
| } |
| void mapHandles_VkDebugUtilsMessengerEXT(VkDebugUtilsMessengerEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDebugUtilsMessengerEXT(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorPool(VkDescriptorPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDescriptorPool(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorSet(VkDescriptorSet* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDescriptorSet(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorSetLayout(VkDescriptorSetLayout* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDescriptorSetLayout(handles[i]); |
| } |
| } |
| void mapHandles_VkDescriptorUpdateTemplate(VkDescriptorUpdateTemplate* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDescriptorUpdateTemplate(handles[i]); |
| } |
| } |
| void mapHandles_VkDevice(VkDevice* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDevice(handles[i]); |
| } |
| } |
| void mapHandles_VkDeviceMemory(VkDeviceMemory* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDeviceMemory(handles[i]); |
| } |
| } |
| void mapHandles_VkDisplayKHR(VkDisplayKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDisplayKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkDisplayModeKHR(VkDisplayModeKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkDisplayModeKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkEvent(VkEvent* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkEvent(handles[i]); |
| } |
| } |
| void mapHandles_VkFence(VkFence* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkFence(handles[i]); |
| } |
| } |
| void mapHandles_VkFramebuffer(VkFramebuffer* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkFramebuffer(handles[i]); |
| } |
| } |
| void mapHandles_VkImage(VkImage* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkImage(handles[i]); |
| } |
| } |
| void mapHandles_VkImageView(VkImageView* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkImageView(handles[i]); |
| } |
| } |
| void mapHandles_VkIndirectCommandsLayoutNVX(VkIndirectCommandsLayoutNVX* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkIndirectCommandsLayoutNVX(handles[i]); |
| } |
| } |
| void mapHandles_VkInstance(VkInstance* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkInstance(handles[i]); |
| } |
| } |
| void mapHandles_VkObjectTableNVX(VkObjectTableNVX* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkObjectTableNVX(handles[i]); |
| } |
| } |
| void mapHandles_VkPhysicalDevice(VkPhysicalDevice* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkPhysicalDevice(handles[i]); |
| } |
| } |
| void mapHandles_VkPipeline(VkPipeline* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkPipeline(handles[i]); |
| } |
| } |
| void mapHandles_VkPipelineCache(VkPipelineCache* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkPipelineCache(handles[i]); |
| } |
| } |
| void mapHandles_VkPipelineLayout(VkPipelineLayout* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkPipelineLayout(handles[i]); |
| } |
| } |
| void mapHandles_VkQueryPool(VkQueryPool* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkQueryPool(handles[i]); |
| } |
| } |
| void mapHandles_VkQueue(VkQueue* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkQueue(handles[i]); |
| } |
| } |
| void mapHandles_VkRenderPass(VkRenderPass* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkRenderPass(handles[i]); |
| } |
| } |
| void mapHandles_VkSampler(VkSampler* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkSampler(handles[i]); |
| } |
| } |
| void mapHandles_VkSamplerYcbcrConversion(VkSamplerYcbcrConversion* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkSamplerYcbcrConversion(handles[i]); |
| } |
| } |
| void mapHandles_VkSemaphore(VkSemaphore* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkSemaphore(handles[i]); |
| } |
| } |
| void mapHandles_VkShaderModule(VkShaderModule* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkShaderModule(handles[i]); |
| } |
| } |
| void mapHandles_VkSurfaceKHR(VkSurfaceKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkSurfaceKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkSwapchainKHR(VkSwapchainKHR* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkSwapchainKHR(handles[i]); |
| } |
| } |
| void mapHandles_VkValidationCacheEXT(VkValidationCacheEXT* handles, size_t count) override |
| { |
| for (size_t i = 0; i < count; ++i) |
| { |
| delete_goldfish_VkValidationCacheEXT(handles[i]); |
| } |
| } |
| }; |
| |
| class ResourceTracker::Impl { |
| public: |
| Impl() = default; |
| CreateMapping createMapping; |
| UnwrapMapping unwrapMapping; |
| DestroyMapping destroyMapping; |
| }; |
| |
| ResourceTracker::ResourceTracker() : mImpl(new ResourceTracker::Impl()) { } |
| ResourceTracker::~ResourceTracker() { } |
| |
| VulkanHandleMapping* ResourceTracker::createMapping() { |
| return &mImpl->createMapping; |
| } |
| |
| VulkanHandleMapping* ResourceTracker::unwrapMapping() { |
| return &mImpl->unwrapMapping; |
| } |
| |
| VulkanHandleMapping* ResourceTracker::destroyMapping() { |
| return &mImpl->destroyMapping; |
| } |
| |
| static ResourceTracker* sTracker = nullptr; |
| |
| // static |
| ResourceTracker* ResourceTracker::get() { |
| if (!sTracker) { |
| // To be initialized once on vulkan device open. |
| sTracker = new ResourceTracker; |
| } |
| return sTracker; |
| } |
| #ifdef VK_VERSION_1_0 |
| #endif |
| #ifdef VK_VERSION_1_1 |
| #endif |
| #ifdef VK_KHR_surface |
| #endif |
| #ifdef VK_KHR_swapchain |
| #endif |
| #ifdef VK_KHR_display |
| #endif |
| #ifdef VK_KHR_display_swapchain |
| #endif |
| #ifdef VK_KHR_xlib_surface |
| #endif |
| #ifdef VK_KHR_xcb_surface |
| #endif |
| #ifdef VK_KHR_wayland_surface |
| #endif |
| #ifdef VK_KHR_mir_surface |
| #endif |
| #ifdef VK_KHR_android_surface |
| #endif |
| #ifdef VK_KHR_win32_surface |
| #endif |
| #ifdef VK_KHR_sampler_mirror_clamp_to_edge |
| #endif |
| #ifdef VK_KHR_multiview |
| #endif |
| #ifdef VK_KHR_get_physical_device_properties2 |
| #endif |
| #ifdef VK_KHR_device_group |
| #endif |
| #ifdef VK_KHR_shader_draw_parameters |
| #endif |
| #ifdef VK_KHR_maintenance1 |
| #endif |
| #ifdef VK_KHR_device_group_creation |
| #endif |
| #ifdef VK_KHR_external_memory_capabilities |
| #endif |
| #ifdef VK_KHR_external_memory |
| #endif |
| #ifdef VK_KHR_external_memory_win32 |
| #endif |
| #ifdef VK_KHR_external_memory_fd |
| #endif |
| #ifdef VK_KHR_win32_keyed_mutex |
| #endif |
| #ifdef VK_KHR_external_semaphore_capabilities |
| #endif |
| #ifdef VK_KHR_external_semaphore |
| #endif |
| #ifdef VK_KHR_external_semaphore_win32 |
| #endif |
| #ifdef VK_KHR_external_semaphore_fd |
| #endif |
| #ifdef VK_KHR_push_descriptor |
| #endif |
| #ifdef VK_KHR_16bit_storage |
| #endif |
| #ifdef VK_KHR_incremental_present |
| #endif |
| #ifdef VK_KHR_descriptor_update_template |
| #endif |
| #ifdef VK_KHR_create_renderpass2 |
| #endif |
| #ifdef VK_KHR_shared_presentable_image |
| #endif |
| #ifdef VK_KHR_external_fence_capabilities |
| #endif |
| #ifdef VK_KHR_external_fence |
| #endif |
| #ifdef VK_KHR_external_fence_win32 |
| #endif |
| #ifdef VK_KHR_external_fence_fd |
| #endif |
| #ifdef VK_KHR_maintenance2 |
| #endif |
| #ifdef VK_KHR_get_surface_capabilities2 |
| #endif |
| #ifdef VK_KHR_variable_pointers |
| #endif |
| #ifdef VK_KHR_get_display_properties2 |
| #endif |
| #ifdef VK_KHR_dedicated_allocation |
| #endif |
| #ifdef VK_KHR_storage_buffer_storage_class |
| #endif |
| #ifdef VK_KHR_relaxed_block_layout |
| #endif |
| #ifdef VK_KHR_get_memory_requirements2 |
| #endif |
| #ifdef VK_KHR_image_format_list |
| #endif |
| #ifdef VK_KHR_sampler_ycbcr_conversion |
| #endif |
| #ifdef VK_KHR_bind_memory2 |
| #endif |
| #ifdef VK_KHR_maintenance3 |
| #endif |
| #ifdef VK_KHR_draw_indirect_count |
| #endif |
| #ifdef VK_KHR_8bit_storage |
| #endif |
| #ifdef VK_EXT_debug_report |
| #endif |
| #ifdef VK_NV_glsl_shader |
| #endif |
| #ifdef VK_EXT_depth_range_unrestricted |
| #endif |
| #ifdef VK_IMG_filter_cubic |
| #endif |
| #ifdef VK_AMD_rasterization_order |
| #endif |
| #ifdef VK_AMD_shader_trinary_minmax |
| #endif |
| #ifdef VK_AMD_shader_explicit_vertex_parameter |
| #endif |
| #ifdef VK_EXT_debug_marker |
| #endif |
| #ifdef VK_AMD_gcn_shader |
| #endif |
| #ifdef VK_NV_dedicated_allocation |
| #endif |
| #ifdef VK_AMD_draw_indirect_count |
| #endif |
| #ifdef VK_AMD_negative_viewport_height |
| #endif |
| #ifdef VK_AMD_gpu_shader_half_float |
| #endif |
| #ifdef VK_AMD_shader_ballot |
| #endif |
| #ifdef VK_AMD_texture_gather_bias_lod |
| #endif |
| #ifdef VK_AMD_shader_info |
| #endif |
| #ifdef VK_AMD_shader_image_load_store_lod |
| #endif |
| #ifdef VK_IMG_format_pvrtc |
| #endif |
| #ifdef VK_NV_external_memory_capabilities |
| #endif |
| #ifdef VK_NV_external_memory |
| #endif |
| #ifdef VK_NV_external_memory_win32 |
| #endif |
| #ifdef VK_NV_win32_keyed_mutex |
| #endif |
| #ifdef VK_EXT_validation_flags |
| #endif |
| #ifdef VK_NN_vi_surface |
| #endif |
| #ifdef VK_EXT_shader_subgroup_ballot |
| #endif |
| #ifdef VK_EXT_shader_subgroup_vote |
| #endif |
| #ifdef VK_EXT_conditional_rendering |
| #endif |
| #ifdef VK_NVX_device_generated_commands |
| #endif |
| #ifdef VK_NV_clip_space_w_scaling |
| #endif |
| #ifdef VK_EXT_direct_mode_display |
| #endif |
| #ifdef VK_EXT_acquire_xlib_display |
| #endif |
| #ifdef VK_EXT_display_surface_counter |
| #endif |
| #ifdef VK_EXT_display_control |
| #endif |
| #ifdef VK_GOOGLE_display_timing |
| #endif |
| #ifdef VK_NV_sample_mask_override_coverage |
| #endif |
| #ifdef VK_NV_geometry_shader_passthrough |
| #endif |
| #ifdef VK_NV_viewport_array2 |
| #endif |
| #ifdef VK_NVX_multiview_per_view_attributes |
| #endif |
| #ifdef VK_NV_viewport_swizzle |
| #endif |
| #ifdef VK_EXT_discard_rectangles |
| #endif |
| #ifdef VK_EXT_conservative_rasterization |
| #endif |
| #ifdef VK_EXT_swapchain_colorspace |
| #endif |
| #ifdef VK_EXT_hdr_metadata |
| #endif |
| #ifdef VK_MVK_ios_surface |
| #endif |
| #ifdef VK_MVK_macos_surface |
| #endif |
| #ifdef VK_EXT_external_memory_dma_buf |
| #endif |
| #ifdef VK_EXT_queue_family_foreign |
| #endif |
| #ifdef VK_EXT_debug_utils |
| #endif |
| #ifdef VK_ANDROID_external_memory_android_hardware_buffer |
| #endif |
| #ifdef VK_EXT_sampler_filter_minmax |
| #endif |
| #ifdef VK_AMD_gpu_shader_int16 |
| #endif |
| #ifdef VK_AMD_mixed_attachment_samples |
| #endif |
| #ifdef VK_AMD_shader_fragment_mask |
| #endif |
| #ifdef VK_EXT_shader_stencil_export |
| #endif |
| #ifdef VK_EXT_sample_locations |
| #endif |
| #ifdef VK_EXT_blend_operation_advanced |
| #endif |
| #ifdef VK_NV_fragment_coverage_to_color |
| #endif |
| #ifdef VK_NV_framebuffer_mixed_samples |
| #endif |
| #ifdef VK_NV_fill_rectangle |
| #endif |
| #ifdef VK_EXT_post_depth_coverage |
| #endif |
| #ifdef VK_EXT_validation_cache |
| #endif |
| #ifdef VK_EXT_descriptor_indexing |
| #endif |
| #ifdef VK_EXT_shader_viewport_index_layer |
| #endif |
| #ifdef VK_EXT_global_priority |
| #endif |
| #ifdef VK_EXT_external_memory_host |
| #endif |
| #ifdef VK_AMD_buffer_marker |
| #endif |
| #ifdef VK_AMD_shader_core_properties |
| #endif |
| #ifdef VK_EXT_vertex_attribute_divisor |
| #endif |
| #ifdef VK_NV_shader_subgroup_partitioned |
| #endif |
| #ifdef VK_NV_device_diagnostic_checkpoints |
| #endif |
| |
| } // namespace goldfish_vk |