HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Static Public Attributes
hi::v1::gfx_pipeline_image::device_shared Struct Reference

Public Member Functions

 device_shared (gfx_device const &device)
 
 device_shared (device_shared const &)=delete
 
device_sharedoperator= (device_shared const &)=delete
 
 device_shared (device_shared &&)=delete
 
device_sharedoperator= (device_shared &&)=delete
 
void destroy (gfx_device const *vulkanDevice)
 
std::vector< std::size_tallocate_pages (std::size_t num_pages) noexcept
 Allocate pages from the atlas.
 
void free_pages (std::vector< std::size_t > const &pages) noexcept
 Deallocate pages back to the atlas.
 
void draw_in_command_buffer (vk::CommandBuffer const &commandBuffer)
 
hi::pixmap_span< sfloat_rgba16 > get_staging_pixmap ()
 Get the full staging pixel map excluding border.
 
void prepare_atlas_for_rendering ()
 Prepare the atlas so that it can be used as a texture map by the shaders.
 
void place_vertices (vector_span< vertex > &vertices, aarectangle const &clipping_rectangle, quad const &box, paged_image const &image) noexcept
 Place vertices for a single image.
 

Data Fields

gfx_device const & device
 
vk::ShaderModule vertex_shader_module
 
vk::ShaderModule fragment_shader_module
 
std::vector< vk::PipelineShaderStageCreateInfo > shader_stages
 
texture_map staging_texture
 
std::vector< texture_mapatlas_textures
 
std::array< vk::DescriptorImageInfo, atlas_maximum_num_images > atlas_descriptor_image_infos
 
vk::Sampler atlas_sampler
 
vk::DescriptorImageInfo atlas_sampler_descriptor_image_info
 

Static Public Attributes

static constexpr std::size_t atlas_num_pages_per_axis = 8
 
static constexpr std::size_t atlas_num_pages_per_image = atlas_num_pages_per_axis * atlas_num_pages_per_axis
 
static constexpr std::size_t atlas_image_axis_size = atlas_num_pages_per_axis * (paged_image::page_size + 2)
 
static constexpr std::size_t atlas_maximum_num_images = 64
 
static constexpr std::size_t staging_image_width = 1024
 
static constexpr std::size_t staging_image_height = 1024
 

Member Function Documentation

◆ allocate_pages()

std::vector< std::size_t > hi::v1::gfx_pipeline_image::device_shared::allocate_pages ( std::size_t num_pages)
inlinenoexcept

Allocate pages from the atlas.

◆ destroy()

void hi::v1::gfx_pipeline_image::device_shared::destroy ( gfx_device const * vulkanDevice)
inline

Deallocate vulkan resources. This is called in the destructor of gfx_device, therefor we can not use our gfx_device from this point on.

◆ free_pages()

void hi::v1::gfx_pipeline_image::device_shared::free_pages ( std::vector< std::size_t > const & pages)
inlinenoexcept

Deallocate pages back to the atlas.

◆ get_staging_pixmap()

hi::pixmap_span< sfloat_rgba16 > hi::v1::gfx_pipeline_image::device_shared::get_staging_pixmap ( )
inline

Get the full staging pixel map excluding border.

The returned pixel-map is offset by the page::border.

◆ place_vertices()

void hi::v1::gfx_pipeline_image::device_shared::place_vertices ( vector_span< vertex > & vertices,
aarectangle const & clipping_rectangle,
quad const & box,
paged_image const & image )
inlinenoexcept

Place vertices for a single image.

Precondition
The image is uploaded.
Parameters
verticesThe list of vertices to add to.
clipping_rectangleThe rectangle to clip the glyph.
boxThe rectangle of the image in window coordinates.
imageThe image to render.

◆ prepare_atlas_for_rendering()

void hi::v1::gfx_pipeline_image::device_shared::prepare_atlas_for_rendering ( )
inline

Prepare the atlas so that it can be used as a texture map by the shaders.


The documentation for this struct was generated from the following files: