Foundation
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Foundation::RHI::RHIBuffer Class Referenceabstract

#include <Resource.hpp>

Inheritance diagram for Foundation::RHI::RHIBuffer:
Foundation::RHI::RHIObject Foundation::RHI::VulkanBuffer

Public Member Functions

 RHIBuffer (RHIDevice const &device, RHIBufferDesc const &desc)
 
virtual voidMap ()=0
 Maps the entire buffer to the host memory. Alignment is implementation-defined. Implementations MUST guarantee consecutive calls to Map() return the same pointer, therefore it's not possible to map the same resource multiple times. For caching behaviours, RHIBufferDesc.
 
virtual void Flush (size_t offset=0, size_t size=kFullSize)=0
 Flushes the mapped region to the device. Depending on the implementation, this may be a no-op.

 
virtual void Unmap ()=0
 Releases or unmaps a previously mapped resource. Implementations MUST guarantee that Unmap() is called at destruction time if the resource is still mapped.

 
template<typename T >
Span< TMapSpan (size_t count=kFullSize)
 Creates a span that maps a contiguous region of the buffer to the host memory. Behaviour of the memory access is defined by the resource itself. e.g. RO/RW. It is undefined behaviour to access the memory without regard to the resource's host access type. For detailed mapping behaviour, Map
 
virtual RHIBufferScopedHandle< RHIBufferCreateAliasedBuffer (RHIBufferDesc const &desc, size_t offset=0)=0
 
virtual RHIBufferGetAliasedBuffer (Handle handle) const =0
 
virtual void DestroyAliasedBuffer (Handle handle)=0
 
virtual void DebugSetObjectName (const char *name)=0
 
- Public 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
 

Public Attributes

const RHIBufferDesc mDesc
 

Protected Attributes

const RHIDevicemDevice
 

Constructor & Destructor Documentation

◆ RHIBuffer()

Foundation::RHI::RHIBuffer::RHIBuffer ( RHIDevice const device,
RHIBufferDesc const desc 
)
inline

Member Function Documentation

◆ CreateAliasedBuffer()

virtual RHIBufferScopedHandle< RHIBuffer > Foundation::RHI::RHIBuffer::CreateAliasedBuffer ( RHIBufferDesc const desc,
size_t  offset = 0 
)
pure virtual

◆ DebugSetObjectName()

virtual void Foundation::RHI::RHIBuffer::DebugSetObjectName ( const char name)
pure virtual

◆ DestroyAliasedBuffer()

virtual void Foundation::RHI::RHIBuffer::DestroyAliasedBuffer ( Handle  handle)
pure virtual

◆ Flush()

virtual void Foundation::RHI::RHIBuffer::Flush ( size_t  offset = 0,
size_t  size = kFullSize 
)
pure virtual

Flushes the mapped region to the device. Depending on the implementation, this may be a no-op.

Implemented in Foundation::RHI::VulkanBuffer.

◆ GetAliasedBuffer()

virtual RHIBuffer * Foundation::RHI::RHIBuffer::GetAliasedBuffer ( Handle  handle) const
pure virtual

◆ Map()

virtual void * Foundation::RHI::RHIBuffer::Map ( )
pure virtual

Maps the entire buffer to the host memory. Alignment is implementation-defined. Implementations MUST guarantee consecutive calls to Map() return the same pointer, therefore it's not possible to map the same resource multiple times. For caching behaviours, RHIBufferDesc.

Implemented in Foundation::RHI::VulkanBuffer.

◆ MapSpan()

template<typename T >
Span< T > Foundation::RHI::RHIBuffer::MapSpan ( size_t  count = kFullSize)
inline

Creates a span that maps a contiguous region of the buffer to the host memory. Behaviour of the memory access is defined by the resource itself. e.g. RO/RW. It is undefined behaviour to access the memory without regard to the resource's host access type. For detailed mapping behaviour, Map

Parameters
countcount of elements


◆ Unmap()

virtual void Foundation::RHI::RHIBuffer::Unmap ( )
pure virtual

Releases or unmaps a previously mapped resource. Implementations MUST guarantee that Unmap() is called at destruction time if the resource is still mapped.

Implemented in Foundation::RHI::VulkanBuffer.

Member Data Documentation

◆ mDesc

const RHIBufferDesc Foundation::RHI::RHIBuffer::mDesc

◆ mDevice

const RHIDevice& Foundation::RHI::RHIBuffer::mDevice
protected

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