From be52578d37503beb1f4b63252bc4493cc45e58f7 Mon Sep 17 00:00:00 2001 From: Kbz-8 Date: Mon, 25 Mar 2024 13:57:20 +0100 Subject: [PATCH] fixing some bad memory usage --- compile_commands.json | 2172 ++++++++++---------- example/main.c | 12 +- src/core/application.cpp | 12 +- src/core/graphics.h | 6 +- src/core/graphics.inl | 14 +- src/core/profiler.h | 26 +- src/renderer/buffers/vk_buffer.cpp | 17 +- src/renderer/command/vk_cmd_pool.cpp | 4 +- src/renderer/core/cmd_resource.h | 22 +- src/renderer/core/memory.cpp | 11 +- src/renderer/core/vk_device.cpp | 14 +- src/renderer/core/vk_device.h | 7 +- src/renderer/core/vk_queues.cpp | 10 +- src/renderer/core/vk_queues.h | 16 +- src/renderer/core/vk_semaphore.cpp | 14 +- src/renderer/core/vk_semaphore.h | 11 +- src/renderer/core/vk_validation_layers.cpp | 15 +- src/renderer/core/vk_validation_layers.h | 6 +- src/renderer/images/texture.cpp | 4 +- src/renderer/images/texture.h | 8 +- src/renderer/images/texture_atlas.h | 3 +- src/renderer/images/texture_manager.h | 26 +- src/renderer/images/vk_image.cpp | 17 +- src/renderer/pipeline/pipeline.cpp | 14 +- src/renderer/pipeline/pipeline.h | 13 +- src/renderer/renderer.cpp | 8 +- src/renderer/renderer.h | 6 +- src/renderer/renderpass/vk_render_pass.cpp | 10 +- src/renderer/renderpass/vk_render_pass.h | 8 +- src/renderer/swapchain/vk_swapchain.cpp | 40 +- src/renderer/swapchain/vk_swapchain.h | 18 +- src/renderer/texts/text_library.cpp | 4 +- src/renderer/texts/text_manager.h | 4 +- src/utils/non_copyable.h | 16 +- src/utils/singleton.h | 4 +- 35 files changed, 1294 insertions(+), 1298 deletions(-) diff --git a/compile_commands.json b/compile_commands.json index 2ff098d..650f005 100644 --- a/compile_commands.json +++ b/compile_commands.json @@ -1,1094 +1,1082 @@ [ - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/application.o", - "src/core/application.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/application.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/application.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/bridge.o", - "src/core/bridge.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/bridge.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/bridge.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/errors.o", - "src/core/errors.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/errors.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/errors.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/graphics.o", - "src/core/graphics.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/graphics.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/graphics.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/memory.o", - "src/core/memory.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/memory.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/memory.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/core/UUID.o", - "src/core/UUID.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/core/UUID.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/core/UUID.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/platform/inputs.o", - "src/platform/inputs.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/platform/inputs.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/platform/inputs.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/platform/window.o", - "src/platform/window.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/platform/window.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/platform/window.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/font.o", - "src/renderer/font.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/font.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/font.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/pixel_put.o", - "src/renderer/pixel_put.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/pixel_put.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/pixel_put.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/renderer.o", - "src/renderer/renderer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/renderer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/renderer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/text_library.o", - "src/renderer/text_library.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/text_library.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/text_library.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/text_pipeline.o", - "src/renderer/text_pipeline.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/text_pipeline.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/text_pipeline.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/buffers/vk_buffer.o", - "src/renderer/buffers/vk_buffer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/buffers/vk_buffer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/buffers/vk_buffer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/buffers/vk_ubo.o", - "src/renderer/buffers/vk_ubo.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/buffers/vk_ubo.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/buffers/vk_ubo.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/buffers/vk_vbo.o", - "src/renderer/buffers/vk_vbo.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/buffers/vk_vbo.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/buffers/vk_vbo.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/cmd_manager.o", - "src/renderer/command/cmd_manager.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/cmd_manager.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/cmd_manager.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/single_time_cmd_manager.o", - "src/renderer/command/single_time_cmd_manager.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/single_time_cmd_manager.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/single_time_cmd_manager.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/vk_cmd_buffer.o", - "src/renderer/command/vk_cmd_buffer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/vk_cmd_buffer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_buffer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/command/vk_cmd_pool.o", - "src/renderer/command/vk_cmd_pool.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/command/vk_cmd_pool.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/command/vk_cmd_pool.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/memory.o", - "src/renderer/core/memory.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/memory.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/memory.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/render_core.o", - "src/renderer/core/render_core.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/render_core.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/render_core.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_device.o", - "src/renderer/core/vk_device.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_device.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_device.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_fence.o", - "src/renderer/core/vk_fence.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_fence.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_fence.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_instance.o", - "src/renderer/core/vk_instance.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_instance.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_instance.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_queues.o", - "src/renderer/core/vk_queues.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_queues.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_queues.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_semaphore.o", - "src/renderer/core/vk_semaphore.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_semaphore.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_semaphore.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_surface.o", - "src/renderer/core/vk_surface.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_surface.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_surface.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/core/vk_validation_layers.o", - "src/renderer/core/vk_validation_layers.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/core/vk_validation_layers.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/core/vk_validation_layers.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/descriptors/vk_descriptor_pool.o", - "src/renderer/descriptors/vk_descriptor_pool.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/descriptors/vk_descriptor_pool.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_pool.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/descriptors/vk_descriptor_set.o", - "src/renderer/descriptors/vk_descriptor_set.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/descriptors/vk_descriptor_set.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/descriptors/vk_descriptor_set_layout.o", - "src/renderer/descriptors/vk_descriptor_set_layout.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/descriptors/vk_descriptor_set_layout.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/descriptors/vk_descriptor_set_layout.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/images/texture_atlas.o", - "src/renderer/images/texture_atlas.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/images/texture_atlas.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/images/texture_atlas.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/images/texture.o", - "src/renderer/images/texture.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/images/texture.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/images/texture.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/images/vk_image.o", - "src/renderer/images/vk_image.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/images/vk_image.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/images/vk_image.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/pipeline/pipeline.o", - "src/renderer/pipeline/pipeline.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/pipeline/pipeline.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/pipeline/pipeline.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/renderpass/vk_framebuffer.o", - "src/renderer/renderpass/vk_framebuffer.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/renderpass/vk_framebuffer.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/renderpass/vk_framebuffer.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/renderpass/vk_render_pass.o", - "src/renderer/renderpass/vk_render_pass.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/renderpass/vk_render_pass.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/renderpass/vk_render_pass.o" - }, - { - "arguments": [ - "/usr/bin/clang++", - "-std=c++17", - "-O3", - "-fPIC", - "-Wall", - "-Wextra", - "-Werror", - "-DSDL_MAIN_HANDLED", - "-Wno-error=", - "-g", - "-D", - "DEBUG", - "-D", - "IMAGE_OPTIMIZED", - "-I./includes", - "-I./src", - "-I./third_party", - "-c", - "-o", - "objs/makefile/./src/renderer/swapchain/vk_swapchain.o", - "src/renderer/swapchain/vk_swapchain.cpp" - ], - "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", - "file": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/src/renderer/swapchain/vk_swapchain.cpp", - "output": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX/objs/makefile/src/renderer/swapchain/vk_swapchain.o" - } + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/application.cpp", + "-o", + "objs/makefile/./src/core/application.o" + ], + "file": "src/core/application.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/bridge.cpp", + "-o", + "objs/makefile/./src/core/bridge.o" + ], + "file": "src/core/bridge.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/errors.cpp", + "-o", + "objs/makefile/./src/core/errors.o" + ], + "file": "src/core/errors.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/graphics.cpp", + "-o", + "objs/makefile/./src/core/graphics.o" + ], + "file": "src/core/graphics.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/memory.cpp", + "-o", + "objs/makefile/./src/core/memory.o" + ], + "file": "src/core/memory.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/UUID.cpp", + "-o", + "objs/makefile/./src/core/UUID.o" + ], + "file": "src/core/UUID.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/platform/inputs.cpp", + "-o", + "objs/makefile/./src/platform/inputs.o" + ], + "file": "src/platform/inputs.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/platform/window.cpp", + "-o", + "objs/makefile/./src/platform/window.o" + ], + "file": "src/platform/window.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/pixel_put.cpp", + "-o", + "objs/makefile/./src/renderer/pixel_put.o" + ], + "file": "src/renderer/pixel_put.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/renderer.cpp", + "-o", + "objs/makefile/./src/renderer/renderer.o" + ], + "file": "src/renderer/renderer.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/buffers/vk_buffer.cpp", + "-o", + "objs/makefile/./src/renderer/buffers/vk_buffer.o" + ], + "file": "src/renderer/buffers/vk_buffer.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/buffers/vk_ubo.cpp", + "-o", + "objs/makefile/./src/renderer/buffers/vk_ubo.o" + ], + "file": "src/renderer/buffers/vk_ubo.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/buffers/vk_vbo.cpp", + "-o", + "objs/makefile/./src/renderer/buffers/vk_vbo.o" + ], + "file": "src/renderer/buffers/vk_vbo.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/command/cmd_manager.cpp", + "-o", + "objs/makefile/./src/renderer/command/cmd_manager.o" + ], + "file": "src/renderer/command/cmd_manager.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/command/single_time_cmd_manager.cpp", + "-o", + "objs/makefile/./src/renderer/command/single_time_cmd_manager.o" + ], + "file": "src/renderer/command/single_time_cmd_manager.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/command/vk_cmd_buffer.cpp", + "-o", + "objs/makefile/./src/renderer/command/vk_cmd_buffer.o" + ], + "file": "src/renderer/command/vk_cmd_buffer.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/command/vk_cmd_pool.cpp", + "-o", + "objs/makefile/./src/renderer/command/vk_cmd_pool.o" + ], + "file": "src/renderer/command/vk_cmd_pool.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/memory.cpp", + "-o", + "objs/makefile/./src/renderer/core/memory.o" + ], + "file": "src/renderer/core/memory.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/render_core.cpp", + "-o", + "objs/makefile/./src/renderer/core/render_core.o" + ], + "file": "src/renderer/core/render_core.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_device.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_device.o" + ], + "file": "src/renderer/core/vk_device.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_fence.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_fence.o" + ], + "file": "src/renderer/core/vk_fence.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_instance.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_instance.o" + ], + "file": "src/renderer/core/vk_instance.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_queues.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_queues.o" + ], + "file": "src/renderer/core/vk_queues.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_semaphore.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_semaphore.o" + ], + "file": "src/renderer/core/vk_semaphore.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_surface.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_surface.o" + ], + "file": "src/renderer/core/vk_surface.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/core/vk_validation_layers.cpp", + "-o", + "objs/makefile/./src/renderer/core/vk_validation_layers.o" + ], + "file": "src/renderer/core/vk_validation_layers.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/descriptors/vk_descriptor_pool.cpp", + "-o", + "objs/makefile/./src/renderer/descriptors/vk_descriptor_pool.o" + ], + "file": "src/renderer/descriptors/vk_descriptor_pool.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/descriptors/vk_descriptor_set.cpp", + "-o", + "objs/makefile/./src/renderer/descriptors/vk_descriptor_set.o" + ], + "file": "src/renderer/descriptors/vk_descriptor_set.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/descriptors/vk_descriptor_set_layout.cpp", + "-o", + "objs/makefile/./src/renderer/descriptors/vk_descriptor_set_layout.o" + ], + "file": "src/renderer/descriptors/vk_descriptor_set_layout.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/images/texture_atlas.cpp", + "-o", + "objs/makefile/./src/renderer/images/texture_atlas.o" + ], + "file": "src/renderer/images/texture_atlas.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/images/texture.cpp", + "-o", + "objs/makefile/./src/renderer/images/texture.o" + ], + "file": "src/renderer/images/texture.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/images/vk_image.cpp", + "-o", + "objs/makefile/./src/renderer/images/vk_image.o" + ], + "file": "src/renderer/images/vk_image.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/pipeline/pipeline.cpp", + "-o", + "objs/makefile/./src/renderer/pipeline/pipeline.o" + ], + "file": "src/renderer/pipeline/pipeline.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/renderpass/vk_framebuffer.cpp", + "-o", + "objs/makefile/./src/renderer/renderpass/vk_framebuffer.o" + ], + "file": "src/renderer/renderpass/vk_framebuffer.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/renderpass/vk_render_pass.cpp", + "-o", + "objs/makefile/./src/renderer/renderpass/vk_render_pass.o" + ], + "file": "src/renderer/renderpass/vk_render_pass.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/swapchain/vk_swapchain.cpp", + "-o", + "objs/makefile/./src/renderer/swapchain/vk_swapchain.o" + ], + "file": "src/renderer/swapchain/vk_swapchain.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/fps.cpp", + "-o", + "objs/makefile/./src/core/fps.o" + ], + "file": "src/core/fps.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/core/profiler.cpp", + "-o", + "objs/makefile/./src/core/profiler.o" + ], + "file": "src/core/profiler.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/descriptors/descriptor_pool_manager.cpp", + "-o", + "objs/makefile/./src/renderer/descriptors/descriptor_pool_manager.o" + ], + "file": "src/renderer/descriptors/descriptor_pool_manager.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/texts/font.cpp", + "-o", + "objs/makefile/./src/renderer/texts/font.o" + ], + "file": "src/renderer/texts/font.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/texts/font_library.cpp", + "-o", + "objs/makefile/./src/renderer/texts/font_library.o" + ], + "file": "src/renderer/texts/font_library.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/texts/text.cpp", + "-o", + "objs/makefile/./src/renderer/texts/text.o" + ], + "file": "src/renderer/texts/text.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/texts/text_descriptor.cpp", + "-o", + "objs/makefile/./src/renderer/texts/text_descriptor.o" + ], + "file": "src/renderer/texts/text_descriptor.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/texts/text_library.cpp", + "-o", + "objs/makefile/./src/renderer/texts/text_library.o" + ], + "file": "src/renderer/texts/text_library.cpp" + }, + { + "directory": "/home/kbz_8/Documents/Programmation/42/other/MacroLibX/MacroLibX", + "arguments": [ + "clang++", + "-std=c++17", + "-O3", + "-fPIC", + "-Wall", + "-Wextra", + "-Werror", + "-DSDL_MAIN_HANDLED", + "-Wno-error=", + "-D", + "IMAGE_OPTIMIZED", + "-I./includes", + "-I./src", + "-I./third_party", + "-c", + "src/renderer/texts/text_manager.cpp", + "-o", + "objs/makefile/./src/renderer/texts/text_manager.o" + ], + "file": "src/renderer/texts/text_manager.cpp" + } ] diff --git a/example/main.c b/example/main.c index acb2906..e6a42c9 100644 --- a/example/main.c +++ b/example/main.c @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 17:55:21 by maldavid #+# #+# */ -/* Updated: 2024/02/24 01:07:56 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 20:01:01 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -23,6 +23,8 @@ typedef struct void* img; } mlx_t; +void* img = NULL; + int update(void* param) { static int i = 0; @@ -30,7 +32,13 @@ int update(void* param) if(i == 200) mlx_clear_window(mlx->mlx, mlx->win); - + + if(img) + mlx_destroy_image(mlx->mlx,img); + img = mlx_new_image(mlx->mlx, 800, 800); + mlx_set_image_pixel(mlx->mlx, img, 4, 4, 0xFF00FF00); + mlx_put_image_to_window(mlx->mlx, mlx->win, img, 0, 0); + if(i >= 250) mlx_set_font_scale(mlx->mlx, mlx->win, "default", 16.f); else diff --git a/src/core/application.cpp b/src/core/application.cpp index 7ae629b..237ab2c 100644 --- a/src/core/application.cpp +++ b/src/core/application.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/04 22:10:52 by maldavid #+# #+# */ -/* Updated: 2024/02/25 07:52:04 by maldavid ### ########.fr */ +/* Updated: 2024/03/24 14:39:23 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -89,10 +89,9 @@ namespace mlx::core core::error::report(e_kind::error, "invalid image ptr (NULL)"); return; } - else if(std::find_if(_textures.begin(), _textures.end(), [=](const Texture& texture) - { - return &texture == ptr; - }) == _textures.end()) + + auto it = std::find_if(_textures.begin(), _textures.end(), [=](const Texture& texture) { return &texture == ptr; }); + if(it == _textures.end()) { core::error::report(e_kind::error, "invalid image ptr"); return; @@ -102,6 +101,9 @@ namespace mlx::core core::error::report(e_kind::error, "trying to destroy a texture that has already been destroyed"); else texture->destroy(); + for(auto& gs : _graphics) + gs->tryEraseTextureFromManager(texture); + _textures.erase(it); } Application::~Application() diff --git a/src/core/graphics.h b/src/core/graphics.h index 204b4f3..0966527 100644 --- a/src/core/graphics.h +++ b/src/core/graphics.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/02 14:49:49 by maldavid #+# #+# */ -/* Updated: 2024/01/11 15:47:05 by maldavid ### ########.fr */ +/* Updated: 2024/03/24 14:43:09 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,6 @@ #define __MLX_GRAPHICS__ #include -#include #include #include @@ -33,7 +32,7 @@ namespace mlx { - class GraphicsSupport : public non_copyable + class GraphicsSupport : public NonCopyable { public: GraphicsSupport(std::size_t w, std::size_t h, Texture* render_target, int id); @@ -49,6 +48,7 @@ namespace mlx inline void stringPut(int x, int y, std::uint32_t color, std::string str); inline void texturePut(Texture* texture, int x, int y); inline void loadFont(const std::filesystem::path& filepath, float scale); + inline void tryEraseTextureFromManager(Texture* texture) noexcept; inline bool hasWindow() const noexcept { return _has_window; } diff --git a/src/core/graphics.inl b/src/core/graphics.inl index 7fd7a94..97958e0 100644 --- a/src/core/graphics.inl +++ b/src/core/graphics.inl @@ -11,7 +11,6 @@ /* ************************************************************************** */ #include -#include namespace mlx { @@ -64,4 +63,17 @@ namespace mlx MLX_PROFILE_FUNCTION(); _text_manager.loadFont(*_renderer, filepath, scale); } + + void GraphicsSupport::tryEraseTextureFromManager(Texture* texture) noexcept + { + MLX_PROFILE_FUNCTION(); + for(auto it = _drawlist.begin(); it != _drawlist.end();) + { + if(_texture_manager.isTextureKnown(texture)) + it = _drawlist.erase(it); + else + ++it; + } + _texture_manager.eraseTextures(texture); + } } diff --git a/src/core/profiler.h b/src/core/profiler.h index 0b3ce1d..4424238 100644 --- a/src/core/profiler.h +++ b/src/core/profiler.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/10 13:35:45 by maldavid #+# #+# */ -/* Updated: 2024/01/10 18:36:46 by maldavid ### ########.fr */ +/* Updated: 2024/03/24 14:41:27 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,10 +19,10 @@ #include #include #include -#include #include -#include #include +#include +#include namespace mlx { @@ -115,17 +115,17 @@ namespace mlx { ChangeResult result = {}; - std::size_t srcIndex = 0; - std::size_t dstIndex = 0; - while(srcIndex < N) + std::size_t src_index = 0; + std::size_t dst_index = 0; + while(src_index < N) { - std::size_t matchIndex = 0; - while(matchIndex < K - 1 && srcIndex + matchIndex < N - 1 && expr[srcIndex + matchIndex] == remove[matchIndex]) - matchIndex++; - if(matchIndex == K - 1) - srcIndex += matchIndex; - result.data[dstIndex++] = expr[srcIndex] == '"' ? '\'' : expr[srcIndex]; - srcIndex++; + std::size_t match_index = 0; + while(match_index < K - 1 && src_index + match_index < N - 1 && expr[src_index + match_index] == remove[match_index]) + match_index++; + if(match_index == K - 1) + src_index += match_index; + result.data[dst_index++] = expr[src_index] == '"' ? '\'' : expr[src_index]; + src_index++; } return result; } diff --git a/src/renderer/buffers/vk_buffer.cpp b/src/renderer/buffers/vk_buffer.cpp index 296611d..71693cc 100644 --- a/src/renderer/buffers/vk_buffer.cpp +++ b/src/renderer/buffers/vk_buffer.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 18:55:57 by maldavid #+# #+# */ -/* Updated: 2024/01/11 05:21:20 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:28:35 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -54,16 +54,11 @@ namespace mlx void Buffer::destroy() noexcept { MLX_PROFILE_FUNCTION(); - // not creating destroyer in `create` as some image may be copied (and so `this` will be invalid) - //CmdResource::setDestroyer([this]() - //{ - if(_is_mapped) - unmapMem(); - if(_buffer != VK_NULL_HANDLE) - Render_Core::get().getAllocator().destroyBuffer(_allocation, _buffer); - _buffer = VK_NULL_HANDLE; - //}); - //CmdResource::requireDestroy(); + if(_is_mapped) + unmapMem(); + if(_buffer != VK_NULL_HANDLE) + Render_Core::get().getAllocator().destroyBuffer(_allocation, _buffer); + _buffer = VK_NULL_HANDLE; } void Buffer::createBuffer(VkBufferUsageFlags usage, VmaAllocationCreateInfo info, VkDeviceSize size, [[maybe_unused]] const char* name) diff --git a/src/renderer/command/vk_cmd_pool.cpp b/src/renderer/command/vk_cmd_pool.cpp index 148932f..441d45f 100644 --- a/src/renderer/command/vk_cmd_pool.cpp +++ b/src/renderer/command/vk_cmd_pool.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/06 18:24:33 by maldavid #+# #+# */ -/* Updated: 2024/01/03 13:13:25 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:23:20 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,7 +20,7 @@ namespace mlx VkCommandPoolCreateInfo poolInfo{}; poolInfo.sType = VK_STRUCTURE_TYPE_COMMAND_POOL_CREATE_INFO; poolInfo.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; - poolInfo.queueFamilyIndex = Render_Core::get().getQueue().getFamilies().graphicsFamily.value(); + poolInfo.queueFamilyIndex = Render_Core::get().getQueue().getFamilies().graphics_family.value(); VkResult res = vkCreateCommandPool(Render_Core::get().getDevice().get(), &poolInfo, nullptr, &_cmd_pool); if(res != VK_SUCCESS) diff --git a/src/renderer/core/cmd_resource.h b/src/renderer/core/cmd_resource.h index 9603504..0010333 100644 --- a/src/renderer/core/cmd_resource.h +++ b/src/renderer/core/cmd_resource.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/16 20:44:29 by maldavid #+# #+# */ -/* Updated: 2024/01/11 05:12:42 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:28:08 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -31,31 +31,13 @@ namespace mlx public: CmdResource() : _uuid() {} inline void recordedInCmdBuffer() noexcept { _state = state::in_cmd_buffer; } - inline void removedFromCmdBuffer() noexcept - { - _state = state::out_cmd_buffer; - if(_destroy_required && _destroyer) - { - _destroyer(); - _destroy_required = false; - } - } - inline void setDestroyer(func::function functor) { _destroyer = functor; } - inline void requireDestroy() noexcept - { - if(_state == state::out_cmd_buffer && _destroyer) - _destroyer(); - else - _destroy_required = true; - } + inline void removedFromCmdBuffer() noexcept { _state = state::out_cmd_buffer; } inline UUID getUUID() const noexcept { return _uuid; } virtual ~CmdResource() = default; private: UUID _uuid; state _state = state::out_cmd_buffer; - func::function _destroyer; - bool _destroy_required = false; }; } diff --git a/src/renderer/core/memory.cpp b/src/renderer/core/memory.cpp index 8a5c317..e3cbe7c 100644 --- a/src/renderer/core/memory.cpp +++ b/src/renderer/core/memory.cpp @@ -6,14 +6,13 @@ /* By: kbz_8 +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/10/20 22:02:37 by kbz_8 #+# #+# */ -/* Updated: 2024/01/18 10:11:02 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 16:34:53 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ #include #include #include -#include #define VMA_STATIC_VULKAN_FUNCTIONS 0 #define VMA_DYNAMIC_VULKAN_FUNCTIONS 0 @@ -177,7 +176,7 @@ namespace mlx file.close(); id++; } - + void GPUallocator::flush(VmaAllocation allocation, VkDeviceSize size, VkDeviceSize offset) noexcept { MLX_PROFILE_FUNCTION(); @@ -187,9 +186,11 @@ namespace mlx void GPUallocator::destroy() noexcept { if(_active_images_allocations != 0) - core::error::report(e_kind::error, "Graphics allocator : some user-dependant allocations were not freed before destroying the display (%d active allocations)", _active_images_allocations); + core::error::report(e_kind::error, "Graphics allocator : some user-dependant allocations were not freed before destroying the display (%d active allocations). You may have not destroyed all the MLX resources you've created", _active_images_allocations); else if(_active_buffers_allocations != 0) - core::error::report(e_kind::error, "Graphics allocator : some MLX-dependant allocations were not freed before destroying the display (%d active allocations), please report, this should not happen", _active_buffers_allocations); + core::error::report(e_kind::error, "Graphics allocator : some MLX-dependant allocations were not freed before destroying the display (%d active allocations). This is an error in the MLX, please report this should not happen", _active_buffers_allocations); + if(_active_images_allocations < 0 || _active_buffers_allocations < 0) + core::error::report(e_kind::warning, "Graphics allocator : the impossible happened, the MLX has freed more allocations than it has made (wtf)"); vmaDestroyAllocator(_allocator); _active_buffers_allocations = 0; _active_images_allocations = 0; diff --git a/src/renderer/core/vk_device.cpp b/src/renderer/core/vk_device.cpp index 37d5ae1..f862772 100644 --- a/src/renderer/core/vk_device.cpp +++ b/src/renderer/core/vk_device.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:14:29 by maldavid #+# #+# */ -/* Updated: 2024/01/20 05:34:15 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:23:45 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -17,8 +17,6 @@ #include #include #include -#include -#include namespace mlx { @@ -31,7 +29,7 @@ namespace mlx Queues::QueueFamilyIndices indices = Render_Core::get().getQueue().getFamilies(); std::vector queueCreateInfos; - std::set uniqueQueueFamilies = { indices.graphicsFamily.value(), indices.presentFamily.value() }; + std::set uniqueQueueFamilies = { indices.graphics_family.value(), indices.present_family.value() }; float queuePriority = 1.0f; for(std::uint32_t queueFamily : uniqueQueueFamilies) @@ -59,7 +57,7 @@ namespace mlx createInfo.enabledLayerCount = 0; VkResult res; - if((res = vkCreateDevice(_physicalDevice, &createInfo, nullptr, &_device)) != VK_SUCCESS) + if((res = vkCreateDevice(_physical_device, &createInfo, nullptr, &_device)) != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan : failed to create logcal device, %s", RCore::verbaliseResultVk(res)); #ifdef DEBUG core::error::report(e_kind::message, "Vulkan : created new logical device"); @@ -94,16 +92,16 @@ namespace mlx } if(devices_score.rbegin()->first > 0) - _physicalDevice = devices_score.rbegin()->second; + _physical_device = devices_score.rbegin()->second; else core::error::report(e_kind::fatal_error, "Vulkan : failed to find a suitable GPU"); #ifdef DEBUG VkPhysicalDeviceProperties props; - vkGetPhysicalDeviceProperties(_physicalDevice, &props); + vkGetPhysicalDeviceProperties(_physical_device, &props); core::error::report(e_kind::message, "Vulkan : picked a physical device, %s", props.deviceName); #endif - Render_Core::get().getQueue().findQueueFamilies(_physicalDevice, surface); // update queue indicies to current physical device + Render_Core::get().getQueue().findQueueFamilies(_physical_device, surface); // update queue indicies to current physical device vkDestroySurfaceKHR(Render_Core::get().getInstance().get(), surface, nullptr); SDL_DestroyWindow(window); } diff --git a/src/renderer/core/vk_device.h b/src/renderer/core/vk_device.h index ecfd47e..ad7b5ca 100644 --- a/src/renderer/core/vk_device.h +++ b/src/renderer/core/vk_device.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:13:42 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:26:14 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 16:59:54 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,7 +15,6 @@ #include #include -#include "vk_queues.h" namespace mlx { @@ -28,7 +27,7 @@ namespace mlx inline VkDevice& operator()() noexcept { return _device; } inline VkDevice& get() noexcept { return _device; } - inline VkPhysicalDevice& getPhysicalDevice() noexcept { return _physicalDevice; } + inline VkPhysicalDevice& getPhysicalDevice() noexcept { return _physical_device; } private: void pickPhysicalDevice(); @@ -36,7 +35,7 @@ namespace mlx int deviceScore(VkPhysicalDevice device, VkSurfaceKHR surface); private: - VkPhysicalDevice _physicalDevice = VK_NULL_HANDLE; + VkPhysicalDevice _physical_device = VK_NULL_HANDLE; VkDevice _device = VK_NULL_HANDLE; }; } diff --git a/src/renderer/core/vk_queues.cpp b/src/renderer/core/vk_queues.cpp index 89cfb3d..b4f4ba3 100644 --- a/src/renderer/core/vk_queues.cpp +++ b/src/renderer/core/vk_queues.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:02:42 by maldavid #+# #+# */ -/* Updated: 2024/01/10 21:54:54 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:01:10 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -29,13 +29,13 @@ namespace mlx for(const auto& queueFamily : queueFamilies) { if(queueFamily.queueFlags & VK_QUEUE_GRAPHICS_BIT) - _families->graphicsFamily = i; + _families->graphics_family = i; VkBool32 presentSupport = false; vkGetPhysicalDeviceSurfaceSupportKHR(device, i, surface, &presentSupport); if(presentSupport) - _families->presentFamily = i; + _families->present_family = i; if(_families->isComplete()) return *_families; @@ -62,8 +62,8 @@ namespace mlx vkDestroySurfaceKHR(Render_Core::get().getInstance().get(), surface, nullptr); SDL_DestroyWindow(window); } - vkGetDeviceQueue(Render_Core::get().getDevice().get(), _families->graphicsFamily.value(), 0, &_graphicsQueue); - vkGetDeviceQueue(Render_Core::get().getDevice().get(), _families->presentFamily.value(), 0, &_presentQueue); + vkGetDeviceQueue(Render_Core::get().getDevice().get(), _families->graphics_family.value(), 0, &_graphics_queue); + vkGetDeviceQueue(Render_Core::get().getDevice().get(), _families->present_family.value(), 0, &_present_queue); #ifdef DEBUG core::error::report(e_kind::message, "Vulkan : got graphics and present queues"); #endif diff --git a/src/renderer/core/vk_queues.h b/src/renderer/core/vk_queues.h index d3d1c28..2a4a1ba 100644 --- a/src/renderer/core/vk_queues.h +++ b/src/renderer/core/vk_queues.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:01:49 by maldavid #+# #+# */ -/* Updated: 2024/01/08 23:46:23 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:00:48 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,18 +26,18 @@ namespace mlx public: struct QueueFamilyIndices { - std::optional graphicsFamily; - std::optional presentFamily; + std::optional graphics_family; + std::optional present_family; - inline bool isComplete() { return graphicsFamily.has_value() && presentFamily.has_value(); } + inline bool isComplete() { return graphics_family.has_value() && present_family.has_value(); } }; QueueFamilyIndices findQueueFamilies(VkPhysicalDevice device, VkSurfaceKHR surface); void init(); - inline VkQueue& getGraphic() noexcept { return _graphicsQueue; } - inline VkQueue& getPresent() noexcept { return _presentQueue; } + inline VkQueue& getGraphic() noexcept { return _graphics_queue; } + inline VkQueue& getPresent() noexcept { return _present_queue; } inline QueueFamilyIndices getFamilies() noexcept { if(_families.has_value()) @@ -47,8 +47,8 @@ namespace mlx } private: - VkQueue _graphicsQueue; - VkQueue _presentQueue; + VkQueue _graphics_queue; + VkQueue _present_queue; std::optional _families; }; } diff --git a/src/renderer/core/vk_semaphore.cpp b/src/renderer/core/vk_semaphore.cpp index 20f0803..fb8d2ab 100644 --- a/src/renderer/core/vk_semaphore.cpp +++ b/src/renderer/core/vk_semaphore.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:01:08 by maldavid #+# #+# */ -/* Updated: 2024/01/10 21:55:12 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:02:36 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -22,8 +22,8 @@ namespace mlx semaphoreInfo.sType = VK_STRUCTURE_TYPE_SEMAPHORE_CREATE_INFO; 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) + if( (res = vkCreateSemaphore(Render_Core::get().getDevice().get(), &semaphoreInfo, nullptr, &_image_available_semaphore)) != VK_SUCCESS || + (res = vkCreateSemaphore(Render_Core::get().getDevice().get(), &semaphoreInfo, nullptr, &_render_finished_semaphore)) != VK_SUCCESS) 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 semaphores"); @@ -32,10 +32,10 @@ namespace mlx void Semaphore::destroy() noexcept { - vkDestroySemaphore(Render_Core::get().getDevice().get(), _renderFinishedSemaphores, nullptr); - _renderFinishedSemaphores = VK_NULL_HANDLE; - vkDestroySemaphore(Render_Core::get().getDevice().get(), _imageAvailableSemaphores, nullptr); - _imageAvailableSemaphores = VK_NULL_HANDLE; + vkDestroySemaphore(Render_Core::get().getDevice().get(), _render_finished_semaphore, nullptr); + _render_finished_semaphore = VK_NULL_HANDLE; + vkDestroySemaphore(Render_Core::get().getDevice().get(), _image_available_semaphore, nullptr); + _image_available_semaphore = VK_NULL_HANDLE; #ifdef DEBUG core::error::report(e_kind::message, "Vulkan : destroyed semaphores"); #endif diff --git a/src/renderer/core/vk_semaphore.h b/src/renderer/core/vk_semaphore.h index cdcb72d..f17ff9e 100644 --- a/src/renderer/core/vk_semaphore.h +++ b/src/renderer/core/vk_semaphore.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 18:59:38 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:26:39 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:01:57 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,7 +15,6 @@ #include #include -#include namespace mlx { @@ -25,12 +24,12 @@ namespace mlx void init(); void destroy() noexcept; - inline VkSemaphore& getImageSemaphore() noexcept { return _imageAvailableSemaphores; } - inline VkSemaphore& getRenderImageSemaphore() noexcept { return _renderFinishedSemaphores; } + inline VkSemaphore& getImageSemaphore() noexcept { return _image_available_semaphore; } + inline VkSemaphore& getRenderImageSemaphore() noexcept { return _render_finished_semaphore; } private: - VkSemaphore _imageAvailableSemaphores = VK_NULL_HANDLE; - VkSemaphore _renderFinishedSemaphores = VK_NULL_HANDLE; + VkSemaphore _image_available_semaphore = VK_NULL_HANDLE; + VkSemaphore _render_finished_semaphore = VK_NULL_HANDLE; }; } diff --git a/src/renderer/core/vk_validation_layers.cpp b/src/renderer/core/vk_validation_layers.cpp index e19553a..a63b7fb 100644 --- a/src/renderer/core/vk_validation_layers.cpp +++ b/src/renderer/core/vk_validation_layers.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/19 14:05:25 by maldavid #+# #+# */ -/* Updated: 2024/01/10 21:55:54 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:03:24 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,6 @@ #include "vulkan/vulkan_core.h" #include -#include #include #include @@ -45,8 +44,8 @@ namespace mlx core::error::report(e_kind::message, "Vulkan : enabled validation layers"); #endif - real_vkSetDebugUtilsObjectNameEXT = (PFN_vkSetDebugUtilsObjectNameEXT)vkGetInstanceProcAddr(Render_Core::get().getInstance().get(), "vkSetDebugUtilsObjectNameEXT"); - if(!real_vkSetDebugUtilsObjectNameEXT) + _vkSetDebugUtilsObjectNameEXT = (PFN_vkSetDebugUtilsObjectNameEXT)vkGetInstanceProcAddr(Render_Core::get().getInstance().get(), "vkSetDebugUtilsObjectNameEXT"); + if(!_vkSetDebugUtilsObjectNameEXT) core::error::report(e_kind::warning, "Vulkan : failed to set up debug object names, %s", RCore::verbaliseResultVk(VK_ERROR_EXTENSION_NOT_PRESENT)); #ifdef DEBUG else @@ -75,7 +74,7 @@ namespace mlx VkResult ValidationLayers::setDebugUtilsObjectNameEXT(VkObjectType object_type, std::uint64_t object_handle, const char* object_name) { - if(!real_vkSetDebugUtilsObjectNameEXT) + if(!_vkSetDebugUtilsObjectNameEXT) return VK_ERROR_EXTENSION_NOT_PRESENT; VkDebugUtilsObjectNameInfoEXT name_info{}; @@ -83,7 +82,7 @@ namespace mlx name_info.objectType = object_type; name_info.objectHandle = object_handle; name_info.pObjectName = object_name; - return real_vkSetDebugUtilsObjectNameEXT(Render_Core::get().getDevice().get(), &name_info); + return _vkSetDebugUtilsObjectNameEXT(Render_Core::get().getDevice().get(), &name_info); } void ValidationLayers::populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT& createInfo) @@ -109,7 +108,7 @@ namespace mlx VkResult ValidationLayers::createDebugUtilsMessengerEXT(const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo, const VkAllocationCallbacks* pAllocator) { auto func = (PFN_vkCreateDebugUtilsMessengerEXT)vkGetInstanceProcAddr(Render_Core::get().getInstance().get(), "vkCreateDebugUtilsMessengerEXT"); - return func != nullptr ? func(Render_Core::get().getInstance().get(), pCreateInfo, pAllocator, &_debugMessenger) : VK_ERROR_EXTENSION_NOT_PRESENT; + return func != nullptr ? func(Render_Core::get().getInstance().get(), pCreateInfo, pAllocator, &_debug_messenger) : VK_ERROR_EXTENSION_NOT_PRESENT; } VKAPI_ATTR VkBool32 VKAPI_CALL ValidationLayers::debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity, [[maybe_unused]] VkDebugUtilsMessageTypeFlagsEXT messageType, const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData, [[maybe_unused]] void* pUserData) @@ -125,7 +124,7 @@ namespace mlx { auto func = (PFN_vkDestroyDebugUtilsMessengerEXT)vkGetInstanceProcAddr(Render_Core::get().getInstance().get(), "vkDestroyDebugUtilsMessengerEXT"); if(func != nullptr) - func(Render_Core::get().getInstance().get(), _debugMessenger, pAllocator); + func(Render_Core::get().getInstance().get(), _debug_messenger, pAllocator); } } diff --git a/src/renderer/core/vk_validation_layers.h b/src/renderer/core/vk_validation_layers.h index 7247ede..0758669 100644 --- a/src/renderer/core/vk_validation_layers.h +++ b/src/renderer/core/vk_validation_layers.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/19 14:04:25 by maldavid #+# #+# */ -/* Updated: 2024/01/07 00:21:42 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:02:55 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -39,8 +39,8 @@ namespace mlx void destroyDebugUtilsMessengerEXT(const VkAllocationCallbacks* pAllocator); private: - VkDebugUtilsMessengerEXT _debugMessenger; - PFN_vkSetDebugUtilsObjectNameEXT real_vkSetDebugUtilsObjectNameEXT = nullptr; + VkDebugUtilsMessengerEXT _debug_messenger; + PFN_vkSetDebugUtilsObjectNameEXT _vkSetDebugUtilsObjectNameEXT = nullptr; }; } diff --git a/src/renderer/images/texture.cpp b/src/renderer/images/texture.cpp index cded232..9a48307 100644 --- a/src/renderer/images/texture.cpp +++ b/src/renderer/images/texture.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/31 18:03:35 by maldavid #+# #+# */ -/* Updated: 2024/02/24 03:51:59 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 19:07:01 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -20,8 +20,6 @@ #define STB_IMAGE_IMPLEMENTATION #include -#include - #ifdef IMAGE_OPTIMIZED #define TILING VK_IMAGE_TILING_OPTIMAL #else diff --git a/src/renderer/images/texture.h b/src/renderer/images/texture.h index be48db0..77282cf 100644 --- a/src/renderer/images/texture.h +++ b/src/renderer/images/texture.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/03/08 02:24:58 by maldavid #+# #+# */ -/* Updated: 2024/01/11 01:18:25 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 19:06:07 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,15 +14,15 @@ #define __MLX_TEXTURE__ #include -#include #include -#include #include #include #include #include #include -#include +#ifdef DEBUG + #include +#endif namespace mlx { diff --git a/src/renderer/images/texture_atlas.h b/src/renderer/images/texture_atlas.h index 2165879..4a33b1a 100644 --- a/src/renderer/images/texture_atlas.h +++ b/src/renderer/images/texture_atlas.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/07 16:36:33 by maldavid #+# #+# */ -/* Updated: 2024/01/18 02:47:30 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 19:57:55 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -14,7 +14,6 @@ #define __MLX_TEXTURE_ATLAS__ #include -#include #include #include diff --git a/src/renderer/images/texture_manager.h b/src/renderer/images/texture_manager.h index 35707e9..a0b37d5 100644 --- a/src/renderer/images/texture_manager.h +++ b/src/renderer/images/texture_manager.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/01/11 00:56:15 by maldavid #+# #+# */ -/* Updated: 2024/01/11 01:49:12 by maldavid ### ########.fr */ +/* Updated: 2024/03/25 13:53:59 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,6 +26,7 @@ namespace mlx TextureManager() = default; inline void clear() { _texture_descriptors.clear(); } + inline std::pair registerTexture(Texture* texture, int x, int y) { MLX_PROFILE_FUNCTION(); @@ -33,6 +34,29 @@ namespace mlx return std::make_pair(static_cast(&const_cast(*res.first)), res.second); } + inline bool isTextureKnown(Texture* texture) noexcept + { + MLX_PROFILE_FUNCTION(); + for(const auto& desc : _texture_descriptors) + { + if(desc.texture == texture) + return true; + } + return false; + } + + inline void eraseTextures(Texture* texture) + { + MLX_PROFILE_FUNCTION(); + for(auto it = _texture_descriptors.begin(); it != _texture_descriptors.end();) + { + if(it->texture == texture) + it = _texture_descriptors.erase(it); + else + ++it; + } + } + ~TextureManager() = default; private: diff --git a/src/renderer/images/vk_image.cpp b/src/renderer/images/vk_image.cpp index 3eecbf2..ed2549b 100644 --- a/src/renderer/images/vk_image.cpp +++ b/src/renderer/images/vk_image.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/01/25 11:59:07 by maldavid #+# #+# */ -/* Updated: 2024/02/25 08:03:47 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:28:25 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -251,17 +251,12 @@ namespace mlx void Image::destroy() noexcept { - // not creating destroyer in `create` as some image may be copied (and so `this` will be invalid) - //CmdResource::setDestroyer([this]() - //{ - destroySampler(); - destroyImageView(); + destroySampler(); + destroyImageView(); - if(_image != VK_NULL_HANDLE) - Render_Core::get().getAllocator().destroyImage(_allocation, _image); - _image = VK_NULL_HANDLE; - //}); - //CmdResource::requireDestroy(); + if(_image != VK_NULL_HANDLE) + Render_Core::get().getAllocator().destroyImage(_allocation, _image); + _image = VK_NULL_HANDLE; } std::uint32_t formatSize(VkFormat format) diff --git a/src/renderer/pipeline/pipeline.cpp b/src/renderer/pipeline/pipeline.cpp index 00291fc..311d6b2 100644 --- a/src/renderer/pipeline/pipeline.cpp +++ b/src/renderer/pipeline/pipeline.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 21:27:38 by maldavid #+# #+# */ -/* Updated: 2024/01/16 07:45:15 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:05:21 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -286,7 +286,7 @@ namespace mlx pipelineLayoutInfo.pushConstantRangeCount = 1; pipelineLayoutInfo.pPushConstantRanges = &push_constant; - if(vkCreatePipelineLayout(Render_Core::get().getDevice().get(), &pipelineLayoutInfo, nullptr, &_pipelineLayout) != VK_SUCCESS) + if(vkCreatePipelineLayout(Render_Core::get().getDevice().get(), &pipelineLayoutInfo, nullptr, &_pipeline_layout) != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan : failed to create a graphics pipeline layout"); VkGraphicsPipelineCreateInfo pipelineInfo{}; @@ -300,12 +300,12 @@ namespace mlx pipelineInfo.pMultisampleState = &multisampling; pipelineInfo.pColorBlendState = &colorBlending; pipelineInfo.pDynamicState = &dynamicStates; - pipelineInfo.layout = _pipelineLayout; + pipelineInfo.layout = _pipeline_layout; pipelineInfo.renderPass = renderer.getRenderPass().get(); pipelineInfo.subpass = 0; pipelineInfo.basePipelineHandle = VK_NULL_HANDLE; - VkResult res = vkCreateGraphicsPipelines(Render_Core::get().getDevice().get(), VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &_graphicsPipeline); + VkResult res = vkCreateGraphicsPipelines(Render_Core::get().getDevice().get(), VK_NULL_HANDLE, 1, &pipelineInfo, nullptr, &_graphics_pipeline); if(res != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan : failed to create a graphics pipeline, %s", RCore::verbaliseResultVk(res)); #ifdef DEBUG @@ -318,9 +318,9 @@ namespace mlx void GraphicPipeline::destroy() noexcept { - vkDestroyPipeline(Render_Core::get().getDevice().get(), _graphicsPipeline, nullptr); - vkDestroyPipelineLayout(Render_Core::get().getDevice().get(), _pipelineLayout, nullptr); - _graphicsPipeline = VK_NULL_HANDLE; + vkDestroyPipeline(Render_Core::get().getDevice().get(), _graphics_pipeline, nullptr); + vkDestroyPipelineLayout(Render_Core::get().getDevice().get(), _pipeline_layout, nullptr); + _graphics_pipeline = VK_NULL_HANDLE; #ifdef DEBUG core::error::report(e_kind::message, "Vulkan : destroyed a graphics pipeline"); #endif diff --git a/src/renderer/pipeline/pipeline.h b/src/renderer/pipeline/pipeline.h index 517ccb9..9700dc7 100644 --- a/src/renderer/pipeline/pipeline.h +++ b/src/renderer/pipeline/pipeline.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 21:23:52 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:28:13 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:04:28 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -25,15 +25,14 @@ namespace mlx void init(class Renderer& renderer); void destroy() noexcept; - inline void bindPipeline(CmdBuffer& commandBuffer) noexcept { vkCmdBindPipeline(commandBuffer.get(), VK_PIPELINE_BIND_POINT_GRAPHICS, _graphicsPipeline); } + inline void bindPipeline(CmdBuffer& command_buffer) noexcept { vkCmdBindPipeline(command_buffer.get(), VK_PIPELINE_BIND_POINT_GRAPHICS, _graphics_pipeline); } - inline const VkPipeline& getPipeline() const noexcept { return _graphicsPipeline; } - inline const VkPipelineLayout& getPipelineLayout() const noexcept { return _pipelineLayout; } + inline const VkPipeline& getPipeline() const noexcept { return _graphics_pipeline; } + inline const VkPipelineLayout& getPipelineLayout() const noexcept { return _pipeline_layout; } private: - VkPipeline _graphicsPipeline = VK_NULL_HANDLE; - VkPipelineCache _cache = VK_NULL_HANDLE; - VkPipelineLayout _pipelineLayout = VK_NULL_HANDLE; + VkPipeline _graphics_pipeline = VK_NULL_HANDLE; + VkPipelineLayout _pipeline_layout = VK_NULL_HANDLE; }; } diff --git a/src/renderer/renderer.cpp b/src/renderer/renderer.cpp index cfe4d42..c1c2cfe 100644 --- a/src/renderer/renderer.cpp +++ b/src/renderer/renderer.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 17:25:16 by maldavid #+# #+# */ -/* Updated: 2024/02/25 08:02:05 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 16:34:43 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -61,7 +61,7 @@ namespace mlx _pipeline.init(*this); - _framebufferResized = false; + _framebuffer_resized = false; } bool Renderer::beginFrame() @@ -136,9 +136,9 @@ namespace mlx VkResult result = vkQueuePresentKHR(Render_Core::get().getQueue().getPresent(), &presentInfo); - if(result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || _framebufferResized) + if(result == VK_ERROR_OUT_OF_DATE_KHR || result == VK_SUBOPTIMAL_KHR || _framebuffer_resized) { - _framebufferResized = false; + _framebuffer_resized = false; recreateRenderData(); } else if(result != VK_SUCCESS) diff --git a/src/renderer/renderer.h b/src/renderer/renderer.h index 219ff03..a0fc309 100644 --- a/src/renderer/renderer.h +++ b/src/renderer/renderer.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/12/18 17:14:45 by maldavid #+# #+# */ -/* Updated: 2024/01/20 08:18:53 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 16:34:20 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -109,7 +109,7 @@ namespace mlx inline std::uint32_t getActiveImageIndex() noexcept { return _current_frame_index; } inline std::uint32_t getImageIndex() noexcept { return _image_index; } - constexpr inline void requireFrameBufferResize() noexcept { _framebufferResized = true; } + constexpr inline void requireFrameBufferResize() noexcept { _framebuffer_resized = true; } ~Renderer() = default; @@ -138,7 +138,7 @@ namespace mlx std::uint32_t _current_frame_index = 0; std::uint32_t _image_index = 0; - bool _framebufferResized = false; + bool _framebuffer_resized = false; }; } diff --git a/src/renderer/renderpass/vk_render_pass.cpp b/src/renderer/renderpass/vk_render_pass.cpp index 13a9c01..e5c8470 100644 --- a/src/renderer/renderpass/vk_render_pass.cpp +++ b/src/renderer/renderpass/vk_render_pass.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/06 18:21:36 by maldavid #+# #+# */ -/* Updated: 2024/01/16 08:22:39 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:06:01 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -71,7 +71,7 @@ namespace mlx renderPassInfo.dependencyCount = static_cast(subpassesDeps.size()); renderPassInfo.pDependencies = subpassesDeps.data(); - VkResult res = vkCreateRenderPass(Render_Core::get().getDevice().get(), &renderPassInfo, nullptr, &_renderPass); + VkResult res = vkCreateRenderPass(Render_Core::get().getDevice().get(), &renderPassInfo, nullptr, &_render_pass); if(res != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan : failed to create render pass, %s", RCore::verbaliseResultVk(res)); #ifdef DEBUG @@ -87,7 +87,7 @@ namespace mlx VkRenderPassBeginInfo renderPassInfo{}; renderPassInfo.sType = VK_STRUCTURE_TYPE_RENDER_PASS_BEGIN_INFO; - renderPassInfo.renderPass = _renderPass; + renderPassInfo.renderPass = _render_pass; renderPassInfo.framebuffer = fb.get(); renderPassInfo.renderArea.offset = { 0, 0 }; renderPassInfo.renderArea.extent = { fb.getWidth(), fb.getHeight() }; @@ -110,8 +110,8 @@ namespace mlx void RenderPass::destroy() noexcept { - vkDestroyRenderPass(Render_Core::get().getDevice().get(), _renderPass, nullptr); - _renderPass = VK_NULL_HANDLE; + vkDestroyRenderPass(Render_Core::get().getDevice().get(), _render_pass, nullptr); + _render_pass = VK_NULL_HANDLE; #ifdef DEBUG core::error::report(e_kind::message, "Vulkan : destroyed a renderpass"); #endif diff --git a/src/renderer/renderpass/vk_render_pass.h b/src/renderer/renderpass/vk_render_pass.h index 68d190e..a0a7c23 100644 --- a/src/renderer/renderpass/vk_render_pass.h +++ b/src/renderer/renderpass/vk_render_pass.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/06 18:22:00 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:28:25 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:05:40 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,11 +27,11 @@ namespace mlx void begin(class CmdBuffer& cmd, class FrameBuffer& fb); void end(class CmdBuffer& cmd); - inline VkRenderPass& operator()() noexcept { return _renderPass; } - inline VkRenderPass& get() noexcept { return _renderPass; } + inline VkRenderPass& operator()() noexcept { return _render_pass; } + inline VkRenderPass& get() noexcept { return _render_pass; } private: - VkRenderPass _renderPass = VK_NULL_HANDLE; + VkRenderPass _render_pass = VK_NULL_HANDLE; bool _is_running = false; }; } diff --git a/src/renderer/swapchain/vk_swapchain.cpp b/src/renderer/swapchain/vk_swapchain.cpp index b6b65c7..0ce2967 100644 --- a/src/renderer/swapchain/vk_swapchain.cpp +++ b/src/renderer/swapchain/vk_swapchain.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/06 18:22:28 by maldavid #+# #+# */ -/* Updated: 2024/01/03 13:18:25 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:08:19 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -23,18 +23,18 @@ namespace mlx VkDevice device = Render_Core::get().getDevice().get(); _renderer = renderer; - _swapChainSupport = querySwapChainSupport(Render_Core::get().getDevice().getPhysicalDevice()); + _swapchain_support = querySwapChainSupport(Render_Core::get().getDevice().getPhysicalDevice()); - VkSurfaceFormatKHR surfaceFormat = renderer->getSurface().chooseSwapSurfaceFormat(_swapChainSupport.formats); - VkPresentModeKHR presentMode = chooseSwapPresentMode(_swapChainSupport.presentModes); - _extent = chooseSwapExtent(_swapChainSupport.capabilities); + VkSurfaceFormatKHR surfaceFormat = renderer->getSurface().chooseSwapSurfaceFormat(_swapchain_support.formats); + VkPresentModeKHR presentMode = chooseSwapPresentMode(_swapchain_support.present_modes); + _extent = chooseSwapExtent(_swapchain_support.capabilities); - std::uint32_t imageCount = _swapChainSupport.capabilities.minImageCount + 1; - if(_swapChainSupport.capabilities.maxImageCount > 0 && imageCount > _swapChainSupport.capabilities.maxImageCount) - imageCount = _swapChainSupport.capabilities.maxImageCount; + std::uint32_t imageCount = _swapchain_support.capabilities.minImageCount + 1; + if(_swapchain_support.capabilities.maxImageCount > 0 && imageCount > _swapchain_support.capabilities.maxImageCount) + imageCount = _swapchain_support.capabilities.maxImageCount; Queues::QueueFamilyIndices indices = Render_Core::get().getQueue().findQueueFamilies(Render_Core::get().getDevice().getPhysicalDevice(), renderer->getSurface().get()); - std::uint32_t queueFamilyIndices[] = { indices.graphicsFamily.value(), indices.presentFamily.value() }; + std::uint32_t queueFamilyIndices[] = { indices.graphics_family.value(), indices.present_family.value() }; VkSwapchainCreateInfoKHR createInfo{}; createInfo.sType = VK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR; @@ -45,12 +45,12 @@ namespace mlx createInfo.imageExtent = _extent; createInfo.imageArrayLayers = 1; createInfo.imageUsage = VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT; - createInfo.preTransform = _swapChainSupport.capabilities.currentTransform; + createInfo.preTransform = _swapchain_support.capabilities.currentTransform; createInfo.compositeAlpha = VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR; createInfo.presentMode = presentMode; createInfo.clipped = VK_TRUE; createInfo.oldSwapchain = VK_NULL_HANDLE; - if(indices.graphicsFamily != indices.presentFamily) + if(indices.graphics_family != indices.present_family) { createInfo.imageSharingMode = VK_SHARING_MODE_CONCURRENT; createInfo.queueFamilyIndexCount = 2; @@ -59,15 +59,15 @@ namespace mlx else createInfo.imageSharingMode = VK_SHARING_MODE_EXCLUSIVE; - VkResult res = vkCreateSwapchainKHR(device, &createInfo, nullptr, &_swapChain); + VkResult res = vkCreateSwapchainKHR(device, &createInfo, nullptr, &_swapchain); if(res != VK_SUCCESS) core::error::report(e_kind::fatal_error, "Vulkan : failed to create the swapchain, %s", RCore::verbaliseResultVk(res)); std::vector tmp; - vkGetSwapchainImagesKHR(device, _swapChain, &imageCount, nullptr); + vkGetSwapchainImagesKHR(device, _swapchain, &imageCount, nullptr); _images.resize(imageCount); tmp.resize(imageCount); - vkGetSwapchainImagesKHR(device, _swapChain, &imageCount, tmp.data()); + vkGetSwapchainImagesKHR(device, _swapchain, &imageCount, tmp.data()); for(std::size_t i = 0; i < imageCount; i++) { @@ -76,7 +76,7 @@ namespace mlx _images[i].createImageView(VK_IMAGE_VIEW_TYPE_2D, VK_IMAGE_ASPECT_COLOR_BIT); } - _swapChainImageFormat = surfaceFormat.format; + _swapchain_image_format = surfaceFormat.format; #ifdef DEBUG core::error::report(e_kind::message, "Vulkan : created new swapchain"); #endif @@ -104,8 +104,8 @@ namespace mlx if(presentModeCount != 0) { - details.presentModes.resize(presentModeCount); - vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &presentModeCount, details.presentModes.data()); + details.present_modes.resize(presentModeCount); + vkGetPhysicalDeviceSurfacePresentModesKHR(device, surface, &presentModeCount, details.present_modes.data()); } return details; @@ -141,11 +141,11 @@ namespace mlx void SwapChain::destroy() noexcept { - if(_swapChain == VK_NULL_HANDLE) + if(_swapchain == VK_NULL_HANDLE) return; vkDeviceWaitIdle(Render_Core::get().getDevice().get()); - vkDestroySwapchainKHR(Render_Core::get().getDevice().get(), _swapChain, nullptr); - _swapChain = VK_NULL_HANDLE; + vkDestroySwapchainKHR(Render_Core::get().getDevice().get(), _swapchain, nullptr); + _swapchain = VK_NULL_HANDLE; for(Image& img : _images) img.destroyImageView(); } diff --git a/src/renderer/swapchain/vk_swapchain.h b/src/renderer/swapchain/vk_swapchain.h index 998ae78..81ff0f4 100644 --- a/src/renderer/swapchain/vk_swapchain.h +++ b/src/renderer/swapchain/vk_swapchain.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/06 18:23:27 by maldavid #+# #+# */ -/* Updated: 2024/01/03 15:28:39 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:06:41 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -31,7 +31,7 @@ namespace mlx { VkSurfaceCapabilitiesKHR capabilities; std::vector formats; - std::vector presentModes; + std::vector present_modes; }; public: @@ -45,21 +45,21 @@ namespace mlx VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities); VkPresentModeKHR chooseSwapPresentMode([[maybe_unused]] const std::vector &availablePresentModes); - inline VkSwapchainKHR get() noexcept { return _swapChain; } - inline VkSwapchainKHR operator()() noexcept { return _swapChain; } + inline VkSwapchainKHR get() noexcept { return _swapchain; } + inline VkSwapchainKHR operator()() noexcept { return _swapchain; } inline std::size_t getImagesNumber() const noexcept { return _images.size(); } inline Image& getImage(std::size_t i) noexcept { return _images[i]; } - inline SwapChainSupportDetails getSupport() noexcept { return _swapChainSupport; } + inline SwapChainSupportDetails getSupport() noexcept { return _swapchain_support; } inline VkExtent2D getExtent() noexcept { return _extent; } - inline VkFormat getImagesFormat() const noexcept { return _swapChainImageFormat; } + inline VkFormat getImagesFormat() const noexcept { return _swapchain_image_format; } ~SwapChain() = default; private: - SwapChainSupportDetails _swapChainSupport; - VkSwapchainKHR _swapChain; + SwapChainSupportDetails _swapchain_support; + VkSwapchainKHR _swapchain; std::vector _images; - VkFormat _swapChainImageFormat; + VkFormat _swapchain_image_format; VkExtent2D _extent; class Renderer* _renderer = nullptr; }; diff --git a/src/renderer/texts/text_library.cpp b/src/renderer/texts/text_library.cpp index 1bb022d..a7d34cf 100644 --- a/src/renderer/texts/text_library.cpp +++ b/src/renderer/texts/text_library.cpp @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/10 11:59:57 by maldavid #+# #+# */ -/* Updated: 2024/02/25 09:29:31 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:31:55 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -61,6 +61,6 @@ namespace mlx text->destroy(); _invalid_ids.push_back(id); } - // do not `_cache.clear();` as it releases the texts and may not destroy Vertex and Index buffers that are in use by command buffers + _cache.clear(); } } diff --git a/src/renderer/texts/text_manager.h b/src/renderer/texts/text_manager.h index 4a3c998..140e87d 100644 --- a/src/renderer/texts/text_manager.h +++ b/src/renderer/texts/text_manager.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/04/06 16:24:11 by maldavid #+# #+# */ -/* Updated: 2024/02/25 07:58:36 by maldavid ### ########.fr */ +/* Updated: 2024/03/14 17:08:43 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,12 +19,10 @@ #include #include #include -#include #include #include #include #include -#include namespace mlx { diff --git a/src/utils/non_copyable.h b/src/utils/non_copyable.h index f805a99..abc402a 100644 --- a/src/utils/non_copyable.h +++ b/src/utils/non_copyable.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:20:13 by maldavid #+# #+# */ -/* Updated: 2022/10/08 19:21:22 by maldavid ### ########.fr */ +/* Updated: 2024/03/24 14:42:48 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,17 +15,17 @@ namespace mlx { - class non_copyable + class NonCopyable { protected: - non_copyable() = default; - virtual ~non_copyable() = default; + NonCopyable() = default; + virtual ~NonCopyable() = default; public: - non_copyable(const non_copyable&) = delete; - non_copyable(non_copyable&&) noexcept = default; - non_copyable &operator=(const non_copyable&) = delete; - non_copyable &operator=(non_copyable&&) noexcept = default; + NonCopyable(const NonCopyable&) = delete; + NonCopyable(NonCopyable&&) noexcept = default; + NonCopyable &operator=(const NonCopyable&) = delete; + NonCopyable &operator=(NonCopyable&&) noexcept = default; }; } diff --git a/src/utils/singleton.h b/src/utils/singleton.h index 3cb925e..ae8246e 100644 --- a/src/utils/singleton.h +++ b/src/utils/singleton.h @@ -6,7 +6,7 @@ /* By: maldavid +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/10/08 19:18:46 by maldavid #+# #+# */ -/* Updated: 2022/10/08 19:22:07 by maldavid ### ########.fr */ +/* Updated: 2024/03/24 14:42:56 by maldavid ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,7 +18,7 @@ namespace mlx { template - class Singleton : public non_copyable + class Singleton : public NonCopyable { public: inline static T& get()