Vulkan: Add VkDeviceMemory wrapper
Former-commit-id: a7ba192880bb034718a2a3d37022343ff32aae1a [formerly e6911d0772f7c2d4612bdbd97da195873f5a30f6] Former-commit-id: bf235ba9b59bfeb39da3b0fd0b89934cb21061b6
This commit is contained in:
43
include/Nazara/Vulkan/VkDeviceMemory.hpp
Normal file
43
include/Nazara/Vulkan/VkDeviceMemory.hpp
Normal file
@@ -0,0 +1,43 @@
|
||||
// Copyright (C) 2016 Jérôme Leclercq
|
||||
// This file is part of the "Nazara Engine - Vulkan"
|
||||
// For conditions of distribution and use, see copyright notice in Config.hpp
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef NAZARA_VULKAN_VKDEVICEMEMORY_HPP
|
||||
#define NAZARA_VULKAN_VKDEVICEMEMORY_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Vulkan/VkDeviceObject.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
class DeviceMemory : public DeviceObject<DeviceMemory, VkDeviceMemory, VkMemoryAllocateInfo>
|
||||
{
|
||||
friend DeviceObject;
|
||||
|
||||
public:
|
||||
DeviceMemory() = default;
|
||||
DeviceMemory(const DeviceMemory&) = delete;
|
||||
DeviceMemory(DeviceMemory&&) = default;
|
||||
~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);
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Vulkan/VkDeviceMemory.inl>
|
||||
|
||||
#endif // NAZARA_VULKAN_VKDEVICEMEMORY_HPP
|
||||
Reference in New Issue
Block a user