SleakEngine 0.1.0
C++23 multi-backend game engine
Loading...
Searching...
No Matches
Sleak::RenderEngine::DirectX12UploadRing Class Reference

#include <DirectX12UploadRing.hpp>

Classes

struct  Allocation
 CPU write pointer and matching GPU address of one allocation. More...

Public Member Functions

 DirectX12UploadRing ()=default
 DirectX12UploadRing (const DirectX12UploadRing &)=delete
 ~DirectX12UploadRing ()
bool Allocate (uint64_t size, Allocation &out)
 Returns 256-byte aligned memory valid until the frame is reused.
void BeginFrame (uint32_t frameIndex)
 Rewinds the frame's pages. The GPU must be done with that frame.
void Initialize (ID3D12Device *device, uint32_t frameCount, uint64_t pageSize)
 Stores the device and sizes the ring. Pages are created on demand.
DirectX12UploadRing & operator= (const DirectX12UploadRing &)=delete
void Release ()
 Unmaps and frees every page. The GPU must be idle.

Detailed Description

Per-frame linear allocator over upload heap pages for transient GPU data. Each frame in flight owns its own pages, which are rewound by BeginFrame.

Definition at line 15 of file DirectX12UploadRing.hpp.

Constructor & Destructor Documentation

◆ DirectX12UploadRing() [1/2]

Sleak::RenderEngine::DirectX12UploadRing::DirectX12UploadRing ( )
default

◆ ~DirectX12UploadRing()

Sleak::RenderEngine::DirectX12UploadRing::~DirectX12UploadRing ( )
inline

Definition at line 24 of file DirectX12UploadRing.hpp.

◆ DirectX12UploadRing() [2/2]

Sleak::RenderEngine::DirectX12UploadRing::DirectX12UploadRing ( const DirectX12UploadRing & )
delete

Member Function Documentation

◆ Allocate()

bool Sleak::RenderEngine::DirectX12UploadRing::Allocate ( uint64_t size,
Allocation & out )

Returns 256-byte aligned memory valid until the frame is reused.

Definition at line 32 of file DirectX12UploadRing.cpp.

◆ BeginFrame()

void Sleak::RenderEngine::DirectX12UploadRing::BeginFrame ( uint32_t frameIndex)

Rewinds the frame's pages. The GPU must be done with that frame.

Definition at line 25 of file DirectX12UploadRing.cpp.

◆ Initialize()

void Sleak::RenderEngine::DirectX12UploadRing::Initialize ( ID3D12Device * device,
uint32_t frameCount,
uint64_t pageSize )

Stores the device and sizes the ring. Pages are created on demand.

Definition at line 16 of file DirectX12UploadRing.cpp.

◆ operator=()

DirectX12UploadRing & Sleak::RenderEngine::DirectX12UploadRing::operator= ( const DirectX12UploadRing & )
delete

◆ Release()

void Sleak::RenderEngine::DirectX12UploadRing::Release ( )

Unmaps and frees every page. The GPU must be idle.

Definition at line 63 of file DirectX12UploadRing.cpp.