![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <vulkan_display.hpp>

Classes | |
| struct | RenderedImage |
Private Types | |
| using | TransferImageImpl = detail::TransferImageImpl |
Private Member Functions | |
| TransferImageImpl & | acquire_transfer_image () |
| void | bind_transfer_image (TransferImageImpl &image, detail::PerFrameResources &resources) |
| void | destroy_format_dependent_resources () |
| void | reconfigure (const TransferImageImpl &transfer_image) |
| void | record_graphics_commands (detail::PerFrameResources &commands, TransferImageImpl &transfer_image, uint32_t swapchain_image_id) |
Definition at line 84 of file vulkan_display.hpp.
Definition at line 105 of file vulkan_display.hpp.
|
default |
TERMINOLOGY: render thread - thread which renders queued images on the screen provider thread - thread which calls getf and putf and fills image queue with newly filled images
|
delete |
|
delete |
|
inlinenoexcept |
Definition at line 144 of file vulkan_display.hpp.
References destroy(), destroyed, vulkan_display::error, and vulkan_display_detail::vulkan_log_msg.

| TransferImage vulkan_display::VulkanDisplay::acquire_image | ( | ImageDescription | description | ) |
Thread-safe to call from provider thread.
Definition at line 418 of file vulkan_display.cpp.
References acquire_transfer_image(), context, description, device_mutex, vulkan_display_detail::TransferImageImpl::get_id(), vulkan_display_detail::TransferImageImpl::get_image_description(), vulkan_display_detail::TransferImageImpl::NO_ID, and vulkan_display_detail::TransferImageImpl::recreate().
Referenced by copy_and_queue_image().

|
nodiscardprivate |
Definition at line 400 of file vulkan_display.cpp.
References available_images, available_img_queue, device, and transfer_images.
Referenced by acquire_image().
|
private |
Definition at line 320 of file vulkan_display.cpp.
References conversion_pipeline, vulkan_display_detail::PerFrameResources::conversion_source_descriptor_set, device, format_conversion_enabled, vulkan_display_detail::TransferImageImpl::get_image_view(), vulkan_display_detail::ConversionPipeline::get_sampler(), vulkan_display_detail::RenderPipeline::get_sampler(), vulkan_display_detail::ConversionPipeline::get_yCbCr_conversion(), vulkan_display_detail::RenderPipeline::get_yCbCr_conversion(), vulkan_display_detail::PerFrameResources::render_descriptor_set, and render_pipeline.
Referenced by display_queued_image().

| void vulkan_display::VulkanDisplay::copy_and_queue_image | ( | unsigned char * | frame, |
| ImageDescription | description ) |
Thread-safe to call from provider thread.
Definition at line 431 of file vulkan_display.cpp.
References acquire_image(), description, frame, vulkan_display::TransferImage::get_memory_ptr(), vulkan_display::TransferImage::get_row_pitch(), vulkan_display::TransferImage::get_size(), and queue_image().

| void vulkan_display::VulkanDisplay::destroy | ( | ) |
Definition at line 278 of file vulkan_display.cpp.
References command_pool, context, conversion_pipeline, descriptor_pool, vulkan_display_detail::ConversionPipeline::destroy(), vulkan_display_detail::RenderPipeline::destroy(), vulkan_display_detail::VulkanContext::destroy(), destroy_format_dependent_resources(), destroyed, device, frame_resources, render_pipeline, and transfer_images.
Referenced by ~VulkanDisplay().

|
private |
Definition at line 270 of file vulkan_display.cpp.
References conversion_pipeline, vulkan_display_detail::ConversionPipeline::destroy(), device, and frame_resources.
Referenced by destroy(), and reconfigure().

|
inline |
Thread-safe to call from provider thread.
Definition at line 177 of file vulkan_display.hpp.
References available_images, and vulkan_display::TransferImage::get_transfer_image().

| bool vulkan_display::VulkanDisplay::display_queued_image | ( | ) |
Thread-safe to call from render thread.
Definition at line 508 of file vulkan_display.cpp.
References vulkan_display_detail::VulkanContext::acquire_next_swapchain_image(), available_img_queue, bind_transfer_image(), context, current_image_description, device, device_mutex, filled_img_queue, free_frame_resources, vulkan_display_detail::TransferImageImpl::get_image_description(), vulkan_display_detail::VulkanContext::get_queue(), vulkan_display_detail::VulkanContext::get_render_area_size(), vulkan_display_detail::RenderPipeline::get_render_pass(), vulkan_display_detail::VulkanContext::get_swapchain(), vulkan_display::WindowChangedCallback::get_window_parameters(), vulkan_display_detail::TransferImageImpl::is_available_fence, vulkan_display_detail::TransferImageImpl::preprocess(), reconfigure(), record_graphics_commands(), vulkan_display_detail::VulkanContext::recreate_swapchain(), render_pipeline, rendered_images, vulkan_display::ImageDescription::size, vulkan_display_detail::swapchain_image_out_of_date, vulkan_display_detail::swapchain_image_timeout, vulkan_display_detail::RenderPipeline::update_render_area(), and window.

|
inline |
Thread-safe
Definition at line 192 of file vulkan_display.hpp.
References context, and vulkan_display_detail::VulkanContext::get_vulkan_version().

| void vulkan_display::VulkanDisplay::init | ( | VulkanInstance && | instance, |
| vk::SurfaceKHR | surface, | ||
| uint32_t | transfer_image_count, | ||
| WindowChangedCallback & | window, | ||
| uint32_t | gpu_index = no_gpu_selected, | ||
| std::string | path_to_shaders = "./shaders", | ||
| bool | vsync = true, | ||
| bool | tearing_permitted = false ) |
Definition at line 232 of file vulkan_display.cpp.
References available_images, command_pool, context, vulkan_display_detail::RenderPipeline::create(), vulkan_display_detail::VulkanContext::create_framebuffers(), descriptor_pool, device, frame_resources, free_frame_resources, vulkan_display_detail::VulkanContext::get_device(), vulkan_display_detail::VulkanContext::get_queue_family_index(), vulkan_display_detail::RenderPipeline::get_render_pass(), vulkan_display::WindowChangedCallback::get_window_parameters(), vulkan_display_detail::VulkanContext::init(), instance, path_to_shaders, render_pipeline, transfer_images, and window.

| bool vulkan_display::VulkanDisplay::is_image_description_supported | ( | ImageDescription | description | ) |
Thread-safe
Definition at line 301 of file vulkan_display.cpp.
References vulkan_display_detail::FormatInfo::buffer_format, context, vulkan_display_detail::FormatInfo::conversion_image_format, description, device_mutex, vulkan_display_detail::format_info(), vulkan_display_detail::get_buffer_size(), vulkan_display_detail::VulkanContext::get_gpu(), is_format_supported(), and vulkan_display_detail::VulkanContext::is_yCbCr_supported().

|
inline |
Thread-safe
Definition at line 195 of file vulkan_display.hpp.
References context, and vulkan_display_detail::VulkanContext::is_yCbCr_supported().

|
delete |
|
delete |
| bool vulkan_display::VulkanDisplay::queue_image | ( | TransferImage | img, |
| bool | discardable ) |
Thread-safe to call from provider thread.
Definition at line 437 of file vulkan_display.cpp.
References available_images, filled_img_queue, and vulkan_display::TransferImage::get_transfer_image().
Referenced by copy_and_queue_image().

|
private |
Definition at line 452 of file vulkan_display.cpp.
References context, conversion_pipeline, vulkan_display_detail::ConversionPipeline::create(), current_image_description, descriptor_pool, destroy_format_dependent_resources(), device, format_conversion_enabled, vulkan_display::ImageDescription::format_info(), frame_resources, vulkan_display_detail::ConversionPipeline::get_destination_image_desc_set_layout(), vulkan_display_detail::RenderPipeline::get_image_desc_set_layout(), vulkan_display_detail::TransferImageImpl::get_image_description(), vulkan_display_detail::VulkanContext::get_queue(), vulkan_display_detail::VulkanContext::get_render_area_size(), vulkan_display_detail::ConversionPipeline::get_sampler(), vulkan_display_detail::ConversionPipeline::get_source_image_desc_set_layout(), vulkan_display::info, path_to_shaders, vulkan_display_detail::RenderPipeline::reconfigure(), render_pipeline, vulkan_display::ImageDescription::size, vulkan_display_detail::RenderPipeline::update_render_area(), and vulkan_display_detail::vulkan_log_msg.
Referenced by display_queued_image().

|
private |
Definition at line 351 of file vulkan_display.cpp.
References context, conversion_pipeline, vulkan_display_detail::Image2D::create_memory_barrier(), format_conversion_enabled, frame_resources, vulkan_display_detail::ImageSize::fromExtent2D(), vulkan_display_detail::TransferImageImpl::get_buffer(), vulkan_display_detail::VulkanContext::get_framebuffer(), vulkan_display_detail::ConversionPipeline::record_commands(), vulkan_display_detail::RenderPipeline::record_commands(), and render_pipeline.
Referenced by display_queued_image().

|
inline |
Thread-safe
Definition at line 205 of file vulkan_display.hpp.
References vulkan_display::WindowChangedCallback::get_window_parameters(), window, and window_parameters_changed().
Referenced by window_parameters_changed().

| void vulkan_display::VulkanDisplay::window_parameters_changed | ( | WindowParameters | new_parameters | ) |
Hint to vulkan display that some window parameters spicified in struct WindowParameters changed. Thread-safe.
Definition at line 629 of file vulkan_display.cpp.
References context, current_image_description, device_mutex, vulkan_display_detail::VulkanContext::get_render_area_size(), vulkan_display_detail::RenderPipeline::get_render_pass(), vulkan_display_detail::VulkanContext::get_window_parameters(), vulkan_display::WindowParameters::is_minimized(), vulkan_display_detail::VulkanContext::recreate_swapchain(), render_pipeline, vulkan_display::ImageDescription::size, and vulkan_display_detail::RenderPipeline::update_render_area().

|
private |
local to provider thread
Definition at line 113 of file vulkan_display.hpp.
Referenced by acquire_transfer_image(), discard_image(), init(), and queue_image().
|
private |
available_img_queue - producer is the render thread, consumer is the provided thread
Definition at line 109 of file vulkan_display.hpp.
Referenced by acquire_transfer_image(), and display_queued_image().
|
private |
Definition at line 98 of file vulkan_display.hpp.
|
private |
Definition at line 87 of file vulkan_display.hpp.
Referenced by acquire_image(), destroy(), display_queued_image(), get_vulkan_version(), init(), is_image_description_supported(), is_yCbCr_supported(), reconfigure(), record_graphics_commands(), and window_parameters_changed().
|
private |
Definition at line 93 of file vulkan_display.hpp.
Referenced by bind_transfer_image(), destroy(), destroy_format_dependent_resources(), reconfigure(), and record_graphics_commands().
|
private |
Definition at line 103 of file vulkan_display.hpp.
Referenced by display_queued_image(), reconfigure(), and window_parameters_changed().
|
private |
Definition at line 97 of file vulkan_display.hpp.
Referenced by destroy(), init(), and reconfigure().
|
private |
Definition at line 121 of file vulkan_display.hpp.
Referenced by ~VulkanDisplay(), and destroy().
|
private |
Definition at line 89 of file vulkan_display.hpp.
Referenced by acquire_transfer_image(), bind_transfer_image(), destroy(), destroy_format_dependent_resources(), display_queued_image(), init(), and reconfigure().
|
private |
Definition at line 90 of file vulkan_display.hpp.
Referenced by acquire_image(), display_queued_image(), is_image_description_supported(), and window_parameters_changed().
|
private |
filled_img_queue - producer is the provider thread, consumer is the render thread
Definition at line 111 of file vulkan_display.hpp.
Referenced by display_queued_image(), and queue_image().
|
private |
Definition at line 92 of file vulkan_display.hpp.
Referenced by bind_transfer_image(), reconfigure(), and record_graphics_commands().
|
private |
Definition at line 100 of file vulkan_display.hpp.
Referenced by destroy(), destroy_format_dependent_resources(), init(), reconfigure(), and record_graphics_commands().
|
private |
Definition at line 101 of file vulkan_display.hpp.
Referenced by display_queued_image(), and init().
|
private |
Definition at line 85 of file vulkan_display.hpp.
Referenced by init(), and reconfigure().
|
private |
Definition at line 95 of file vulkan_display.hpp.
Referenced by bind_transfer_image(), destroy(), display_queued_image(), init(), reconfigure(), record_graphics_commands(), and window_parameters_changed().
|
private |
Definition at line 119 of file vulkan_display.hpp.
Referenced by display_queued_image().
|
private |
Definition at line 106 of file vulkan_display.hpp.
Referenced by acquire_transfer_image(), destroy(), and init().
|
private |
Definition at line 86 of file vulkan_display.hpp.
Referenced by display_queued_image(), init(), and window_parameters_changed().