TachyonUI 1.1.0
High-performance UI for building tools.
Loading...
Searching...
No Matches
d3d12_rhi.h
Go to the documentation of this file.
1#pragma once
2
3// Inside the Direct3D 12 backend: the GUI's pipelines, and a window frame's recording surface
4// for the PrimitiveRenderer (RHI::RenderCommandList).
5
8
9namespace tachyon::d3d12
10{
14
18 {
20 UINT64 offset = 0;
21 };
22
24 {
25 public:
26 D3D12CommandList(D3D12GraphicsContext::Impl& device, ID3D12GraphicsCommandList* list, FrameArena& arena)
27 : m_device(device), m_list(list), m_arena(arena) {}
28
30 D3D12_GPU_VIRTUAL_ADDRESS Push(const void* data, size_t bytes, size_t alignment);
32 void SetSamplerTable(D3D12_GPU_VIRTUAL_ADDRESS table) { m_samplerTable = table; }
33
34 void DrawPrimitives(const RHI::GpuPipeline& pipeline, const GPUDrawPushConstants& pushConstants,
35 uint32_t primitiveCount, uint32_t firstPrimitive, PrimitiveShape shape,
36 std::span<const std::byte> primitives) override;
37 void UploadTransientBuffers(std::span<const RHI::UploadRequest> requests, std::span<DeviceAddress> addresses) override;
38 RHI::ResidentBufferId UploadResidentBuffers(std::span<const RHI::UploadRequest> requests,
39 std::span<DeviceAddress> addresses) override;
42
43 private:
45 ID3D12GraphicsCommandList* m_list;
46 FrameArena& m_arena;
47 D3D12_GPU_VIRTUAL_ADDRESS m_samplerTable = 0;
48 };
49}
One frame's recording surface for one window.
Definition gui_rhi.h:62
D3D12_GPU_VIRTUAL_ADDRESS Push(const void *data, size_t bytes, size_t alignment)
Writes bytes into the arena, alignment apart; the GPU address of the copy, or 0.
void SetSamplerTable(D3D12_GPU_VIRTUAL_ADDRESS table)
The per-image sampler table (t7) every draw of the frame binds.
Definition d3d12_rhi.h:32
RHI::ResidentState ResidentBufferState(RHI::ResidentBufferId id) const override
RHI::ResidentBufferId UploadResidentBuffers(std::span< const RHI::UploadRequest > requests, std::span< DeviceAddress > addresses) override
void ReleaseResidentBuffer(RHI::ResidentBufferId id) override
Frees the buffer once no frame in flight reads it; an unknown id does nothing.
D3D12CommandList(D3D12GraphicsContext::Impl &device, ID3D12GraphicsCommandList *list, FrameArena &arena)
Definition d3d12_rhi.h:26
void UploadTransientBuffers(std::span< const RHI::UploadRequest > requests, std::span< DeviceAddress > addresses) override
void DrawPrimitives(const RHI::GpuPipeline &pipeline, const GPUDrawPushConstants &pushConstants, uint32_t primitiveCount, uint32_t firstPrimitive, PrimitiveShape shape, std::span< const std::byte > primitives) override
Binds the pipeline and the GUI image set, pushes the constants and draws primitiveCount primitives st...
uint64_t ResidentBufferId
GPU storage kept across frames (UploadResidentBuffers); 0 is none.
Definition gui_rhi.h:36
ResidentState
Where a resident buffer is.
Definition gui_rhi.h:40
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:225
Definition d3d12_common.h:22
bool CreatePipelines(D3D12GraphicsContext::Impl &device)
The root signature, as the shaders' TACHYON_D3D12 path declares it (all_common.slang,...
Definition gui_render_primitives.h:257
Definition gui_rhi.h:22
A buffer in one of D3D12MA's heaps. An upload-heap buffer stays mapped (mapped).
Definition d3d12_device.h:36
Definition d3d12_device.h:107
A frame slot's transient data: one upload buffer, written from the start each time the slot comes rou...
Definition d3d12_rhi.h:18
UINT64 offset
Definition d3d12_rhi.h:20
Buffer buffer
Definition d3d12_rhi.h:19