Foundation
Loading...
Searching...
No Matches
Classes | Public Member Functions | Public Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
Foundation::RenderCore::BindlessPool Class Reference

#include <Bindless.hpp>

Classes

struct  Binding
 
struct  BindlessPoolDesc
 
struct  Stats
 

Public Member Functions

 BindlessPool (RHIDevice *device, Allocator *allocator, BindlessPoolDesc const &desc)
 
uint32_t Allocate (RHITextureView *view)
 
uint32_t Allocate (RHIDeviceScopedHandle< RHITexture > &&texture, RHITextureScopedHandle< RHITextureView > &&view)
 Takes ownership of the texture, and creates a binding for it.
 
uint32_t Update (uint32_t id, RHIDeviceScopedHandle< RHITexture > &&texture, RHITextureScopedHandle< RHITextureView > &&view)
 Replaces an owned texture binding in-place while keeping the same bindless id.
 
void Free (uint32_t id)
 Free a binding, and - with it - the owned resource (if any).
 
RHITextureGetResource (uint32_t id)
 
RHITextureViewGetView (uint32_t id)
 
Stats GetStats () const
 
RHIDeviceDescriptorSetLayoutGetDescriptorSetLayout () const
 
RHIDeviceDescriptorSetGetDescriptorSet () const
 

Public Attributes

const BindlessPoolDesc mDesc
 

Private Types

using Resource = Variant< RHITexture *, RHIDeviceScopedHandle< RHITexture > >
 
using View = Variant< RHITextureView *, RHITextureScopedHandle< RHITextureView > >
 

Private Member Functions

uint32_t UpdateDescriptor (uint32_t id, RHITextureView *view)
 
void AddStats (Binding const &binding)
 
void RemoveStats (Binding const &binding)
 

Private Attributes

RHIDevice *const mDevice
 
Allocator *const mAllocator
 
AtomicPool< BindingmBindings
 
RHIDeviceScopedHandle< RHIDeviceDescriptorSetLayoutmDescLayout
 
RHIDeviceScopedHandle< RHIDeviceDescriptorPoolmDescPool
 
RHIDeviceDescriptorPoolScopedHandle< RHIDeviceDescriptorSetmDescSet
 
Mutex mDescMutex
 
uint32_t mActiveBindings {0}
 
uint32_t mOwnedTextureBindings {0}
 
size_t mReferencedTextureBytes {0}
 
size_t mOwnedTextureBytes {0}
 
RHIDeviceIdleGuard mIdleGuard
 

Member Typedef Documentation

◆ Resource

◆ View

Constructor & Destructor Documentation

◆ BindlessPool()

Foundation::RenderCore::BindlessPool::BindlessPool ( RHIDevice device,
Allocator allocator,
BindlessPoolDesc const desc 
)

Member Function Documentation

◆ AddStats()

void Foundation::RenderCore::BindlessPool::AddStats ( Binding const binding)
private

◆ Allocate() [1/2]

uint32_t Foundation::RenderCore::BindlessPool::Allocate ( RHIDeviceScopedHandle< RHITexture > &&  texture,
RHITextureScopedHandle< RHITextureView > &&  view 
)

Takes ownership of the texture, and creates a binding for it.

◆ Allocate() [2/2]

uint32_t Foundation::RenderCore::BindlessPool::Allocate ( RHITextureView view)

@breif Create a binding for the given texture view, with ownership remaining with the caller.

◆ Free()

void Foundation::RenderCore::BindlessPool::Free ( uint32_t  id)

Free a binding, and - with it - the owned resource (if any).

◆ GetDescriptorSet()

RHIDeviceDescriptorSet * Foundation::RenderCore::BindlessPool::GetDescriptorSet ( ) const
inline

◆ GetDescriptorSetLayout()

RHIDeviceDescriptorSetLayout * Foundation::RenderCore::BindlessPool::GetDescriptorSetLayout ( ) const
inline

◆ GetResource()

RHITexture * Foundation::RenderCore::BindlessPool::GetResource ( uint32_t  id)

◆ GetStats()

BindlessPool::Stats Foundation::RenderCore::BindlessPool::GetStats ( ) const

◆ GetView()

RHITextureView * Foundation::RenderCore::BindlessPool::GetView ( uint32_t  id)

◆ RemoveStats()

void Foundation::RenderCore::BindlessPool::RemoveStats ( Binding const binding)
private

◆ Update()

uint32_t Foundation::RenderCore::BindlessPool::Update ( uint32_t  id,
RHIDeviceScopedHandle< RHITexture > &&  texture,
RHITextureScopedHandle< RHITextureView > &&  view 
)

Replaces an owned texture binding in-place while keeping the same bindless id.

◆ UpdateDescriptor()

uint32_t Foundation::RenderCore::BindlessPool::UpdateDescriptor ( uint32_t  id,
RHITextureView view 
)
private

Member Data Documentation

◆ mActiveBindings

uint32_t Foundation::RenderCore::BindlessPool::mActiveBindings {0}
private

◆ mAllocator

Allocator* const Foundation::RenderCore::BindlessPool::mAllocator
private

◆ mBindings

AtomicPool<Binding> Foundation::RenderCore::BindlessPool::mBindings
private

◆ mDesc

const BindlessPoolDesc Foundation::RenderCore::BindlessPool::mDesc

◆ mDescLayout

RHIDeviceScopedHandle<RHIDeviceDescriptorSetLayout> Foundation::RenderCore::BindlessPool::mDescLayout
private

◆ mDescMutex

Mutex Foundation::RenderCore::BindlessPool::mDescMutex
private

◆ mDescPool

RHIDeviceScopedHandle<RHIDeviceDescriptorPool> Foundation::RenderCore::BindlessPool::mDescPool
private

◆ mDescSet

RHIDeviceDescriptorPoolScopedHandle<RHIDeviceDescriptorSet> Foundation::RenderCore::BindlessPool::mDescSet
private

◆ mDevice

RHIDevice* const Foundation::RenderCore::BindlessPool::mDevice
private

◆ mIdleGuard

RHIDeviceIdleGuard Foundation::RenderCore::BindlessPool::mIdleGuard
private

◆ mOwnedTextureBindings

uint32_t Foundation::RenderCore::BindlessPool::mOwnedTextureBindings {0}
private

◆ mOwnedTextureBytes

size_t Foundation::RenderCore::BindlessPool::mOwnedTextureBytes {0}
private

◆ mReferencedTextureBytes

size_t Foundation::RenderCore::BindlessPool::mReferencedTextureBytes {0}
private

The documentation for this class was generated from the following files: