Files
NazaraEngine/include/Nazara/VulkanRenderer/VkDeviceMemory.hpp
Lynix 2c80b04691 VulkanRenderer/DeviceMemory: Fix linking error
Former-commit-id: 849e76f479aaf77646ae786584ac896838cc2f63 [formerly fcbd8bd667d6cfac01e01241bea06c43d34a1ad0] [formerly e042ac243512c07e9870213ec7d5a0e9ff7a4ba2 [formerly 378029f40ef5dee44eb29a73e3d39639bd91cee6]]
Former-commit-id: c284ca126ded4435adbe15ca2a3e619fa2e09e1a [formerly 69da980659df0005066ef6b21a181359d28b184b]
Former-commit-id: a989d3a678fd4c0ce1c23f54c5f3fda5fb175e2e
2016-09-15 00:44:40 +02:00

52 lines
1.7 KiB
C++

// Copyright (C) 2016 Jérôme Leclercq
// This file is part of the "Nazara Engine - Vulkan Renderer"
// For conditions of distribution and use, see copyright notice in Config.hpp
#pragma once
#ifndef NAZARA_VULKANRENDERER_VKDEVICEMEMORY_HPP
#define NAZARA_VULKANRENDERER_VKDEVICEMEMORY_HPP
#include <Nazara/Prerequesites.hpp>
#include <Nazara/VulkanRenderer/VkDeviceObject.hpp>
namespace Nz
{
namespace Vk
{
class DeviceMemory : public DeviceObject<DeviceMemory, VkDeviceMemory, VkMemoryAllocateInfo>
{
friend DeviceObject;
public:
DeviceMemory();
DeviceMemory(const DeviceMemory&) = delete;
inline DeviceMemory(DeviceMemory&& memory);
~DeviceMemory() = default;
using DeviceObject::Create;
inline bool Create(const DeviceHandle& device, VkDeviceSize size, UInt32 memoryType, const VkAllocationCallbacks* allocator = nullptr);
inline bool Create(const DeviceHandle& device, VkDeviceSize size, UInt32 typeBits, VkFlags properties, const VkAllocationCallbacks* allocator = nullptr);
inline void* GetMappedPointer();
inline bool Map(VkDeviceSize offset, VkDeviceSize size, VkMemoryMapFlags flags = 0);
inline void Unmap();
DeviceMemory& operator=(const DeviceMemory&) = delete;
DeviceMemory& operator=(DeviceMemory&&) = delete;
private:
static inline VkResult CreateHelper(const DeviceHandle& device, const VkMemoryAllocateInfo* allocInfo, const VkAllocationCallbacks* allocator, VkDeviceMemory* handle);
static inline void DestroyHelper(const DeviceHandle& device, VkDeviceMemory handle, const VkAllocationCallbacks* allocator);
void* m_mappedPtr;
};
}
}
#include <Nazara/VulkanRenderer/VkDeviceMemory.inl>
#endif // NAZARA_VULKANRENDERER_VKDEVICEMEMORY_HPP