Foundation
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Foundation::Rendering::TexturePool Class Reference

Bindless Texture Pool implementation. More...

#include <TexturePool.hpp>

Inheritance diagram for Foundation::Rendering::TexturePool:
Foundation::RHI::RHIObject

Public Member Functions

 TexturePool (RHIDevice *device, Allocator *allocator, uint32_t max_textures=128)
 
TexturePoolHandle Allocate (RHITextureDesc const &desc)
 
TexturePoolHandle Allocate (RHITextureDesc const &desc, RHITextureViewDesc const &viewDesc)
 
TexturePoolHandle Allocate (RHITextureView *view)
 
RHITextureGetTexture (TexturePoolHandle handle) const
 
RHITextureViewGetTextureView (TexturePoolHandle handle) const
 
void Free (TexturePoolHandle handle)
 
bool Contains (TexturePoolHandle handle) const
 
RHIDeviceDescriptorSetGetDescriptorSet () const
 
RHIDeviceDescriptorSetLayoutGetDescriptorSetLayout () const
 

Private Member Functions

void SetMissingTexture (uint32_t index)
 
- Private Member Functions inherited from Foundation::RHI::RHIObject
 RHIObject ()=default
 
 RHIObject (RHIObject const &)=delete
 
RHIObjectoperator= (const RHIObject &)=delete
 
 RHIObject (RHIObject &&)=delete
 
RHIObjectoperator= (RHIObject &&)=delete
 
virtual ~RHIObject ()=default
 

Private Attributes

const uint32_t mMaxTextures
 
RHIDevicemDevice
 
AllocatormAllocator
 
RHIDeviceScopedObjectHandle< RHIDeviceDescriptorSetLayoutmDescriptorSetLayout
 
RHIDeviceScopedObjectHandle< RHIDeviceDescriptorPoolmDescriptorPool
 
RHIDeviceDescriptorPoolScopedHandle< RHIDeviceDescriptorSetmDescriptorSet
 
Pool< TexturePoolHandle, Variant< TexturePair, RHITextureView * > > mTextures
 
TexturePoolHandle mMissingTextureHandle { kInvalidTexturePoolHandle }
 
RHIDeviceIdleGuard mIdleGuard
 
Async::Mutex mMutex
 

Detailed Description

Bindless Texture Pool implementation.

See Examples::TexturePoolApp for reference usage.

Constructor & Destructor Documentation

◆ TexturePool()

TexturePool::TexturePool ( RHIDevice device,
Allocator allocator,
uint32_t  max_textures = 128 
)

Member Function Documentation

◆ Allocate() [1/3]

TexturePoolHandle TexturePool::Allocate ( RHITextureDesc const desc)

◆ Allocate() [2/3]

TexturePoolHandle TexturePool::Allocate ( RHITextureDesc const desc,
RHITextureViewDesc const viewDesc 
)

◆ Allocate() [3/3]

TexturePoolHandle TexturePool::Allocate ( RHITextureView view)

◆ Contains()

bool Foundation::Rendering::TexturePool::Contains ( TexturePoolHandle  handle) const
inline

◆ Free()

void TexturePool::Free ( TexturePoolHandle  handle)

◆ GetDescriptorSet()

RHIDeviceDescriptorSet * Foundation::Rendering::TexturePool::GetDescriptorSet ( ) const
inline

◆ GetDescriptorSetLayout()

RHIDeviceDescriptorSetLayout * Foundation::Rendering::TexturePool::GetDescriptorSetLayout ( ) const
inline

◆ GetTexture()

RHITexture * TexturePool::GetTexture ( TexturePoolHandle  handle) const

◆ GetTextureView()

RHITextureView * TexturePool::GetTextureView ( TexturePoolHandle  handle) const

◆ SetMissingTexture()

void TexturePool::SetMissingTexture ( uint32_t  index)
private

Member Data Documentation

◆ mAllocator

Allocator* Foundation::Rendering::TexturePool::mAllocator
private

◆ mDescriptorPool

RHIDeviceScopedObjectHandle<RHIDeviceDescriptorPool> Foundation::Rendering::TexturePool::mDescriptorPool
private

◆ mDescriptorSet

RHIDeviceDescriptorPoolScopedHandle<RHIDeviceDescriptorSet> Foundation::Rendering::TexturePool::mDescriptorSet
private

◆ mDescriptorSetLayout

RHIDeviceScopedObjectHandle<RHIDeviceDescriptorSetLayout> Foundation::Rendering::TexturePool::mDescriptorSetLayout
private

◆ mDevice

RHIDevice* Foundation::Rendering::TexturePool::mDevice
private

◆ mIdleGuard

RHIDeviceIdleGuard Foundation::Rendering::TexturePool::mIdleGuard
private

◆ mMaxTextures

const uint32_t Foundation::Rendering::TexturePool::mMaxTextures
private

◆ mMissingTextureHandle

TexturePoolHandle Foundation::Rendering::TexturePool::mMissingTextureHandle { kInvalidTexturePoolHandle }
private

◆ mMutex

Async::Mutex Foundation::Rendering::TexturePool::mMutex
private

◆ mTextures

Pool<TexturePoolHandle, Variant<TexturePair, RHITextureView*> > Foundation::Rendering::TexturePool::mTextures
private

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