Lluvia
|
Objects to manage raw portions of allocated memory. More...
#include <Buffer.h>
Classes | |
struct | BufferMapDeleter |
Deleter for unmapping buffers from host memory. More... | |
Public Member Functions | |
Buffer ()=delete | |
Buffer (const Buffer &b)=delete | |
Buffer (Buffer &&b)=delete | |
~Buffer () | |
Buffer & | operator= (const Buffer &buffer)=delete |
Buffer & | operator= (Buffer &&buffer)=delete |
ll::ObjectType | getType () const noexcept override |
Gets the object type. More... | |
ll::MemoryAllocationInfo | getAllocationInfo () const noexcept |
Gets the allocation information. More... | |
const std::shared_ptr< ll::Memory > & | getMemory () const noexcept |
Gets the memory this buffer was allocated from. More... | |
uint64_t | getSize () const noexcept |
Gets the size of the buffer in bytes. More... | |
ll::BufferUsageFlags | getUsageFlags () const noexcept |
Gets the Vulkan buffer usage flags. More... | |
uint32_t | getUsageFlagsUnsafe () const noexcept |
Gets the usage flags casted to an integer type. More... | |
bool | isMappable () const noexcept |
Determines if this buffer is mappable to host-visible memory. More... | |
template<typename T > | |
std::unique_ptr< T, ll::Buffer::BufferMapDeleter > | map () |
Maps the memory content of this object to host-visible memory. More... | |
template<typename T > | |
void | mapAndSet (T &&obj) |
template<typename T > | |
void | mapAndSetFromVector (const std::vector< T > &vec) |
![]() | |
Object ()=default | |
Default constructor. More... | |
Object (const Object &)=delete | |
Copy constructor. More... | |
Object (Object &&)=delete | |
Move constructor. More... | |
virtual | ~Object ()=default |
Object & | operator= (const Object &)=delete |
Copy assignment. More... | |
Object & | operator= (Object &&)=delete |
Move assignment. More... | |
Friends | |
class | ll::CommandBuffer |
class | ll::ComputeGraph |
class | ll::ComputeNode |
class | ll::Memory |
class | ll::Session |
Objects to manage raw portions of allocated memory.
Buffer objects are created by calling ll::Memory::createBuffer on a specific memory instance.
This object holds a reference to the ll::Memory it was created from, guaranteeing the memory is not deleted before this buffer is. Upon destruction of this object, the underlying memory space is released from the ll::Memory instance.
|
delete |
|
delete |
|
delete |
ll::Buffer::~Buffer | ( | ) |
|
noexcept |
Gets the allocation information.
|
noexcept |
Gets the memory this buffer was allocated from.
|
noexcept |
Gets the size of the buffer in bytes.
The size returned corresponds to the size requested by the user through Memory::createBuffer function. This size does not include padding or alignment bytes.
|
overridevirtualnoexcept |
Gets the object type.
This method can be used for safely down-casting pointers of ll::Object type to its children.
Implements ll::Object.
|
noexcept |
Gets the Vulkan buffer usage flags.
See https://www.khronos.org/registry/vulkan/specs/1.0/html/vkspec.html#VkBufferUsageFlagBits for more information.
|
noexcept |
Gets the usage flags casted to an integer type.
Please do not use this method. It's for internal use only.
|
noexcept |
Determines if this buffer is mappable to host-visible memory.
This function calls ll::Memory::isPageMappable from the memory this buffer was allocated from.
|
inline |
Maps the memory content of this object to host-visible memory.
The returned pointer can be used to read or write content from and to this buffer from the host.
Once the returned pointer is no longer needed, the user must call ll::Buffer::unmap to release the mapped object.
T | type of the memory mapped. It can be either a normal type such as int or an array such as int[]. |
std::system_error | if the memory page containing this buffer has been previously mapped by this or any other object. |
|
inline |
|
inline |
|
friend |
|
friend |
|
friend |
|
friend |
|
friend |