26 "Frame-scope deletion ring needs one more slot than FRAME_OVERLAP");
154 VkPipelineStageFlags2 srcStage, VkAccessFlags2 srcAccess,
155 VkPipelineStageFlags2 dstStage, VkAccessFlags2 dstAccess);
A graphics backend: the device, the window contexts that render the GUI's windows,...
Definition gui_graphics_context.h:60
A window's rendering state: made by GraphicsContext::CreateWindowContext for each OS window,...
Definition gui_window_backend.h:72
The Vulkan device the GUI renders with: its own, or a host's (SetExternalDevice).
Definition vk_device_context.h:118
The default graphics backend, on Vulkan 1.3.
Definition vk_graphics_context.h:33
Definition vk_window_context.h:82
void RecordFrame(tachyon::GraphicsContext *graphicsContext, tachyon::IntRect rect, bool resizing)
bool ReadPixels(std::span< uint8_t > bgra) override
The last rendered frame, BGRA8 with tightly packed rows; bgra holds width x height x 4 bytes of the w...
bool renderToImage
WindowFlags::RenderToImage: no surface.
Definition vk_window_context.h:118
VkExtent2D targetExtent
Definition vk_window_context.h:120
static VulkanWindowContext * Create(tachyon::ID id, void *nativeHandle, tachyon::OSWindowHandle osHandle, tachyon::int2 size, tachyon::WindowFlags windowFlags, VulkanDeviceContext *deviceContext, tachyon::OnGuiFunc onGUI)
void DestroyDrawDepthImages(VulkanImage &drawImage, VulkanImage &depthImage)
bool presentPending
Recorded and submitted, waiting for PresentWindowFrame.
Definition vk_window_context.h:112
void CreateDrawDepthImages(VulkanImage &drawImage, VulkanImage &depthImage, VkFormat colorFormat)
Creates a draw and depth image pair sized to windowExtent; each FRAME_OVERLAP slot has its own.
std::chrono::steady_clock::time_point lastPresentEnd
When the last vkQueuePresentKHR returned.
Definition vk_window_context.h:107
VulkanDeviceContext * deviceContext
Definition vk_window_context.h:85
SwapchainState swapchain
Definition vk_window_context.h:92
bool havePresentEnd
Definition vk_window_context.h:108
double lastBuildSeconds
Definition vk_window_context.h:109
bool IsTransparent() const override
Whether the window has WindowFlags::Transparent.
Definition vk_window_context.h:128
void PerformReadback(const VulkanImage &drawImage)
double lastGpuFrameSeconds
Definition vk_window_context.h:148
tachyon::WindowFlags windowFlags
Definition vk_window_context.h:90
bool needsReadback
Transparent window: each frame is read back for the Windows layered window.
Definition vk_window_context.h:117
FrameData * readbackPending
Definition vk_window_context.h:113
VkExtent2D windowExtent
Definition vk_window_context.h:97
bool resize_requested
Definition vk_window_context.h:100
WindowVulkanState state
Definition vk_window_context.h:93
void RenderWindowFrame(tachyon::GraphicsContext *graphicsContext, tachyon::IntRect rect, bool resizing) override
A frame is recorded (drawn and submitted), then presented.
float timestampPeriodNs
nanoseconds per timestamp tick; 0: no timestamps
Definition vk_window_context.h:149
VkCommandBuffer BeginWindowFrame(FrameData ¤tFrame)
void UpdateLayeredWindowFromCache(int screenX, int screenY)
VkImage targetImage
host image each frame is copied into
Definition vk_window_context.h:119
bool lastBuildValid
Definition vk_window_context.h:110
tachyon::vulkan::AllocatedBuffer readbackBuffer
Definition vk_window_context.h:122
tachyon::ID GetID() const override
The GUI window's ID; the backend passes it with the window's input.
Definition vk_window_context.h:162
VkSurfaceKHR surface
Definition vk_window_context.h:96
std::vector< uint8_t > cachedBitmap
Definition vk_window_context.h:123
void SetImageTarget(VkImage image, VkExtent2D extent)
The host image each frame is copied into (render-to-image windows); VK_NULL_HANDLE stops.
tachyon::ID id
Definition vk_window_context.h:84
void UpdateTransparentWindow(tachyon::int2 screenPos) override
A transparent window the OS composites from a CPU copy (a layered window on Windows): shows its last ...
void PresentWindowFrame() override
May wait for vsync; nothing to do for a render-to-image window.
void FlushWindowContext()
VkExtent2D drawExtent
Definition vk_window_context.h:98
double LastGpuFrameSeconds() const
GPU time of the drawing of this window's most recent finished frame, in seconds; 0 until one finished...
Definition vk_window_context.h:147
bool targetWritten
targetImage holds a previous frame
Definition vk_window_context.h:121
tachyon::OnGuiFunc onGui
Definition vk_window_context.h:88
void ResizeSwapchain(tachyon::int2 size)
int frameNumber
Definition vk_window_context.h:103
bool freeze_rendering
Definition vk_window_context.h:101
FrameData & GetLastFrame()
tachyon::int2 recordedPosition
Definition vk_window_context.h:114
void EndWindowFrame(FrameData ¤tFrame)
FrameData & GetCurrentFrame()
void * nativeHandle
Definition vk_window_context.h:87
tachyon::OSWindowHandle osHandle
Definition vk_window_context.h:86
void RecordWindowFrame(tachyon::GraphicsContext *graphicsContext, tachyon::IntRect rect) override
Records and submits a frame without presenting it; PresentWindowFrame presents.
tachyon::OSWindowHandle GetWindowHandle() const override
The window it was created for.
Definition vk_window_context.h:171
tachyon::int2 mouse_pos
Definition vk_window_context.h:102
void TransitionTarget(VkCommandBuffer cmd, VkImageLayout from, VkImageLayout to, VkPipelineStageFlags2 srcStage, VkAccessFlags2 srcAccess, VkPipelineStageFlags2 dstStage, VkAccessFlags2 dstAccess)
constexpr unsigned int FRAME_OVERLAP
Definition vk_window_context.h:24
constexpr unsigned int FRAME_DELETION_SLOT_COUNT
Frame deletion queue slots: FRAME_OVERLAP + 1, so the slot pushed to is never the one flushed in the ...
Definition vk_device_context.h:113
std::function< void()> OnGuiFunc
Definition gui_base_types.h:14
WindowFlags
How an OS window is made and behaves (IWindowBackend::CreateWindow); flags combine with |.
Definition gui_window_flags.h:12
void * OSWindowHandle
An OS window, opaque; what it points to is up to the window backend.
Definition gui_window_backend.h:37
@ Transparent
Definition gui_window_flags.h:25
@ None
Definition gui_window_flags.h:13
Definition vk_defaults.h:4
Definition gui_logging.h:24
A 64-bit element ID whose bit layout depends on its IDMode.
Definition gui_id.h:23
static constexpr ID Invalid()
The "no element" ID (all bits zero); also the default for optional ID parameters.
Definition gui_id.h:66
Definition gui_base_types.h:407
Integer 2D vector.
Definition gui_base_types.h:19
Definition vk_meshes.h:14
Library internal: destroy functions that run later, newest first.
Definition vk_device_context.h:47
Definition vk_descriptors.h:54
Definition vk_window_context.h:29
DeletionQueue deletionQueue
Definition vk_window_context.h:35
VkCommandPool commandPool
Definition vk_window_context.h:37
VulkanImage depthImage
Definition vk_window_context.h:51
size_t primitiveUploadCapacity
Definition vk_window_context.h:44
VkFence renderFence
Definition vk_window_context.h:31
Buffer primitiveUploadBuffer
Fence-protected, persistently mapped upload arena for GUI primitive streams, reused each time this fr...
Definition vk_window_context.h:42
VkSemaphore swapchainSemaphore
Definition vk_window_context.h:30
DeletionQueue flushQueue
Definition vk_window_context.h:34
VkCommandBuffer mainCommandBuffer
Definition vk_window_context.h:38
VulkanImage drawImage
Per-slot draw and depth images, so in-flight frames don't share them (frame N's blit reads drawImage ...
Definition vk_window_context.h:50
VkQueryPool timestamps
GPU timestamps at the start and the end of the frame's drawing; none when the queue can't time.
Definition vk_window_context.h:55
VkDeviceAddress primitiveUploadAddress
Definition vk_window_context.h:43
DescriptorAllocatorGrowable frameDescriptors
Definition vk_window_context.h:33
bool timestampsWritten
by the last frame in this slot
Definition vk_window_context.h:56
size_t primitiveUploadOffset
Definition vk_window_context.h:45
Definition vk_window_context.h:60
uint32_t swapchainImageIndex
Definition vk_window_context.h:70
::std::vector< VkImageView > swapchainImageViews
Definition vk_window_context.h:66
::std::vector< VkSemaphore > presentSemaphores
Definition vk_window_context.h:69
VkPresentModeKHR presentMode
Definition vk_window_context.h:71
VkExtent2D swapchainExtent
Definition vk_window_context.h:64
VkFormat swapchainImageFormat
Definition vk_window_context.h:63
VkSwapchainKHR swapchain
Definition vk_window_context.h:62
::std::vector< VkImage > swapchainImages
Definition vk_window_context.h:65
Definition vk_window_context.h:75
FrameData frames[FRAME_OVERLAP]
Definition vk_window_context.h:77
VkCommandBuffer commandBuffer
Definition vk_window_context.h:78