fix debug callback segfaulting in some situations
This commit is contained in:
parent
b0d96f26fe
commit
6c081177ac
@ -15,8 +15,14 @@ DebugCallback(
|
|||||||
{
|
{
|
||||||
string ms, mt;
|
string ms, mt;
|
||||||
|
|
||||||
|
if (callback_data.pMessage != null)
|
||||||
|
{
|
||||||
const(char)[] msg = callback_data.pMessage[0 .. strlen(callback_data.pMessage)];
|
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) {
|
switch (message_severity) {
|
||||||
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
|
case VK_DEBUG_UTILS_MESSAGE_SEVERITY_VERBOSE_BIT_EXT:
|
||||||
@ -69,7 +75,8 @@ DebugCallback(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
writefln("[%s: %s]\n%r\n", ms, mt, msg);
|
writefln("[%s: %s]\n%r 12345", ms, mt, msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return VK_FALSE;
|
return VK_FALSE;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user