class Escher

Defined at line 26 of file ../../src/ui/lib/escher/escher.h

Escher is the primary class used by clients of the Escher library.

Escher is currently not thread-safe; it (and all objects obtained from it)

must be used from a single thread.

Public Methods

EscherWeakPtr GetWeakPtr ()

Defined at line 37 of file ../../src/ui/lib/escher/escher.h

void Escher (VulkanDeviceQueuesPtr device)

Escher does not take ownership of the objects in the Vulkan context. It is

up to the application to eventually destroy them, and also to ensure that

they outlive the Escher instance.

Defined at line 68 of file ../../src/ui/lib/escher/escher.cc

void Escher (VulkanDeviceQueuesPtr device, HackFilesystemPtr filesystem, std::shared_ptr<GpuAllocator> gpu_allocator)

If |gpu_allocator| is nullptr, a default allocator will be created.

Defined at line 77 of file ../../src/ui/lib/escher/escher.cc

VulkanDeviceQueues * device ()

Defined at line 108 of file ../../src/ui/lib/escher/escher.h

vk::Device vk_device ()

Defined at line 109 of file ../../src/ui/lib/escher/escher.h

vk::PhysicalDevice vk_physical_device ()

Defined at line 110 of file ../../src/ui/lib/escher/escher.h

const VulkanContext & vulkan_context ()

Defined at line 111 of file ../../src/ui/lib/escher/escher.h

ResourceRecycler * resource_recycler ()

Defined at line 113 of file ../../src/ui/lib/escher/escher.h

GpuAllocator * gpu_allocator ()

Defined at line 114 of file ../../src/ui/lib/escher/escher.h

impl::CommandBufferSequencer * command_buffer_sequencer ()

Defined at line 115 of file ../../src/ui/lib/escher/escher.h

shaderc::Compiler * shaderc_compiler ()

Defined at line 120 of file ../../src/ui/lib/escher/escher.h

ImageFactory * image_cache ()

Defined at line 123 of file ../../src/ui/lib/escher/escher.h

BufferCache * buffer_cache ()

Defined at line 124 of file ../../src/ui/lib/escher/escher.h

SamplerCache * sampler_cache ()

Defined at line 125 of file ../../src/ui/lib/escher/escher.h

void ~Escher ()

Defined at line 126 of file ../../src/ui/lib/escher/escher.cc

impl::PipelineLayoutCache * pipeline_layout_cache ()

Defined at line 127 of file ../../src/ui/lib/escher/escher.h

impl::DescriptorSetAllocatorCache * descriptor_set_allocator_cache ()

Defined at line 128 of file ../../src/ui/lib/escher/escher.h

impl::RenderPassCache * render_pass_cache ()

Defined at line 131 of file ../../src/ui/lib/escher/escher.h

impl::FramebufferAllocator * framebuffer_allocator ()

Defined at line 132 of file ../../src/ui/lib/escher/escher.h

ImageViewAllocator * image_view_allocator ()

Defined at line 133 of file ../../src/ui/lib/escher/escher.h

impl::CommandBufferPool * command_buffer_pool ()

Pool for CommandBuffers submitted on the main queue.

Defined at line 136 of file ../../src/ui/lib/escher/escher.h

impl::CommandBufferPool * transfer_command_buffer_pool ()

Pool for CommandBuffers submitted on the transfer queue (if one exists).

Defined at line 138 of file ../../src/ui/lib/escher/escher.h

DefaultShaderProgramFactory * shader_program_factory ()

Defined at line 144 of file ../../src/ui/lib/escher/escher.h

PipelineBuilder * pipeline_builder ()

Defined at line 146 of file ../../src/ui/lib/escher/escher.h

bool supports_timer_queries ()

Check if GPU performance profiling is supported.

Defined at line 149 of file ../../src/ui/lib/escher/escher.h

float timestamp_period ()

Defined at line 150 of file ../../src/ui/lib/escher/escher.h

bool supports_wireframe ()

Defined at line 151 of file ../../src/ui/lib/escher/escher.h

bool allow_protected_memory ()

Defined at line 152 of file ../../src/ui/lib/escher/escher.h

bool allow_ycbcr ()

Defined at line 153 of file ../../src/ui/lib/escher/escher.h

ImagePtr NewRgbaImage (BatchGpuUploader * gpu_uploader, uint32_t width, uint32_t height, const uint8_t * bytes)

Return new Image containing the provided pixels.

Defined at line 178 of file ../../src/ui/lib/escher/escher.cc

ImagePtr NewCheckerboardImage (BatchGpuUploader * gpu_uploader, uint32_t width, uint32_t height)

Returns RGBA image.

Defined at line 183 of file ../../src/ui/lib/escher/escher.cc

ImagePtr NewGradientImage (BatchGpuUploader * gpu_uploader, uint32_t width, uint32_t height)

Returns RGBA image.

Defined at line 188 of file ../../src/ui/lib/escher/escher.cc

ImagePtr NewNoiseImage (BatchGpuUploader * gpu_uploader, uint32_t width, uint32_t height)

Returns single-channel luminance image.

Defined at line 192 of file ../../src/ui/lib/escher/escher.cc

FramePtr NewFrame (const char * trace_literal, uint64_t frame_number, bool enable_gpu_logging, escher::CommandBuffer::Type requested_type, bool use_protected_memory)

Return a new Frame, which is passed to Renderers to obtain and submit

command buffers, to add timestamps for GPU profiling, etc. If

|enable_gpu_logging| is true, GPU profiling timestamps will be logged via

FX_LOGS().

Defined at line 241 of file ../../src/ui/lib/escher/escher.cc

TexturePtr NewTexture (ImagePtr image, vk::Filter filter, vk::ImageAspectFlags aspect_mask, bool use_unnormalized_coordinates)

Construct a new Texture, which encapsulates a newly-created VkImageView and

VkSampler. |aspect_mask| is used to create the VkImageView, and |filter|

and |use_unnormalized_coordinates| are used to create the VkSampler.

Defined at line 196 of file ../../src/ui/lib/escher/escher.cc

TexturePtr NewTexture (vk::Format format, uint32_t width, uint32_t height, uint32_t sample_count, vk::ImageUsageFlags usage_flags, vk::Filter filter, vk::ImageAspectFlags aspect_flags, bool use_unnormalized_coordinates, vk::MemoryPropertyFlags memory_flags)

Construct a new Texture, which encapsulates a newly-created VkImage,

VkImageView and VkSampler. |aspect_mask| is used to create the

VkImageView, and |filter| and |use_unnormalized_coordinates| are used to

create the VkSampler.

Defined at line 210 of file ../../src/ui/lib/escher/escher.cc

BufferPtr NewBuffer (vk::DeviceSize size, vk::BufferUsageFlags usage_flags, vk::MemoryPropertyFlags memory_property_flags)

Construct a new Buffer, which encapsulates a newly-created VkBuffer.

|usage_flags| defines whether it is to be used as e.g. a uniform and/or a

vertex buffer, and |memory_property_flags| is used to select the heap that

the buffer's backing VkDeviceMemory is allocated from.

Defined at line 203 of file ../../src/ui/lib/escher/escher.cc

TexturePtr NewAttachmentTexture (vk::Format format, uint32_t width, uint32_t height, uint32_t sample_count, vk::Filter filter, vk::ImageUsageFlags additional_usage_flags, bool use_unnormalized_coordinates, vk::MemoryPropertyFlags memory_flags)

Same as the NewTexture() variant that creates the image, except that it

automatically sets up the vk::ImageAspectFlags, and adds the following to

|additional_usage_flags|:

- either eColorAttachment or eDepthAttachment, depending on |format|

- optionally eTransientAttachment, depending on |is_transient|

- optionally eInputAttachment, depending on |is_input|

Defined at line 228 of file ../../src/ui/lib/escher/escher.cc

uint64_t GetNumGpuBytesAllocated ()

Defined at line 266 of file ../../src/ui/lib/escher/escher.cc

bool Cleanup ()

Do periodic housekeeping. This is called by Renderer::EndFrame(), so you

don't need to call it if your application is constantly rendering.

However, if your app enters a "quiet period" then you might want to

arrange to call Cleanup() after the last frame has finished rendering.

Return true if cleanup was complete, and false if more cleanup remains

(in that case, the app should wait a moment before calling Cleanup()

again).

Defined at line 152 of file ../../src/ui/lib/escher/escher.cc

void set_pipeline_builder (std::unique_ptr<PipelineBuilder> pipeline_builder)

Allow clients to set the pipeline builder; if this isn't called then Escher will use a

default builder.

Defined at line 166 of file ../../src/ui/lib/escher/escher.cc

impl::CommandBufferPool * protected_command_buffer_pool ()

Pool for CommandBuffers submitted in a protected context.

Defined at line 170 of file ../../src/ui/lib/escher/escher.cc