mirror of
https://github.com/seekrs/MacroLibX.git
synced 2026-01-11 14:43:34 +00:00
working on garbage collection, fixing small issues with font destroy
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
#define STB_IMAGE_IMPLEMENTATION
|
||||
|
||||
#define STBI_ASSERT(x) (mlx::Assert(x, "internal stb assertion " #x))
|
||||
#define STBI_MALLOC(x) (mlx::MemManager::Get().Malloc(x))
|
||||
#define STBI_REALLOC(p, x) (mlx::MemManager::Get().Realloc(p, x))
|
||||
#define STBI_FREE(x) (mlx::MemManager::Get().Free(x))
|
||||
#define STBI_MALLOC(x) (mlx::MemManager::Malloc(x))
|
||||
#define STBI_REALLOC(p, x) (mlx::MemManager::Realloc(p, x))
|
||||
#define STBI_FREE(x) (mlx::MemManager::Free(x))
|
||||
|
||||
#ifdef MLX_COMPILER_GCC
|
||||
#pragma GCC diagnostic push
|
||||
@@ -295,7 +295,7 @@ namespace mlx
|
||||
int channels;
|
||||
|
||||
std::uint8_t* data = stbi_load(filename.c_str(), &size.x, &size.y, &channels, 4);
|
||||
CallOnExit defer([=]() { stbi_image_free(data); });
|
||||
CallOnExit defer([&]() { stbi_image_free(data); });
|
||||
|
||||
CPUBuffer buffer(size.x * size.y * 4);
|
||||
std::memcpy(buffer.GetData(), data, buffer.GetSize());
|
||||
|
||||
@@ -59,9 +59,9 @@ namespace mlx
|
||||
return MemManager::AlignedMalloc(alignment, size);
|
||||
}
|
||||
|
||||
void* VulkanReallocationFunction(void*, void* ptr, std::size_t size, std::size_t, VkSystemAllocationScope)
|
||||
void* VulkanReallocationFunction(void*, void* ptr, std::size_t size, std::size_t alignment, VkSystemAllocationScope)
|
||||
{
|
||||
return MemManager::Realloc(ptr, size);
|
||||
return MemManager::AlignedRealloc(ptr, alignment, size);
|
||||
}
|
||||
|
||||
void VulkanFreeFunction(void*, void* ptr)
|
||||
|
||||
@@ -102,6 +102,7 @@ namespace mlx
|
||||
VkFence fence = kvfCreateFence(RenderCore::Get().GetDevice());
|
||||
kvfSubmitSingleTimeCommandBuffer(RenderCore::Get().GetDevice(), cmd, KVF_GRAPHICS_QUEUE, fence);
|
||||
kvfDestroyFence(RenderCore::Get().GetDevice(), fence);
|
||||
m_resize = false;
|
||||
DebugLog("Vulkan: swapchain created");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user