Vookoo
Public Member Functions | List of all members
vku::GenericBuffer Class Reference

#include <vku.hpp>

Inheritance diagram for vku::GenericBuffer:
vku::HostIndexBuffer vku::HostVertexBuffer vku::IndexBuffer vku::UniformBuffer vku::VertexBuffer

Public Member Functions

 GenericBuffer (vk::Device device, vk::PhysicalDeviceMemoryProperties memprops, vk::BufferUsageFlags usage, vk::DeviceSize size, vk::MemoryPropertyFlags memflags=vk::MemoryPropertyFlagBits::eDeviceLocal)
 
void updateLocal (const vk::Device &device, const void *value, vk::DeviceSize size) const
 For a host buffer, copy memory to the buffer object.
 
void upload (vk::Device device, const vk::PhysicalDeviceMemoryProperties &memprops, vk::CommandPool commandPool, vk::Queue queue, const void *value, vk::DeviceSize size) const
 
template<typename T >
void upload (vk::Device device, const vk::PhysicalDeviceMemoryProperties &memprops, vk::CommandPool commandPool, vk::Queue queue, const std::vector< T > &value) const
 
template<typename T >
void upload (vk::Device device, const vk::PhysicalDeviceMemoryProperties &memprops, vk::CommandPool commandPool, vk::Queue queue, const T &value) const
 
void barrier (vk::CommandBuffer cb, vk::PipelineStageFlags srcStageMask, vk::PipelineStageFlags dstStageMask, vk::DependencyFlags dependencyFlags, vk::AccessFlags srcAccessMask, vk::AccessFlags dstAccessMask, uint32_t srcQueueFamilyIndex, uint32_t dstQueueFamilyIndex) const
 
template<class Type , class Allocator >
void updateLocal (const vk::Device &device, const std::vector< Type, Allocator > &value) const
 
template<class Type >
void updateLocal (const vk::Device &device, const Type &value) const
 
void * map (const vk::Device &device) const
 
void unmap (const vk::Device &device) const
 
void flush (const vk::Device &device) const
 
void invalidate (const vk::Device &device) const
 
vk::Buffer buffer () const
 
vk::DeviceMemory mem () const
 
vk::DeviceSize size () const
 

Detailed Description

A generic buffer that may be used as a vertex buffer, uniform buffer or other kinds of memory resident data. Buffers require memory objects which represent GPU and CPU resources.

Member Function Documentation

void vku::GenericBuffer::upload ( vk::Device  device,
const vk::PhysicalDeviceMemoryProperties &  memprops,
vk::CommandPool  commandPool,
vk::Queue  queue,
const void *  value,
vk::DeviceSize  size 
) const
inline

For a device local buffer, copy memory to the buffer object immediately. Note that this will stall the pipeline!


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