Toast Engine
Loading...
Searching...
No Matches
RenderInterface_VK Class Reference
Inheritance diagram for RenderInterface_VK:
Collaboration diagram for RenderInterface_VK:

Classes

struct  effects_push_t
 Mirrors the EffectsPush block in ui_effects.slang. More...

Public Member Functions

bool Initialize (VkInstance instance, VkPhysicalDevice physical_device, VkDevice device, uint32_t queue_family_index, VkQueue queue, VkFormat color_format, VkFormat depth_stencil_format, std::mutex *submit_mutex, VkPipelineCache pipeline_cache=VK_NULL_HANDLE)
void Shutdown ()
std::shared_ptr< const void > OnFrameBegin (uint32_t frame_index)
VkCommandBuffer BeginRecording (VkExtent2D extent)
 Begins recording a secondary command buffer for one context render target.
VkCommandBuffer EndRecording ()
 Ends recording and returns the secondary command buffer for execution on the render thread.
VkImageView GetLastOutputView () const
 View of the image the last recording rendered into.
void SetViewport (int width, int height)
Rml::CompiledGeometryHandle CompileGeometry (Rml::Span< const Rml::Vertex > vertices, Rml::Span< const int > indices) override
void RenderGeometry (Rml::CompiledGeometryHandle handle, Rml::Vector2f translation, Rml::TextureHandle texture) override
void ReleaseGeometry (Rml::CompiledGeometryHandle geometry) override
Rml::TextureHandle LoadTexture (Rml::Vector2i &texture_dimensions, const Rml::String &source) override
Rml::TextureHandle GenerateTexture (Rml::Span< const Rml::byte > source_data, Rml::Vector2i source_dimensions) override
void ReleaseTexture (Rml::TextureHandle texture_handle) override
void EnableScissorRegion (bool enable) override
void SetScissorRegion (Rml::Rectanglei region) override
void SetTransform (const Rml::Matrix4f *transform) override
void EnableClipMask (bool enable) override
void RenderToClipMask (Rml::ClipMaskOperation operation, Rml::CompiledGeometryHandle geometry, Rml::Vector2f translation) override
Rml::LayerHandle PushLayer () override
void CompositeLayers (Rml::LayerHandle source, Rml::LayerHandle destination, Rml::BlendMode blend_mode, Rml::Span< const Rml::CompiledFilterHandle > filters) override
void PopLayer () override
Rml::TextureHandle SaveLayerAsTexture () override
Rml::CompiledFilterHandle SaveLayerAsMaskImage () override
Rml::CompiledFilterHandle CompileFilter (const Rml::String &name, const Rml::Dictionary &parameters) override
void ReleaseFilter (Rml::CompiledFilterHandle filter) override
Rml::CompiledShaderHandle CompileShader (const Rml::String &name, const Rml::Dictionary &parameters) override
void RenderShader (Rml::CompiledShaderHandle shader, Rml::CompiledGeometryHandle geometry, Rml::Vector2f translation, Rml::TextureHandle texture) override
void ReleaseShader (Rml::CompiledShaderHandle shader) override

Static Public Attributes

static constexpr uint32_t kFramesInFlight = 3
static constexpr VkDeviceSize kVideoMemoryForAllocation = 64 * 1024 * 1024

Member Function Documentation

◆ Initialize()

bool RenderInterface_VK::Initialize ( VkInstance instance,
VkPhysicalDevice physical_device,
VkDevice device,
uint32_t queue_family_index,
VkQueue queue,
VkFormat color_format,
VkFormat depth_stencil_format,
std::mutex * submit_mutex,
VkPipelineCache pipeline_cache = VK_NULL_HANDLE )

Borrows the engine's Vulkan handles; the backend owns only its own resources.

Parameters
submit_mutexguards graphics queue submission shared with the render thread
pipeline_cacheshared with the engine so UI pipelines are cached across runs

◆ OnFrameBegin()

std::shared_ptr< const void > RenderInterface_VK::OnFrameBegin ( uint32_t frame_index)

Called once per built frame on the main thread; resets this frame's command pool and runs deferred destruction for resources retired kFramesInFlight frames ago


The documentation for this class was generated from the following files:
  • engine/src/toast/ui/render/rmlui_renderer_vk.h
  • engine/src/toast/ui/render/rmlui_renderer_vk.cpp
  • engine/src/toast/ui/render/rmlui_renderer_vk_effects.cpp