adding nesting to debug logs

This commit is contained in:
2024-11-05 12:49:21 +01:00
parent 4ae7bd0420
commit eaf5be3061
16 changed files with 42 additions and 9 deletions

View File

@@ -133,15 +133,19 @@ namespace mlx
DebugLog("Vulkan: framebuffer destroyed");
}
m_framebuffers.clear();
kvfDestroyPipelineLayout(RenderCore::Get().GetDevice(), m_pipeline_layout);
m_pipeline_layout = VK_NULL_HANDLE;
DebugLog("Vulkan: graphics pipeline layout destroyed");
kvfDestroyRenderPass(RenderCore::Get().GetDevice(), m_renderpass);
m_renderpass = VK_NULL_HANDLE;
DebugLog("Vulkan: renderpass destroyed");
kvfDestroyPipeline(RenderCore::Get().GetDevice(), m_pipeline);
m_pipeline = VK_NULL_HANDLE;
DebugLog("Vulkan: graphics pipeline destroyed");
p_renderer = nullptr;
m_clears.clear();
m_attachments.clear();

View File

@@ -56,6 +56,7 @@ namespace mlx
return;
s_instance = this;
Logs::BeginSection();
loader = std::make_unique<VulkanLoader>();
LoadKVFGlobalVulkanFunctionPointers();
@@ -79,6 +80,7 @@ namespace mlx
VkSurfaceKHR surface = window.CreateVulkanSurface(m_instance);
Logs::BeginSection();
m_physical_device = kvfPickGoodDefaultPhysicalDevice(m_instance, surface);
// just for style
@@ -94,10 +96,12 @@ namespace mlx
loader->LoadDevice(m_device);
LoadKVFDeviceVulkanFunctionPointers();
Logs::EndSection();
vkDestroySurfaceKHR(m_instance, surface, nullptr);
m_allocator.Init();
Logs::EndSection();
}
#undef MLX_LOAD_FUNCTION

View File

@@ -28,7 +28,7 @@ namespace mlx
}, { ShaderPushConstantLayout({ 0, sizeof(SpriteData) }) }
);
std::vector<std::uint8_t> vertex_shader_code = {
#include <Embedded/2DVertex.spv.h>
#include <Embedded/Shader2DVertex.spv.h>
};
p_vertex_shader = std::make_shared<Shader>(vertex_shader_code, ShaderType::Vertex, std::move(vertex_shader_layout));
ShaderLayout fragment_shader_layout(
@@ -41,7 +41,7 @@ namespace mlx
}, {}
);
std::vector<std::uint8_t> fragment_shader_code = {
#include <Embedded/2DFragment.spv.h>
#include <Embedded/Shader2DFragment.spv.h>
};
p_fragment_shader = std::make_shared<Shader>(fragment_shader_code, ShaderType::Fragment, std::move(fragment_shader_layout));

View File

@@ -14,7 +14,7 @@ namespace mlx
{}, {}
);
std::vector<std::uint8_t> vertex_shader_code = {
#include <Embedded/ScreenVertex.spv.h>
#include <Embedded/ShaderScreenVertex.spv.h>
};
p_vertex_shader = std::make_shared<Shader>(vertex_shader_code, ShaderType::Vertex, std::move(vertex_shader_layout));
ShaderLayout fragment_shader_layout(
@@ -27,7 +27,7 @@ namespace mlx
}, {}
);
std::vector<std::uint8_t> fragment_shader_code = {
#include <Embedded/ScreenFragment.spv.h>
#include <Embedded/ShaderScreenFragment.spv.h>
};
p_fragment_shader = std::make_shared<Shader>(fragment_shader_code, ShaderType::Fragment, std::move(fragment_shader_layout));