| 330 | }; |
| 331 | |
| 332 | struct Demo { |
| 333 | void build_image_ownership_cmd(const SubmissionResources &submission_resource, |
| 334 | const SwapchainImageResources &swapchain_image_resource); |
| 335 | vk::Bool32 check_layers(const std::vector<const char *> &check_names, const std::vector<vk::LayerProperties> &layers); |
| 336 | void cleanup(); |
| 337 | void create_device(); |
| 338 | void destroy_texture(texture_object &tex_objs); |
| 339 | void draw(); |
| 340 | void draw_build_cmd(const SubmissionResources &submission_resource, const SwapchainImageResources &swapchain_image_resource); |
| 341 | void prepare_init_cmd(); |
| 342 | void flush_init_cmd(); |
| 343 | void init(int argc, char **argv); |
| 344 | void check_and_set_wsi_platform(); |
| 345 | void init_vk(); |
| 346 | void select_physical_device(); |
| 347 | void init_vk_swapchain(); |
| 348 | |
| 349 | void prepare(); |
| 350 | void prepare_cube_data_buffers(); |
| 351 | void prepare_descriptor_layout(); |
| 352 | void prepare_descriptor_pool(); |
| 353 | void prepare_descriptor_set(); |
| 354 | void prepare_submission_sync_objects(); |
| 355 | vk::ShaderModule prepare_shader_module(const uint32_t *code, size_t size); |
| 356 | vk::ShaderModule prepare_vs(); |
| 357 | vk::ShaderModule prepare_fs(); |
| 358 | void prepare_pipeline(); |
| 359 | void prepare_render_pass(); |
| 360 | void prepare_texture_image(const char *filename, texture_object &tex_obj, vk::ImageTiling tiling, vk::ImageUsageFlags usage, |
| 361 | vk::MemoryPropertyFlags required_props); |
| 362 | void prepare_texture_buffer(const char *filename, texture_object &tex_obj); |
| 363 | void prepare_textures(); |
| 364 | |
| 365 | void resize(); |
| 366 | void create_surface(); |
| 367 | void prepare_swapchain(); |
| 368 | void prepare_framebuffers(); |
| 369 | void prepare_depth(); |
| 370 | |
| 371 | void set_image_layout(vk::Image image, vk::ImageAspectFlags aspectMask, vk::ImageLayout oldLayout, vk::ImageLayout newLayout, |
| 372 | vk::AccessFlags srcAccessMask, vk::PipelineStageFlags src_stages, vk::PipelineStageFlags dest_stages); |
| 373 | void update_data_buffer(void *uniform_memory_ptr); |
| 374 | bool loadTexture(const char *filename, uint8_t *rgba_data, vk::SubresourceLayout &layout, uint32_t &width, uint32_t &height); |
| 375 | bool memory_type_from_properties(uint32_t typeBits, vk::MemoryPropertyFlags requirements_mask, uint32_t &typeIndex); |
| 376 | vk::SurfaceFormatKHR pick_surface_format(const std::vector<vk::SurfaceFormatKHR> &surface_formats); |
| 377 | |
| 378 | static VKAPI_ATTR vk::Bool32 VKAPI_CALL debug_messenger_callback(vk::DebugUtilsMessageSeverityFlagBitsEXT messageSeverity, |
| 379 | vk::DebugUtilsMessageTypeFlagsEXT messageType, |
| 380 | const vk::DebugUtilsMessengerCallbackDataEXT *pCallbackData, |
| 381 | void *pUserData); |
| 382 | |
| 383 | template <WsiPlatform WSI_PLATFORM> |
| 384 | void create_window() = delete; |
| 385 | template <WsiPlatform WSI_PLATFORM> |
| 386 | void run() = delete; |
| 387 | template <WsiPlatform WSI_PLATFORM> |
| 388 | void execute(); |
| 389 | #if defined(VK_USE_PLATFORM_XLIB_KHR) |
nothing calls this directly
no test coverage detected