HikoGUI
A low latency retained GUI
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Data Fields | Static Public Attributes
tt::pipeline_image::device_shared Struct Referencefinal

Public Member Functions

 device_shared (gui_device_vulkan 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 (gui_device_vulkan *vulkanDevice)
 
std::vector< PageallocatePages (size_t num_pages) noexcept
 Allocate pages from the atlas.
 
void freePages (std::vector< Page > const &pages) noexcept
 Deallocate pages back to the atlas.
 
Image makeImage (size_t width, size_t height) noexcept
 Allocate an image in the atlas.
 
void drawInCommandBuffer (vk::CommandBuffer &commandBuffer)
 
tt::pixel_map< sfloat_rgba16getStagingPixelMap ()
 
void prepareAtlasForRendering ()
 

Static Public Member Functions

static point3 getAtlasPositionFromPage (Page page) noexcept
 

Data Fields

gui_device_vulkan const & device
 
vk::ShaderModule vertexShaderModule
 
vk::ShaderModule fragmentShaderModule
 
std::vector< vk::PipelineShaderStageCreateInfo > shaderStages
 
texture_map stagingTexture
 
std::vector< texture_mapatlasTextures
 
std::array< vk::DescriptorImageInfo, atlasMaximumNrImages > atlasDescriptorImageInfos
 
vk::Sampler atlasSampler
 
vk::DescriptorImageInfo atlasSamplerDescriptorImageInfo
 
std::vector< PageatlasFreePages
 

Static Public Attributes

static constexpr int atlasNrHorizontalPages = 16
 
static constexpr int atlasNrVerticalPages = 16
 
static constexpr int atlasImageWidth = atlasNrHorizontalPages * Page::widthIncludingBorder
 
static constexpr int atlasImageHeight = atlasNrVerticalPages * Page::heightIncludingBorder
 
static constexpr int atlasNrPagesPerImage = atlasNrHorizontalPages * atlasNrVerticalPages
 
static constexpr int atlasMaximumNrImages = 16
 
static constexpr int stagingImageWidth = 1024
 
static constexpr int stagingImageHeight = 1024
 

Member Function Documentation

◆ allocatePages()

std::vector< Page > tt::pipeline_image::device_shared::allocatePages ( size_t num_pages)
noexcept

Allocate pages from the atlas.

◆ destroy()

void tt::pipeline_image::device_shared::destroy ( gui_device_vulkan * vulkanDevice)

Deallocate vulkan resources. This is called in the destructor of gui_device_vulkan, therefor we can not use our std::weak_ptr<gui_device_vulkan> device.

◆ freePages()

void tt::pipeline_image::device_shared::freePages ( std::vector< Page > const & pages)
noexcept

Deallocate pages back to the atlas.

◆ getAtlasPositionFromPage()

static point3 tt::pipeline_image::device_shared::getAtlasPositionFromPage ( Page page)
inlinestaticnoexcept

Get the coordinate in the atlas from a page index.

Parameters
pagenumber in the atlas
Returns
x, y pixel coordinate in an atlasTexture and z the atlasTextureIndex.

◆ makeImage()

Image tt::pipeline_image::device_shared::makeImage ( size_t width,
size_t height )
noexcept

Allocate an image in the atlas.

Parameters
widthof the image.
heightof the image.
Returns
An image with allocated pages in the atlas.

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