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 /// Instance extensions available. 53 std::vector<std::string> available_instance_extensions; 54 55 /// Physical device extensions available for |physical_device|. 56 std::vector<std::string> available_device_extensions; 57 58 /// The given queue family index to use. 59 uint32_t queue_family_index; 60 61 /// The VkDevice to use. 62 VkDevice device; 63 64 /// The VkQueue to use. 65 VkQueue queue; 66 }; 67 68 } // namespace amber 69 70 #endif // AMBER_AMBER_VULKAN_H_ 71