mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-23 12:32:34 +00:00
- add vk_debug_callstack for getting the location where a vulkan warning or error happens
This commit is contained in:
parent
5f26cda27e
commit
7a5ee7b6de
1 changed files with 11 additions and 0 deletions
|
@ -47,6 +47,8 @@
|
||||||
bool I_GetVulkanPlatformExtensions(unsigned int *count, const char **names);
|
bool I_GetVulkanPlatformExtensions(unsigned int *count, const char **names);
|
||||||
bool I_CreateVulkanSurface(VkInstance instance, VkSurfaceKHR *surface);
|
bool I_CreateVulkanSurface(VkInstance instance, VkSurfaceKHR *surface);
|
||||||
|
|
||||||
|
FString JitCaptureStackTrace(int framesToSkip, bool includeNativeFrames);
|
||||||
|
|
||||||
// Physical device info
|
// Physical device info
|
||||||
static std::vector<VulkanPhysicalDevice> AvailableDevices;
|
static std::vector<VulkanPhysicalDevice> AvailableDevices;
|
||||||
static std::vector<VulkanCompatibleDevice> SupportedDevices;
|
static std::vector<VulkanCompatibleDevice> SupportedDevices;
|
||||||
|
@ -56,6 +58,8 @@ CUSTOM_CVAR(Bool, vk_debug, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINI
|
||||||
Printf("This won't take effect until " GAMENAME " is restarted.\n");
|
Printf("This won't take effect until " GAMENAME " is restarted.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CVAR(Bool, vk_debug_callstack, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
|
||||||
|
|
||||||
CUSTOM_CVAR(Int, vk_device, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
CUSTOM_CVAR(Int, vk_device, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
|
||||||
{
|
{
|
||||||
Printf("This won't take effect until " GAMENAME " is restarted.\n");
|
Printf("This won't take effect until " GAMENAME " is restarted.\n");
|
||||||
|
@ -398,6 +402,13 @@ VkBool32 VulkanDevice::DebugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT mess
|
||||||
Printf("\n");
|
Printf("\n");
|
||||||
Printf(TEXTCOLOR_RED "[%s] ", typestr);
|
Printf(TEXTCOLOR_RED "[%s] ", typestr);
|
||||||
Printf(TEXTCOLOR_WHITE "%s\n", msg.GetChars());
|
Printf(TEXTCOLOR_WHITE "%s\n", msg.GetChars());
|
||||||
|
|
||||||
|
if (vk_debug_callstack)
|
||||||
|
{
|
||||||
|
FString callstack = JitCaptureStackTrace(0, true);
|
||||||
|
if (!callstack.IsEmpty())
|
||||||
|
Printf("%s\n", callstack.GetChars());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue