3#include "Engine/Texture/RuntimeTextureDescriptorLease.h"
6#include <unordered_map>
8#include <vk_mem_alloc.h>
9#include <vulkan/vulkan.h>
72 VkCommandBuffer commandBuffer,
74 RenderProcess &renderProcess
132 std::unordered_map<Components::WidgetComponent *, Target>
targets_;
Move-only ownership of one runtime texture descriptor slot.
The application context is the core class which stores the basic openxr and vulkan objects.
Coordinates engine asset loading pipelines and runtime texture descriptor ownership.
WorldUiRenderer(Core::ApplicationContext *context, uint32_t framesInFlight)
std::unordered_map< Components::WidgetComponent *, Target > targets_
Core::ApplicationContext * context_
std::unordered_map< uint32_t, ImGuiTexture > imguiTextures_
void retireTarget(Target &&target)
void renderTarget(VkCommandBuffer commandBuffer, Target &target, uint32_t frameIndex)
ImGuiContext * imguiContext_
Target & ensureTarget(Components::WidgetComponent &widget)
WorldUiRenderer()=default
Creates an uninitialized world UI renderer.
void prepareWidgetTextures(Components::WidgetComponent &widget)
uint32_t registerWidget(Components::WidgetComponent &widget)
Ensures a widget has a render target texture and returns its descriptor index.
void unregisterWidget(Components::WidgetComponent &widget)
Retires the render target owned by a widget component.
void processRetiredTargets()
void renderWidgets(VkCommandBuffer commandBuffer, uint32_t frameIndex, RenderProcess &renderProcess)
Renders all active widget components for the current frame.
void destroyTarget(Target &target) const
void createTargetImages(Target &target) const
VkDescriptorPool descriptorPool_
WorldUiRenderer & operator=(const WorldUiRenderer &)=delete
World UI renderers own Vulkan resources and cannot be copy-assigned.
void transitionTargetsToShaderRead(VkCommandBuffer commandBuffer, uint32_t frameIndex)
void transitionTargetsToColorAttachment(VkCommandBuffer commandBuffer, uint32_t frameIndex)
void cleanup()
Destroys active and retired widget render targets and renderer resources.
~WorldUiRenderer()
Releases renderer-owned Vulkan and ImGui resources.
WorldUiRenderer(const WorldUiRenderer &)=delete
World UI renderers own Vulkan resources and cannot be copied.
std::vector< RetiredTarget > retiredTargets_
VkDescriptorSet descriptor
VkImageLayout currentLayout
std::vector< TargetFrame > frames
Components::WidgetComponent * widget
Assets::RuntimeTextureDescriptorLease descriptor
uint64_t loggedDescriptorWriteFrames