wren
Vulkan-based game engine
Loading...
Searching...
No Matches
wren::vk::Buffer Class Reference

#include <buffer.hpp>

Collaboration diagram for wren::vk::Buffer:

Public Member Functions

 Buffer (const VmaAllocator &allocator)
 
 ~Buffer ()
 
 Buffer (const Buffer &)=delete
 
 Buffer (Buffer &&)=delete
 
auto operator= (const Buffer &)=delete
 
auto operator= (Buffer &&)=delete
 
template<typename T >
auto set_data_raw (std::span< const T > data) -> expected< void >
 
auto set_data_raw (const void *data, std::size_t size) -> expected< void >
 
auto map ()
 
auto unmap ()
 
auto get () const
 

Static Public Member Functions

static auto create (const VmaAllocator &allocator, size_t size, VkBufferUsageFlags usage, const std::optional< VmaAllocationCreateFlags > &flags={}) -> std::shared_ptr< Buffer >
 
static auto copy_buffer (const ::vk::Device &device, const ::vk::Queue &submit_queue, const ::vk::CommandPool &command_pool, const std::shared_ptr< Buffer > &src, const std::shared_ptr< Buffer > &dst, size_t size) -> expected< void >
 

Private Attributes

::vk::Buffer buffer_ {}
 
VmaAllocator allocator_ = nullptr
 
VmaAllocation allocation_ {}
 
void * mapped_ptr_ = nullptr
 

Constructor & Destructor Documentation

◆ Buffer() [1/3]

wren::vk::Buffer::Buffer ( const VmaAllocator & allocator)
inline

◆ ~Buffer()

wren::vk::Buffer::~Buffer ( )
Here is the call graph for this function:

◆ Buffer() [2/3]

wren::vk::Buffer::Buffer ( const Buffer & )
delete

◆ Buffer() [3/3]

wren::vk::Buffer::Buffer ( Buffer && )
delete

Member Function Documentation

◆ copy_buffer()

auto wren::vk::Buffer::copy_buffer ( const ::vk::Device & device,
const ::vk::Queue & submit_queue,
const ::vk::CommandPool & command_pool,
const std::shared_ptr< Buffer > & src,
const std::shared_ptr< Buffer > & dst,
size_t size ) -> expected<void>
static
Here is the caller graph for this function:

◆ create()

auto wren::vk::Buffer::create ( const VmaAllocator & allocator,
size_t size,
VkBufferUsageFlags usage,
const std::optional< VmaAllocationCreateFlags > & flags = {} ) -> std::shared_ptr<Buffer>
static
Here is the caller graph for this function:

◆ get()

auto wren::vk::Buffer::get ( ) const
inline

◆ map()

auto wren::vk::Buffer::map ( )
inline

◆ operator=() [1/2]

auto wren::vk::Buffer::operator= ( Buffer && )
delete

◆ operator=() [2/2]

auto wren::vk::Buffer::operator= ( const Buffer & )
delete

◆ set_data_raw() [1/2]

auto wren::vk::Buffer::set_data_raw ( const void * data,
std::size_t size ) -> expected<void>
Here is the call graph for this function:

◆ set_data_raw() [2/2]

template<typename T >
auto wren::vk::Buffer::set_data_raw ( std::span< const T > data) -> expected<void>

◆ unmap()

auto wren::vk::Buffer::unmap ( )
inline
Here is the caller graph for this function:

Member Data Documentation

◆ allocation_

VmaAllocation wren::vk::Buffer::allocation_ {}
private

◆ allocator_

VmaAllocator wren::vk::Buffer::allocator_ = nullptr
private

◆ buffer_

::vk::Buffer wren::vk::Buffer::buffer_ {}
private

◆ mapped_ptr_

void* wren::vk::Buffer::mapped_ptr_ = nullptr
private

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