RavEngine
Loading...
Searching...
No Matches
RavEngine::VRAMVector< T, GPUWritable > Struct Template Reference

#include <VRAMVector.hpp>

Inheritance diagram for RavEngine::VRAMVector< T, GPUWritable >:
[legend]
Collaboration diagram for RavEngine::VRAMVector< T, GPUWritable >:
[legend]

Classes

struct  const_iterator
 
struct  iterator
 

Public Types

using size_type = uint32_t
 
using index_type = uint32_t
 
using difference_type = uint32_t
 

Public Member Functions

 VRAMVector (size_type numValues)
 
 VRAMVector (const VRAMVector &)=delete
 
 VRAMVector (VRAMVector &&other)
 
VRAMVector & operator= (VRAMVector &&other)
 
auto data ()
 
auto data () const
 
auto size () const
 
auto capacity () const
 
void _setElementCount (uint32_t allocatedElements)
 
void reserve (size_type newSize)
 
void resize (size_type newSize)
 
void grow ()
 
bool reserveIfNeeded ()
 
template<typename ... Args>
auto & emplace_back (Args &&... args)
 
void push_back (const T &value)
 
void at (index_type i)
 
auto & operator[] (index_type i)
 
const auto & operator[] (index_type i) const
 
void erase (index_type i)
 
void erase (iterator i)
 
void erase (const_iterator i)
 
void pop_back ()
 
auto begin ()
 
auto end ()
 
auto & back ()
 
auto begin () const
 
auto end () const
 
- Public Member Functions inherited from RavEngine::VRAMVectorBase
void TrashOldVector (RGLBufferPtr buffer)
 

Public Attributes

RGL::BufferConfig settings
 
size_type nValues = 0
 
- Public Attributes inherited from RavEngine::VRAMVectorBase
RGLDevicePtr owningDevice = nullptr
 
RGLBufferPtr buffer = nullptr
 

Static Public Attributes

static constexpr uint32_t initialSize = 16
 

Detailed Description

template<typename T, bool GPUWritable = false>
struct RavEngine::VRAMVector< T, GPUWritable >

Implements a vector on top of RGLBuffer. The data in this buffer can also be used in shaders or other GPU actions. This buffer uses SHARED memory. Be aware of this and its consequences with respect to performance.

Member Function Documentation

◆ _setElementCount()

template<typename T , bool GPUWritable = false>
void RavEngine::VRAMVector< T, GPUWritable >::_setElementCount ( uint32_t  allocatedElements)
inline

Set the internal "size" of the container. Does not initialize or destroy elements. Use with care.

◆ reserve()

template<typename T , bool GPUWritable = false>
void RavEngine::VRAMVector< T, GPUWritable >::reserve ( size_type  newSize)
inline

Make space for more elements, but the current count remains

Parameters
newSizethe size in elements (not bytes)

◆ resize()

template<typename T , bool GPUWritable = false>
void RavEngine::VRAMVector< T, GPUWritable >::resize ( size_type  newSize)
inline

Make space for more elements, and mark them as consumed

Parameters
newSizethe size in elements (not bytes)

Member Data Documentation

◆ settings

template<typename T , bool GPUWritable = false>
RGL::BufferConfig RavEngine::VRAMVector< T, GPUWritable >::settings
Initial value:
{
initialSize,
{.StorageBuffer = true, .VertexBuffer = true},
sizeof(T),
RGL::BufferAccess::Shared,
{
.Transfersource = true,
.Writable = GPUWritable,
.debugName = "VRAMVector Buffer"
}
}
Definition concurrentqueue.h:747

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