fix debug callback segfaulting in some situations

This commit is contained in:
Matthew 2025-08-24 18:08:22 +10:00
parent b0d96f26fe
commit 6c081177ac

View File

@ -15,8 +15,14 @@ DebugCallback(
{
string ms, mt;
if (callback_data.pMessage != null)
{
const(char)[] msg = callback_data.pMessage[0 .. strlen(callback_data.pMessage)];
bool debug_printf = strcmp(callback_data.pMessageIdName, "WARNING-DEBUG-PRINTF") == 0;
bool debug_printf = false;
if (callback_data.pMessageIdName != null)
{
debug_printf = (strcmp(callback_data.pMessageIdName, "WARNING-DEBUG-PRINTF") == 0);
}
switch (message_severity) {
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
@ -69,7 +75,8 @@ DebugCallback(
}
else
{
writefln("[%s: %s]\n%r\n", ms, mt, msg);
writefln("[%s: %s]\n%r 12345", ms, mt, msg);
}
}
return VK_FALSE;