| 1151 | } |
| 1152 | } |
| 1153 | |
| 1154 | template <vkb::BindingType bindingType> |
| 1155 | inline bool VulkanSample<bindingType>::prepare(const ApplicationOptions &options) |
| 1156 | { |
| 1157 | if (!Parent::prepare(options)) |
| 1158 | { |
| 1159 | return false; |
| 1160 | } |
| 1161 | |
| 1162 | LOGI("Initializing Vulkan sample"); |
| 1163 | |
| 1164 | // initialize C++-Bindings default dispatcher, first step |
| 1165 | #if defined(_HPP_VULKAN_LIBRARY) |
| 1166 | static vk::detail::DynamicLoader dl(_HPP_VULKAN_LIBRARY); |
| 1167 | #else |
| 1168 | static vk::detail::DynamicLoader dl; |
| 1169 | #endif |
| 1170 | VULKAN_HPP_DEFAULT_DISPATCHER.init(dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr")); |
| 1171 | |
| 1172 | bool headless = window->get_window_mode() == Window::Mode::Headless; |
| 1173 | |
| 1174 | // for a while we're running on mixed C- and C++-bindings, needing volk for the C-bindings! |
| 1175 | VkResult result = volkInitialize(); |
| 1176 | if (result) |
| 1177 | { |
| 1178 | throw VulkanException(result, "Failed to initialize volk."); |
| 1179 | } |
| 1180 | |
| 1181 | if constexpr (bindingType == BindingType::Cpp) |
| 1182 | { |
| 1183 | instance = create_instance(); |
| 1184 | } |
| 1185 | else |
| 1186 | { |
| 1187 | instance.reset(reinterpret_cast<vkb::core::InstanceCpp *>(create_instance().release())); |
| 1188 | } |
| 1189 |
nothing calls this directly
no test coverage detected