mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-13 07:33:34 +00:00
new branch for error management
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: kbz_8 <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/10/20 22:02:37 by kbz_8 #+# #+# */
|
||||
/* Updated: 2023/12/10 22:44:55 by kbz_8 ### ########.fr */
|
||||
/* Updated: 2023/12/16 14:47:53 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -17,7 +17,11 @@
|
||||
#define VMA_STATIC_VULKAN_FUNCTIONS 0
|
||||
#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
|
||||
#define VMA_VULKAN_VERSION 1002000
|
||||
#define VMA_ASSERT(expr) (static_cast<bool>(expr) ? void(0) : mlx::core::error::report(e_kind::fatal_error, "Graphics allocator : an assertion has been catched : '%s'", #expr))
|
||||
#ifdef DEBUG
|
||||
#define VMA_ASSERT(expr) (static_cast<bool>(expr) ? void(0) : mlx::core::error::report(e_kind::fatal_error, "Graphics allocator : an assertion has been catched : '%s'", #expr))
|
||||
#else
|
||||
#define VMA_ASSERT(expr) ((void)0)
|
||||
#endif
|
||||
#define VMA_IMPLEMENTATION
|
||||
|
||||
#ifdef MLX_COMPILER_CLANG
|
||||
@@ -93,6 +97,7 @@ namespace mlx
|
||||
#ifdef DEBUG
|
||||
core::error::report(e_kind::message, "Graphics Allocator : created new buffer");
|
||||
#endif
|
||||
_active_allocations++;
|
||||
return allocation;
|
||||
}
|
||||
|
||||
@@ -103,6 +108,7 @@ namespace mlx
|
||||
#ifdef DEBUG
|
||||
core::error::report(e_kind::message, "Graphics Allocator : destroyed buffer");
|
||||
#endif
|
||||
_active_allocations--;
|
||||
}
|
||||
|
||||
VmaAllocation GPUallocator::createImage(const VkImageCreateInfo* iminfo, const VmaAllocationCreateInfo* vinfo, VkImage& image, const char* name) noexcept
|
||||
@@ -115,6 +121,7 @@ namespace mlx
|
||||
#ifdef DEBUG
|
||||
core::error::report(e_kind::message, "Graphics Allocator : created new image");
|
||||
#endif
|
||||
_active_allocations++;
|
||||
return allocation;
|
||||
}
|
||||
|
||||
@@ -125,6 +132,7 @@ namespace mlx
|
||||
#ifdef DEBUG
|
||||
core::error::report(e_kind::message, "Graphics Allocator : destroyed image");
|
||||
#endif
|
||||
_active_allocations--;
|
||||
}
|
||||
|
||||
void GPUallocator::mapMemory(VmaAllocation allocation, void** data) noexcept
|
||||
@@ -164,6 +172,8 @@ namespace mlx
|
||||
|
||||
void GPUallocator::destroy() noexcept
|
||||
{
|
||||
if(_active_allocations != 0)
|
||||
core::error::report(e_kind::error, "Graphics allocator : some allocations were not freed before destroying the display (%d active allocations)", _active_allocations);
|
||||
vmaDestroyAllocator(_allocator);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/10/20 02:13:03 by maldavid #+# #+# */
|
||||
/* Updated: 2023/12/08 19:07:34 by kbz_8 ### ########.fr */
|
||||
/* Updated: 2023/12/16 14:43:31 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace mlx
|
||||
|
||||
private:
|
||||
VmaAllocator _allocator;
|
||||
uint32_t _active_allocations = 0;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/02 17:53:06 by maldavid #+# #+# */
|
||||
/* Updated: 2023/12/15 20:31:29 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/16 18:47:36 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace mlx
|
||||
|
||||
VkResult res;
|
||||
if((res = vkCreateFence(Render_Core::get().getDevice().get(), &fenceInfo, nullptr, &_fence)) != VK_SUCCESS)
|
||||
core::error::report(e_kind::fatal_error, "Vulkan : failed to create CPU synchronization object, %s", RCore::verbaliseResultVk(res));
|
||||
core::error::report(e_kind::fatal_error, "Vulkan : failed to create a synchronization object (fence), %s", RCore::verbaliseResultVk(res));
|
||||
#ifdef DEBUG
|
||||
core::error::report(e_kind::message, "Vulkan : created new fence");
|
||||
#endif
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/04/02 17:52:09 by maldavid #+# #+# */
|
||||
/* Updated: 2023/12/15 20:31:25 by maldavid ### ########.fr */
|
||||
/* Updated: 2023/12/16 17:27:28 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
/* By: maldavid <kbz_8.dev@akel-engine.com> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2022/10/08 19:01:08 by maldavid #+# #+# */
|
||||
/* Updated: 2023/12/12 15:51:37 by kbz_8 ### ########.fr */
|
||||
/* Updated: 2023/12/16 18:47:29 by maldavid ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace mlx
|
||||
VkResult res;
|
||||
if( (res = vkCreateSemaphore(Render_Core::get().getDevice().get(), &semaphoreInfo, nullptr, &_imageAvailableSemaphores)) != VK_SUCCESS ||
|
||||
(res = vkCreateSemaphore(Render_Core::get().getDevice().get(), &semaphoreInfo, nullptr, &_renderFinishedSemaphores)) != VK_SUCCESS)
|
||||
core::error::report(e_kind::fatal_error, "Vulkan : failed to create GPU synchronization object, %s", RCore::verbaliseResultVk(res));
|
||||
core::error::report(e_kind::fatal_error, "Vulkan : failed to create a synchronization object (semaphore), %s", RCore::verbaliseResultVk(res));
|
||||
#ifdef DEBUG
|
||||
core::error::report(e_kind::message, "Vulkan : created new semaphore");
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user