8#include <vulkan/vulkan.h>
32 std::array<tachyon::RHI::GpuPipeline, tachyon::kPrimitiveKindCount>
pipelines{};
41 : dc(deviceContext) {}
58 VkCommandBuffer commandBuffer,
59 VkDescriptorSet imageDescriptorSet,
61 : dc(deviceContext), cmd(commandBuffer)
62 , imageSet(imageDescriptorSet), frame(frameData) {}
68 std::span<tachyon::DeviceAddress> addresses)
override;
70 std::span<tachyon::DeviceAddress> addresses)
override;
77 VkDescriptorSet imageSet;
One frame's recording surface for one window.
Definition gui_rhi.h:61
Device-lifetime operations.
Definition gui_rhi.h:47
The Vulkan device the GUI renders with: its own, or a host's (SetExternalDevice).
Definition vk_device_context.h:118
tachyon::RHI::ResidentState ResidentBufferState(tachyon::RHI::ResidentBufferId id) const override
void UploadTransientBuffers(std::span< const tachyon::RHI::UploadRequest > requests, std::span< tachyon::DeviceAddress > addresses) override
tachyon::RHI::ResidentBufferId UploadResidentBuffers(std::span< const tachyon::RHI::UploadRequest > requests, std::span< tachyon::DeviceAddress > addresses) override
void ReleaseResidentBuffer(tachyon::RHI::ResidentBufferId id) override
Frees the buffer once no frame in flight reads it; an unknown id does nothing.
VulkanRenderCommandList(VulkanDeviceContext &deviceContext, VkCommandBuffer commandBuffer, VkDescriptorSet imageDescriptorSet, FrameData &frameData)
Definition vk_rhi.h:57
void DrawPrimitives(const tachyon::RHI::GpuPipeline &pipeline, const tachyon::GPUDrawPushConstants &pushConstants, uint32_t primitiveCount, uint32_t firstPrimitive, tachyon::PrimitiveShape shape) override
Binds the pipeline and the GUI image set, pushes the constants and draws primitiveCount primitives st...
VulkanRenderDevice(VulkanDeviceContext &deviceContext)
Definition vk_rhi.h:40
tachyon::RHI::GpuPipeline CreatePrimitivePipeline(const tachyon::PrimitiveSpec &spec) override
Builds the pipeline for one primitive kind: the spec's shader pair + the fixed GUI pipeline state (tr...
void DestroySharedLayout()
VkPipelineLayout sharedGuiLayout
All GUI pipelines share one layout (identical push range + image set).
Definition vk_rhi.h:47
uint64_t ResidentBufferId
GPU storage kept across frames (UploadResidentBuffers); 0 is none.
Definition gui_rhi.h:35
ResidentState
Where a resident buffer is.
Definition gui_rhi.h:39
PrimitiveShape
The vertices a primitive's vertex shader is run for; gl_VertexIndex divided by their count is the pri...
Definition gui_render_primitives.h:216
Definition vk_defaults.h:4
Definition gui_render_primitives.h:248
Definition gui_render_primitives.h:222
Definition vk_meshes.h:14
Library internal: destroy functions that run later, newest first.
Definition vk_device_context.h:47
Definition vk_window_context.h:29
The Vulkan-side GUI pipeline set, built once at device init from kPrimitiveSpecs.
Definition vk_rhi.h:24
std::array< tachyon::RHI::GpuPipeline, tachyon::kPrimitiveKindCount > pipelines
Definition vk_rhi.h:32
bool Create(VulkanDeviceContext &deviceContext)
uint32_t quadIndexCapacity
primitives quadIndexBuffer holds indices for
Definition vk_rhi.h:34
Buffer quadIndexBuffer
Definition vk_rhi.h:33
VkBuffer QuadIndices(VulkanDeviceContext &deviceContext, uint32_t primitiveCount)
The index buffer of quad-shaped primitives (0,1,3, 0,3,2 for each four vertices) for at least primiti...