1 // Copyright 2018 The Amber Authors. 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #ifndef AMBER_AMBER_VULKAN_H_ 16 #define AMBER_AMBER_VULKAN_H_ 17 18 #include <limits> 19 #include <string> 20 #include <vector> 21 22 #include "amber/amber.h" 23 #include "amber/vulkan_header.h" 24 25 namespace amber { 26 27 /// Configuration for the Vulkan Engine. The following are all required when 28 /// when using the vulkan backend. 29 struct VulkanEngineConfig : public EngineConfig { 30 ~VulkanEngineConfig() override; 31 32 /// The Vulkan instance procedure loader. 33 PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr; 34 35 /// The VkInstance to use. 36 VkInstance instance; 37 38 /// The VkPhysicalDevice to use. 39 VkPhysicalDevice physical_device; 40 41 /// Physical device features available for |physical_device|. The 42 /// |available_features| will be ignored if 43 /// VK_KHR_get_physical_device_features2 is enabled, |available_features2| 44 /// will be used in that case. 45 VkPhysicalDeviceFeatures available_features; 46 47 /// Physical device features for |physical_device|.The |available_features2| 48 /// will only be used if VK_KHR_get_physical_device_features2 is enabled. If 49 /// the extension is not enabled, |available_features| will be used. 50 VkPhysicalDeviceFeatures2KHR available_features2; 51 52 /// Physical device properties available for |physical_device|. The 53 /// |available_properties| will be ignored if 54 /// VK_KHR_get_physical_device_properties2 is enabled, |available_properties2| 55 /// will be used in that case. 56 VkPhysicalDeviceProperties available_properties; 57 58 /// Physical device properties for |physical_device|.The 59 /// |available_properties2| will only be used if 60 /// VK_KHR_get_physical_device_properties2 is enabled. If the extension is not 61 /// enabled, |available_properties| will be used. 62 VkPhysicalDeviceProperties2KHR available_properties2; 63 64 /// Instance extensions available. 65 std::vector<std::string> available_instance_extensions; 66 67 /// Physical device extensions available for |physical_device|. 68 std::vector<std::string> available_device_extensions; 69 70 /// The given queue family index to use. 71 uint32_t queue_family_index; 72 73 /// The VkDevice to use. 74 VkDevice device; 75 76 /// The VkQueue to use. 77 VkQueue queue; 78 }; 79 80 } // namespace amber 81 82 #endif // AMBER_AMBER_VULKAN_H_ 83