0

After enabling VUlkan 1.3's DynamicRendering feature via the following tutorial: https://lesleylai.info/en/vk-khr-dynamic-rendering/

I've been getting LINK errors for only the following two functions in VS2022 Preview:

1>------ Build started: Project: MiniVulkan, Configuration: Debug x64 ------
1>Source.cpp
1>LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>Source.obj : error LNK2019: unresolved external symbol vkCmdBeginRenderingKHR referenced in function "public: void __cdecl minivulkan::MiniVkDynamicPipeline<struct minivulkan::MiniVkVertex,struct minivulkan::MiniVkUniform>::BeginRecordCommandBuffer(struct VkCommandBuffer_T *,union VkClearValue,struct VkImageView_T *,struct VkExtent2D)" (?BeginRecordCommandBuffer@?$MiniVkDynamicPipeline@UMiniVkVertex@minivulkan@@UMiniVkUniform@2@@minivulkan@@QEAAXPEAUVkCommandBuffer_T@@TVkClearValue@@PEAUVkImageView_T@@UVkExtent2D@@@Z)
1>Source.obj : error LNK2019: unresolved external symbol vkCmdEndRenderingKHR referenced in function "public: void __cdecl minivulkan::MiniVkDynamicPipeline<struct minivulkan::MiniVkVertex,struct minivulkan::MiniVkUniform>::EndRecordCommandBuffer(struct VkCommandBuffer_T *)" (?EndRecordCommandBuffer@?$MiniVkDynamicPipeline@UMiniVkVertex@minivulkan@@UMiniVkUniform@2@@minivulkan@@QEAAXPEAUVkCommandBuffer_T@@@Z)
1>D:\Programming\MiniVulkanDy\x64\Debug\MiniVulkan.exe : fatal error LNK1120: 2 unresolved externals
1>Done building project "MiniVulkan.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I'm using the following VkDevice render extensions:

VK_KHR_CREATE_RENDERPASS_2_EXTENSION_NAME // Dynamic Rendering Dependency
VK_KHR_DEPTH_STENCIL_RESOLVE_EXTENSION_NAME // Dynamic Rendering Dependency
VK_KHR_DYNAMIC_RENDERING_EXTENSION_NAME

And the following VkInstance extension:

VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME // Dynamic Rendering Dependency

What would cause link errors for just these two functions if the rest of Vulkan 1.3 works and is linked properly and dynamic rendering is part of the API?

This question was closed as duplicate, but this is SPECIFICALLY Vulkan API question with poor documentation on the Dynamic Rendering feature and how to properly enable it. This isn't a linker API issue, despite it showing up as such as the entire Vulkan SDK binaries have been linked, hence why I'm not receiving any other Vulkan errors. There's no separate Dynamic Rendering library in Vulkan for Dynamic Rendering, it's toggle on/off extension included in the Vulkan 1.3 SDK binaries.

FatalSleep
  • 307
  • 1
  • 2
  • 15
  • 1
    Do you check if the extension is present in the device extensions when calling `vkEnumerateDeviceExtensionProperties`? Do you load the functions via `vkGetDeviceProcAddr` or are you trying to use them directly from the header? In the [documentation](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VK_KHR_dynamic_rendering.html) it is stated that `Functionality in this extension is included in core Vulkan 1.3, with the KHR suffix omitted`, as seen in [vkCmdBeginRendering](https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/vkCmdBeginRenderingKHR.html) – vikAy Sep 11 '22 at 23:59
  • @vikAy I did not see that section about omitting the KHR suffix, that did the trick! I was using the functions directly from the header and not loading their entrypoints. I'll try that as well. – FatalSleep Sep 12 '22 at 01:53

0 Answers0