Vulkan/RenderWindow: Add support for depth buffer
Former-commit-id: 42f113fcb7463c0f010fdc325b9024b08de3c667 [formerly 95040d268ff328f2d54459bf11c269dd5f042f73] [formerly 77c2d1139585cbf31f881ffddfb43b23284a7073 [formerly d235ff32fae4612d95d25524410bf1b43974d520]] Former-commit-id: bab56f18d034bade640bf023c97810adf2c717ff [formerly c62041abb56103d6c7aeac2b55f7bf66acd8882b] Former-commit-id: cef0ac55f6eaa54f17d3d0cc2030a4b9de7b166c
This commit is contained in:
46
include/Nazara/Vulkan/VkImage.inl
Normal file
46
include/Nazara/Vulkan/VkImage.inl
Normal file
@@ -0,0 +1,46 @@
|
||||
// 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
|
||||
|
||||
#include <Nazara/Vulkan/VkImage.hpp>
|
||||
#include <Nazara/Vulkan/Debug.hpp>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
namespace Vk
|
||||
{
|
||||
inline bool Image::BindImageMemory(VkDeviceMemory memory, VkDeviceSize offset)
|
||||
{
|
||||
m_lastErrorCode = m_device->vkBindImageMemory(*m_device, m_handle, memory, offset);
|
||||
if (m_lastErrorCode != VK_SUCCESS)
|
||||
{
|
||||
NazaraError("Failed to bind buffer memory");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
inline VkMemoryRequirements Image::GetMemoryRequirements() const
|
||||
{
|
||||
NazaraAssert(IsValid(), "Invalid image");
|
||||
|
||||
VkMemoryRequirements memoryRequirements;
|
||||
m_device->vkGetImageMemoryRequirements(*m_device, m_handle, &memoryRequirements);
|
||||
|
||||
return memoryRequirements;
|
||||
}
|
||||
|
||||
inline VkResult Image::CreateHelper(const DeviceHandle& device, const VkImageCreateInfo* createInfo, const VkAllocationCallbacks* allocator, VkImage* handle)
|
||||
{
|
||||
return device->vkCreateImage(*device, createInfo, allocator, handle);
|
||||
}
|
||||
|
||||
inline void Image::DestroyHelper(const DeviceHandle& device, VkImage handle, const VkAllocationCallbacks* allocator)
|
||||
{
|
||||
return device->vkDestroyImage(*device, handle, allocator);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#include <Nazara/Vulkan/DebugOff.hpp>
|
||||
Reference in New Issue
Block a user