22#ifndef INCLUDED_VERTEXBUFFER
23#define INCLUDED_VERTEXBUFFER
95 const char* name,
const size_t vertexSize,
99 const char* name,
const size_t vertexSize,
101 const size_t maximumBufferSize);
143 const size_t vertexSize,
const size_t numberOfVertices,
160 std::unique_ptr<Renderer::Backend::IBuffer>
m_Buffer;
Definition: VertexBufferManager.h:35
CVertexBuffer: encapsulation of backend buffers, also supplying some additional functionality for sha...
Definition: VertexBuffer.h:58
size_t m_FreeVertices
Available free vertices - total of all free vertices in the free list.
Definition: VertexBuffer.h:158
~CVertexBuffer()
Definition: VertexBuffer.cpp:78
static bool UseStreaming(const uint32_t usage)
Given the usage flags of a buffer that has been (or will be) allocated:
Definition: VertexBuffer.cpp:313
void UpdateChunkVertices(VBChunk *chunk, void *data)
Update vertex data for given chunk. Transfers the provided data to the actual OpenGL vertex buffer.
Definition: VertexBuffer.cpp:206
std::vector< VBChunk * > m_FreeList
List of free chunks in this buffer.
Definition: VertexBuffer.h:154
NONCOPYABLE(CVertexBuffer)
void PrepareForRendering(VBChunk *chunk)
Make the vertex data available for the next usage.
Definition: VertexBuffer.cpp:318
CVertexBuffer(Renderer::Backend::IDevice *device, const char *name, const size_t vertexSize, const Renderer::Backend::IBuffer::Type type, const uint32_t usage)
Definition: VertexBuffer.cpp:37
size_t GetVertexSize() const
Definition: VertexBuffer.h:112
VBChunk * Allocate(const size_t vertexSize, const size_t numberOfVertices, const Renderer::Backend::IBuffer::Type type, const uint32_t usage, void *backingStore)
Try to allocate a buffer of given number of vertices (each of given size), and with the given type - ...
Definition: VertexBuffer.cpp:101
void Release(VBChunk *chunk)
Return given chunk to this buffer.
Definition: VertexBuffer.cpp:164
void UploadIfNeeded(Renderer::Backend::IDeviceCommandContext *deviceCommandContext)
Definition: VertexBuffer.cpp:226
size_t m_VertexSize
Vertex size of this vertex buffer.
Definition: VertexBuffer.h:150
bool m_HasNeededChunks
Definition: VertexBuffer.h:162
std::unique_ptr< Renderer::Backend::IBuffer > m_Buffer
Definition: VertexBuffer.h:160
size_t m_MaxVertices
Number of vertices of above size in this buffer.
Definition: VertexBuffer.h:152
Renderer::Backend::IBuffer * GetBuffer()
Definition: VertexBuffer.h:135
void DumpStatus() const
Definition: VertexBuffer.cpp:300
bool CompatibleVertexType(const size_t vertexSize, const Renderer::Backend::IBuffer::Type type, const uint32_t usage) const
Returns true if this vertex buffer is compatible with the specified vertex type and intended usage.
Definition: VertexBuffer.cpp:89
size_t GetBytesAllocated() const
Definition: VertexBuffer.cpp:295
size_t GetBytesReserved() const
Definition: VertexBuffer.cpp:290
std::vector< VBChunk * > m_AllocList
List of allocated chunks.
Definition: VertexBuffer.h:156
Type
Definition: IBuffer.h:35
Definition: IDeviceCommandContext.h:42
Definition: VertexBuffer.h:65
CVertexBuffer * m_Owner
Definition: VertexBuffer.h:67
bool m_Needed
Definition: VertexBuffer.h:82
void * m_BackingStore
Definition: VertexBuffer.h:73
size_t m_Count
Definition: VertexBuffer.h:71
~VBChunk()
Definition: VertexBuffer.h:89
VBChunk()
Definition: VertexBuffer.h:88
size_t m_Index
Definition: VertexBuffer.h:69
bool m_Dirty
Definition: VertexBuffer.h:78
unsigned int uint32_t
Definition: wposix_types.h:53