X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fbackends%2Fvulkan%2Fmemoryallocator.cpp;fp=source%2Fbackends%2Fvulkan%2Fmemoryallocator.cpp;h=6ffcc9fc5917bee515e46e7a8ce30da5f80a29a1;hb=99ca354f18119f82f1adeca100cd665a8f640317;hp=0000000000000000000000000000000000000000;hpb=4cd245dafe6a7ee5c93edca5aee2d146f1155309;p=libs%2Fgl.git diff --git a/source/backends/vulkan/memoryallocator.cpp b/source/backends/vulkan/memoryallocator.cpp new file mode 100644 index 00000000..6ffcc9fc --- /dev/null +++ b/source/backends/vulkan/memoryallocator.cpp @@ -0,0 +1,136 @@ +#include +#include +#include "device.h" +#include "error.h" +#include "memoryallocator.h" +#include "vulkan.h" + +using namespace std; + +namespace Msp { +namespace GL { + +MemoryAllocator::MemoryAllocator(Device &d): + device(d), + phys_device(handle_cast(device.get_context().get_private().physical_device)) +{ + const VulkanFunctions &vk = device.get_functions(); + + VkPhysicalDeviceMemoryProperties mem_props; + vk.GetPhysicalDeviceMemoryProperties(mem_props); + + const VkMemoryPropertyFlags host_flags = VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT | VK_MEMORY_PROPERTY_HOST_COHERENT_BIT; + memory_types.reserve(mem_props.memoryTypeCount); + for(unsigned i=0; imemory); + i->mapped_address = 0; +} + +} // namespace GL +} // namespace Msp