3#include "../Base/BuffersCommon.h"
7#include "../Base/ResourcePolicies.h"
9#include "Foundation/Collections/ConfigurablePagedPool.h"
16 uint8_t * mappedRegion;
38 VkDeviceMemory deviceMemory;
41 std::vector<uint8_t> storage;
42 uint8_t * mappedRegion;
47 void initialize(
GraphicsDeviceVK * graphicsDevice, VkDevice device,
size_t capacity, uint32_t elementSize, uint32_t pageSize = 128)
50 context.graphicsDevice = graphicsDevice;
51 context.device = device;
52 context.elementSize = elementSize;
55 ConfigurablePagedPool::initialize(context, capacity, pageSize);
64 VkDeviceMemory deviceMemory;
66 VkBufferView bufferView;
67 VkDescriptorBufferInfo bufferInfo;
82 VkPipelineVertexInputStateCreateInfo vertexInputState;
83 std::vector<VkVertexInputBindingDescription> vertexInputBinding;
84 std::vector<VkVertexInputAttributeDescription> vertexInputAttribs;
112 std::unordered_map<size_t, VertexFormat> vertexFormats;
void releaseVertexBuffer(VertexBufferHandle vertexBufferHandle) override
Release the vertex buffer with the given handle.
BufferHandle loadBuffer(const void *data, const size_t size, Usage::EUsage usage, uint32_t accessMode, uint32_t bindFlags, uint32_t stride=0) override
Loads a new buffer using the given data to populate the buffer.
void releaseBuffer(BufferHandle bufferHandle) override
Releases the buffer with the given bufferHandle.
VertexBufferHandle loadVertexBuffer(const void *vertexData, const size_t count, const VertexFormat &vertexFormat) override
Loads a new vertex buffer and populates it with the given data.
void releaseInputLayout(InputLayoutHandle inputLayoutHandle) override
Releases the input layout with the given inputLayoutHandle.
IndexBufferHandle loadIndexBuffer(const void *indexData, const size_t count, const size_t indexSize) override
Loads a new index buffer and populates it with the given indexData.
void releaseIndexBuffer(IndexBufferHandle indexBufferHandle) override
Releases the index buffer with the given handle.
void retrieveSubBuffer(void *data, BufferHandle source, const size_t offset, const size_t size) override
Retrieves the contents of a buffer.
void * getNativeHandle(BufferHandle bufferHandle) override
Get the device-specific handle (D3D buffer pointer, OpenGL buffer ID etc) associated with the given b...
void releaseResources() override
Releases all allocated buffer resources.
InputLayoutHandle loadInputLayout(const VertexFormatHandle *vertexFormats, const size_t count, EffectHandle effectHandle) override
Loads a new input layout to map vertex flow between vertex buffers with the given vertexFormats to ef...
Provides a configurable pool implementation usable as base implementation for several pool-like stora...
Contains all Cogs related functionality.
EBindFlags
Bind flags enumeration.