From 108ed377f2e13b4121160be745b9ea69d7e0f944 Mon Sep 17 00:00:00 2001 From: David Gonzalez Martin Date: Sat, 30 Nov 2024 05:18:15 -0600 Subject: [PATCH] Minor conveniences --- bootstrap/std/render.c | 12 +++++++----- project.sh | 3 +++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bootstrap/std/render.c b/bootstrap/std/render.c index 8da3dbb..931fd0b 100644 --- a/bootstrap/std/render.c +++ b/bootstrap/std/render.c @@ -171,14 +171,18 @@ fn String message_type_to_string(VkDebugUtilsMessageTypeFlagBitsEXT message_type fn VkBool32 VKAPI_CALL debug_callback(VkDebugUtilsMessageSeverityFlagBitsEXT message_severity, VkDebugUtilsMessageTypeFlagsEXT message_type, const VkDebugUtilsMessengerCallbackDataEXT* callback_data, void* user_data) { - unused(message_severity); - unused(message_type); unused(user_data); - print("Validation message ({s}) ({s}) ({cstr}): {cstr}\n", message_severity_to_string(message_severity), message_type_to_string(message_type), callback_data->pMessageIdName ? callback_data->pMessageIdName : "ID_NONE", callback_data->pMessage ? callback_data->pMessage : "MESSAGE_NONE"); + + if (callback_data->pMessage) + { + print("Validation message ({s}) ({s}) ({cstr}): {cstr}\n", message_severity_to_string(message_severity), message_type_to_string(message_type), callback_data->pMessageIdName ? callback_data->pMessageIdName : "ID_NONE", callback_data->pMessage); + } + if (message_severity & VK_DEBUG_UTILS_MESSAGE_SEVERITY_ERROR_BIT_EXT) { failed_execution(); } + return VK_FALSE; } @@ -2008,5 +2012,3 @@ void window_draw_indexed(RenderWindow* window, u32 index_count, u32 instance_cou auto* frame = window_frame(window); vkCmdDrawIndexed(frame->command_buffer, index_count, instance_count, first_index, vertex_offset, first_instance); } - - diff --git a/project.sh b/project.sh index 713bfc8..e5e85be 100755 --- a/project.sh +++ b/project.sh @@ -95,6 +95,7 @@ cmake . \ -DCMAKE_C_COMPILER=$C_COMPILER_PATH \ -DCMAKE_CXX_COMPILER=$CXX_COMPILER_PATH \ -DCMAKE_ASM_COMPILER=$ASM_COMPILER_PATH \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCOMPILER_NAME=$COMPILER_NAME \ -DBB_DIR=$BB_DIR \ -DBB_IS_CI=$BB_IS_CI \ @@ -105,6 +106,8 @@ cmake . \ cd $BUILD_DIR ninja -v +cd $ORIGINAL_DIR/build +ln -s $BUILD_DIR/compile_commands.json . || true cd $ORIGINAL_DIR if [ "$#" -ne 0 ]; then