Quake-III-Arena-VS/src/engine/renderer/vk_allocator.h
Artem Kharytoniuk 8f15de3cdc Memory allocation for geometry data.
Single allocation is made and from it I suballocate two buffers: for vertex and index data correspondingly.
2017-04-24 15:11:43 +03:00

19 lines
464 B
C++

#pragma once
#include "vk.h"
#include <vector>
// NOTE: in this implementation I do memory allocation for each allocation request.
// TODO: sub-allocate from larger chunks and return chunk handle plus offset withing corresponding chunk.
class Device_Memory_Allocator {
public:
void deallocate_all();
VkDeviceMemory allocate_staging_memory(VkBuffer buffer);
private:
std::vector<VkDeviceMemory> chunks;
};
Device_Memory_Allocator* get_allocator();