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

#include <buffer.hpp>

Inheritance diagram for cs237::StorageVertexBuffer< SV >:
Collaboration diagram for cs237::StorageVertexBuffer< SV >:

Public Types

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

Public Member Functions

 StorageVertexBuffer (Application *app, uint32_t nVerts)
 
 StorageVertexBuffer (Application *app, vk::ArrayProxy< SV > const &src)
 
void copyTo (vk::ArrayProxy< SV > const &src)
 
void copyTo (vk::ArrayProxy< SV > const &src, uint32_t offset)
 
vk::DescriptorBufferInfo descInfo ()
 get the default buffer-descriptor info for this buffer
 
- 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 SV>
class cs237::StorageVertexBuffer< SV >

A StorageVertexBuffer<SV> is both a storage buffer and a vertex buffer that can be read by the graphics pipeline, where SV is the vertex type

Member Typedef Documentation

◆ BufferType

template<typename SV >
using cs237::StorageVertexBuffer< SV >::BufferType = SV

the type of the buffer's contents

Constructor & Destructor Documentation

◆ StorageVertexBuffer() [1/2]

template<typename SV >
cs237::StorageVertexBuffer< SV >::StorageVertexBuffer ( Application * app,
uint32_t nVerts )
inline

constructor

Parameters
appthe owning application object
nVertsthe number of vertices that can be stored in the buffer

◆ StorageVertexBuffer() [2/2]

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

constructor with initialization

Parameters
appthe owning application object
srcthe array of vertices used to initialize the buffer

Member Function Documentation

◆ copyTo() [1/2]

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

copy vertices to the device memory object

Parameters
srcproxy array of vertices

◆ copyTo() [2/2]

template<typename SV >
void cs237::StorageVertexBuffer< SV >::copyTo ( vk::ArrayProxy< SV > 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 SV >
vk::DescriptorBufferInfo cs237::StorageVertexBuffer< SV >::descInfo ( )
inline

get the default buffer-descriptor info for this buffer


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