Newer version of the vulkan SDK does not use pipes in the debug message output anymore
This commit is contained in:
parent
8a8764991a
commit
045deae316
1 changed files with 25 additions and 1 deletions
|
|
@ -366,7 +366,7 @@ VkBool32 VulkanInstance::DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT me
|
|||
|
||||
// Attempt to parse the string because the default formatting is totally unreadable and half of what it writes is totally useless!
|
||||
auto parts = SplitString(msg, " | ");
|
||||
if (parts.size() == 3)
|
||||
if (parts.size() == 3) // Old version of the SDK uses pipes
|
||||
{
|
||||
msg = parts[2];
|
||||
size_t pos = msg.find("The Vulkan spec states:");
|
||||
|
|
@ -391,6 +391,30 @@ VkBool32 VulkanInstance::DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT me
|
|||
msg += ")";
|
||||
}
|
||||
}
|
||||
else if (parts.size() == 1) // Newer version does not
|
||||
{
|
||||
size_t pos = msg.find("The Vulkan spec states:");
|
||||
if (pos != std::string::npos)
|
||||
msg = msg.substr(0, pos);
|
||||
|
||||
while (!msg.empty() && (msg.back() == '\n' || msg.back() == '\r' || msg.back() == ' '))
|
||||
msg.pop_back();
|
||||
|
||||
if (callbackData->objectCount > 0)
|
||||
{
|
||||
msg += " (";
|
||||
for (uint32_t i = 0; i < callbackData->objectCount; i++)
|
||||
{
|
||||
if (i > 0)
|
||||
msg += ", ";
|
||||
if (callbackData->pObjects[i].pObjectName)
|
||||
msg += callbackData->pObjects[i].pObjectName;
|
||||
else
|
||||
msg += "<noname>";
|
||||
}
|
||||
msg += ")";
|
||||
}
|
||||
}
|
||||
|
||||
bool found = seenMessages.find(msg) != seenMessages.end();
|
||||
if (!found)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue