vkCreateDebugReportCallbackback EXT未链接,但vulkan.h中的所有其他功能均正常运行 [英] vkCreateDebugReportCallback EXT not linking, but every other functions in vulkan.h works perfectly

查看:148
本文介绍了vkCreateDebugReportCallbackback EXT未链接,但vulkan.h中的所有其他功能均正常运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以最近我一直在尝试学习Vulkan,并且在尝试使验证层正常工作时,出现错误LNK2019:

1>Renderer.obj : error LNK2019: unresolved external symbol vkCreateDebugReportCallbackEXT referenced in function "private: void __cdecl Renderer::_InitDebug(void)" (?_InitDebug@Renderer@@AEAAXXZ)

现在奇怪的是vulkan.h中的所有其他功能都能正常工作.

我链接了vulkan-1.lib,并且运行vulkan的AMD实现.该库来自Vulkan SDK.

解决方案

debug_report_ext中的调试功能不属于Vulkan核心.您需要在确保确实支持实例之后,通过vkGetInstanceProcAddr从实例动态加载它们:

PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback = VK_NULL_HANDLE;
CreateDebugReportCallback = (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT");

有关详细信息,请参见我的Vulkan调试助手单元. /p>

So I have been trying to learn Vulkan lately, and while trying to get the validation layers to work, I got error LNK2019:

1>Renderer.obj : error LNK2019: unresolved external symbol vkCreateDebugReportCallbackEXT referenced in function "private: void __cdecl Renderer::_InitDebug(void)" (?_InitDebug@Renderer@@AEAAXXZ)

Now the odd thing is that every other function in vulkan.h works perfectly.

I have vulkan-1.lib linked, and I run the AMD implementation of vulkan. The library is from the Vulkan SDK.

解决方案

The debugging functions from debug_report_ext are not part of the Vulkan core. You need to dynamically load them from the instance via vkGetInstanceProcAddr after making sure that it's actually supported:

PFN_vkCreateDebugReportCallbackEXT CreateDebugReportCallback = VK_NULL_HANDLE;
CreateDebugReportCallback = (PFN_vkCreateDebugReportCallbackEXT)vkGetInstanceProcAddr(instance, "vkCreateDebugReportCallbackEXT");

See my Vulkan debugging helper unit for details.

这篇关于vkCreateDebugReportCallbackback EXT未链接,但vulkan.h中的所有其他功能均正常运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆