CMSC23740 Common Code Library
Support code for CS23740 programming projects
Loading...
Searching...
No Matches
cs237::StorageBuffer< S > Class Template Reference

#include <buffer.hpp>

Inheritance diagram for cs237::StorageBuffer< S >:
Collaboration diagram for cs237::StorageBuffer< S >:

Public Types

using BufferType = S
 the type of the buffer's contents
 

Public Member Functions

 StorageBuffer (Application *app)
 
 StorageBuffer (Application *app, S const &src)
 
 StorageBuffer (Application *app, vk::ArrayProxy< S > const &src)
 
void copyTo (S const &src)
 
vk::DescriptorBufferInfo descInfo ()
 get the default buffer-descriptor info for this buffer
 
void copyTo (vk::ArrayProxy< S > const &src)
 
void copyTo (vk::ArrayProxy< S > const &src, uint32_t offset)
 
- Public Member Functions inherited from cs237::Buffer
vk::Buffer vkBuffer () const
 get the Vulkan buffer object for this buffer
 
MemoryObjmemory () const
 get the memory object for this buffer
 
vk::MemoryRequirements requirements ()
 get the memory requirements of this buffer
 

Additional Inherited Members

- Protected Member Functions inherited from cs237::Buffer
 Buffer (Application *app, vk::BufferUsageFlags usage, size_t sz)
 
 ~Buffer ()
 destructor
 
void _copyTo (const void *src, size_t offset, size_t sz)
 
void _copyTo (const void *src)
 
- Protected Attributes inherited from cs237::Buffer
Application_app
 the application
 
vk::Buffer _buf
 the Vulkan buffer object
 
MemoryObj_mem
 the Vulkan memory object that holds the buffer
 

Detailed Description

template<typename S>
class cs237::StorageBuffer< S >

A StorageBuffer<S> is both a wrapper around a Vulkan storage buffer that can be read by the graphics pipeline.

Member Typedef Documentation

◆ BufferType

template<typename S >
using cs237::StorageBuffer< S >::BufferType = S

the type of the buffer's contents

Constructor & Destructor Documentation

◆ StorageBuffer() [1/3]

template<typename S >
cs237::StorageBuffer< S >::StorageBuffer ( Application * app)
inline

constructor

Parameters
appthe owning application object

◆ StorageBuffer() [2/3]

template<typename S >
cs237::StorageBuffer< S >::StorageBuffer ( Application * app,
S const & src )
inline

constructor with initialization

Parameters
appthe owning application object
[in]srcthe buffer contents to copy to the Vulkan memory buffer

◆ StorageBuffer() [3/3]

template<typename S >
cs237::StorageBuffer< S >::StorageBuffer ( Application * app,
vk::ArrayProxy< S > const & src )
inline

constructor

Parameters
appthe owning application object
[in]srcthe buffer contents to copy to the Vulkan memory buffer

Member Function Documentation

◆ copyTo() [1/3]

template<typename S >
void cs237::StorageBuffer< S >::copyTo ( S const & src)
inline

copy the buffer data to the device memory object

Parameters
[in]srcthe buffer contents to copy to the Vulkan memory buffer TODO: Will have to change this potentially. SSBO having an identity crisis

◆ copyTo() [2/3]

template<typename S >
void cs237::StorageBuffer< S >::copyTo ( vk::ArrayProxy< S > const & src)
inline

copy vertices to the device memory object

Parameters
srcproxy array of vertices

◆ copyTo() [3/3]

template<typename S >
void cs237::StorageBuffer< S >::copyTo ( vk::ArrayProxy< S > const & src,
uint32_t offset )
inline

copy vertices to the device memory object

Parameters
srcproxy array of vertices
offsetoffset from the beginning of the buffer to copy the data to

◆ descInfo()

template<typename S >
vk::DescriptorBufferInfo cs237::StorageBuffer< S >::descInfo ( )
inline

get the default buffer-descriptor info for this buffer


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