1 // Copyright (C) 2018 The Android Open Source Project 2 // Copyright (C) 2018 Google Inc. 3 // 4 // Licensed under the Apache License, Version 2.0 (the "License"); 5 // you may not use this file except in compliance with the License. 6 // You may obtain a copy of the License at 7 // 8 // http://www.apache.org/licenses/LICENSE-2.0 9 // 10 // Unless required by applicable law or agreed to in writing, software 11 // distributed under the License is distributed on an "AS IS" BASIS, 12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 // See the License for the specific language governing permissions and 14 // limitations under the License. 15 #pragma once 16 17 #include <vulkan/vulkan.h> 18 19 #define GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(f) \ 20 f(VkInstance) \ 21 f(VkPhysicalDevice) \ 22 f(VkDevice) \ 23 f(VkQueue) \ 24 f(VkCommandBuffer) 25 26 #define GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f) \ 27 f(VkBuffer) \ 28 f(VkBufferView) \ 29 f(VkImage) \ 30 f(VkImageView) \ 31 f(VkShaderModule) \ 32 f(VkDescriptorPool) \ 33 f(VkDescriptorSetLayout) \ 34 f(VkDescriptorSet) \ 35 f(VkSampler) \ 36 f(VkPipeline) \ 37 f(VkPipelineCache) \ 38 f(VkPipelineLayout) \ 39 f(VkRenderPass) \ 40 f(VkFramebuffer) \ 41 f(VkCommandPool) \ 42 f(VkFence) \ 43 f(VkSemaphore) \ 44 f(VkEvent) \ 45 f(VkQueryPool) \ 46 f(VkSamplerYcbcrConversion) \ 47 f(VkDescriptorUpdateTemplate) \ 48 f(VkSurfaceKHR) \ 49 f(VkSwapchainKHR) \ 50 f(VkDisplayKHR) \ 51 f(VkDisplayModeKHR) \ 52 f(VkValidationCacheEXT) \ 53 f(VkDebugReportCallbackEXT) \ 54 f(VkDebugUtilsMessengerEXT) \ 55 f(VkAccelerationStructureNV) \ 56 f(VkIndirectCommandsLayoutNV) \ 57 f(VkAccelerationStructureKHR) \ 58 f(VkCuModuleNVX) \ 59 f(VkCuFunctionNVX) \ 60 f(VkMicromapEXT) 61 62 #define GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(f) \ 63 f(VkDeviceMemory) \ 64 GOLDFISH_VK_LIST_TRIVIAL_NON_DISPATCHABLE_HANDLE_TYPES(f) 65 66 #define GOLDFISH_VK_LIST_HANDLE_TYPES(f) \ 67 GOLDFISH_VK_LIST_DISPATCHABLE_HANDLE_TYPES(f) \ 68 GOLDFISH_VK_LIST_NON_DISPATCHABLE_HANDLE_TYPES(f) 69 70 // Need to sort by snapshot load dependency order 71 #define GOLDFISH_VK_LIST_HANDLE_TYPES_BY_STAGE(f) \ 72 f(VkInstance) \ 73 f(VkPhysicalDevice) \ 74 f(VkDevice) \ 75 f(VkQueue) \ 76 f(VkDeviceMemory) \ 77 f(VkBuffer) \ 78 f(VkImage) \ 79 f(VkBufferView) \ 80 f(VkImageView) \ 81 f(VkShaderModule) \ 82 f(VkDescriptorSetLayout) \ 83 f(VkDescriptorPool) \ 84 f(VkDescriptorSet) \ 85 f(VkSampler) \ 86 f(VkSamplerYcbcrConversion) \ 87 f(VkDescriptorUpdateTemplate) \ 88 f(VkRenderPass) \ 89 f(VkFramebuffer) \ 90 f(VkPipelineLayout) \ 91 f(VkPipelineCache) \ 92 f(VkPipeline) \ 93 f(VkFence) \ 94 f(VkSemaphore) \ 95 f(VkEvent) \ 96 f(VkQueryPool) \ 97 f(VkSurfaceKHR) \ 98 f(VkSwapchainKHR) \ 99 f(VkDisplayKHR) \ 100 f(VkDisplayModeKHR) \ 101 f(VkValidationCacheEXT) \ 102 f(VkDebugReportCallbackEXT) \ 103 f(VkDebugUtilsMessengerEXT) \ 104 f(VkCommandPool) \ 105 f(VkCommandBuffer) \ 106 f(VkAccelerationStructureNV) \ 107 f(VkIndirectCommandsLayoutNV) \ 108 f(VkAccelerationStructureKHR) \ 109 f(VkCuModuleNVX) \ 110 f(VkCuFunctionNVX) \ 111 f(VkMicromapEXT) 112