问题
Some of the symbols declared in the vulkan headers (/usr/include/vulkan/*
) are not defined in the vulkan library (libvulkan.so.1.1.82
). (I'm on Ubuntu 18.04 using the standard vulkan packages, libvulkan1
and libvulkan-dev
)
For example:
vkCreateInstance
is declared in the vulkan headers, and defined in the vulkan libraryvkCmdBeginConditionalRenderingEXT
is declared in the vulkan headers, but is not defined in the vulkan library.
Why is that?
$ cat > t.cc
#include <vulkan/vulkan.h>
int main() {
{ constexpr auto x = vkCmdBeginConditionalRenderingEXT; (void)x; }
}
^D
$ g++ t.cc -lvulkan
/tmp/cczuSwiY.o: In function `main':
t.cc:(.text+0x7): undefined reference to `vkCmdBeginConditionalRenderingEXT'
collect2: error: ld returned 1 exit status
The full list of such missing commands is: vkCmdBeginConditionalRenderingEXT, vkCmdBeginDebugUtilsLabelEXT, vkCmdBeginRenderPass2KHR, vkCmdDebugMarkerBeginEXT, vkCmdDebugMarkerEndEXT, vkCmdDebugMarkerInsertEXT, vkCmdDrawIndexedIndirectCountAMD, vkCmdDrawIndexedIndirectCountKHR, vkCmdDrawIndirectCountAMD, vkCmdDrawIndirectCountKHR, vkCmdEndConditionalRenderingEXT, vkCmdEndDebugUtilsLabelEXT, vkCmdEndRenderPass2KHR, vkCmdInsertDebugUtilsLabelEXT, vkCmdNextSubpass2KHR, vkCmdProcessCommandsNVX, vkCmdPushDescriptorSetKHR, vkCmdPushDescriptorSetWithTemplateKHR, vkCmdReserveSpaceForCommandsNVX, vkCmdSetCheckpointNV, vkCmdSetDiscardRectangleEXT, vkCmdSetSampleLocationsEXT, vkCmdSetViewportWScalingNV, vkCmdWriteBufferMarkerAMD, vkCreateDebugReportCallbackEXT, vkCreateDebugUtilsMessengerEXT, vkCreateIndirectCommandsLayoutNVX, vkCreateObjectTableNVX, vkCreateRenderPass2KHR, vkCreateValidationCacheEXT, vkDebugMarkerSetObjectNameEXT, vkDebugMarkerSetObjectTagEXT, vkDebugReportMessageEXT, vkDestroyDebugReportCallbackEXT, vkDestroyDebugUtilsMessengerEXT, vkDestroyIndirectCommandsLayoutNVX, vkDestroyObjectTableNVX, vkDestroyValidationCacheEXT, vkDisplayPowerControlEXT, vkGetFenceFdKHR, vkGetMemoryFdKHR, vkGetMemoryFdPropertiesKHR, vkGetMemoryHostPointerPropertiesEXT, vkGetPastPresentationTimingGOOGLE, vkGetPhysicalDeviceExternalImageFormatPropertiesNV, vkGetPhysicalDeviceGeneratedCommandsPropertiesNVX, vkGetPhysicalDeviceMultisamplePropertiesEXT, vkGetPhysicalDeviceSurfaceCapabilities2EXT, vkGetPhysicalDeviceSurfaceCapabilities2KHR, vkGetPhysicalDeviceSurfaceFormats2KHR, vkGetQueueCheckpointDataNV, vkGetRefreshCycleDurationGOOGLE, vkGetSemaphoreFdKHR, vkGetShaderInfoAMD, vkGetSwapchainCounterEXT, vkGetSwapchainStatusKHR, vkGetValidationCacheDataEXT, vkImportFenceFdKHR, vkImportSemaphoreFdKHR, vkMergeValidationCachesEXT, vkQueueBeginDebugUtilsLabelEXT, vkQueueEndDebugUtilsLabelEXT, vkQueueInsertDebugUtilsLabelEXT, vkRegisterDeviceEventEXT, vkRegisterDisplayEventEXT, vkRegisterObjectsNVX, vkReleaseDisplayEXT, vkSetDebugUtilsObjectNameEXT, vkSetDebugUtilsObjectTagEXT, vkSetHdrMetadataEXT, vkSubmitDebugUtilsMessageEXT, vkUnregisterObjectsNVX.
回答1:
Per LoaderAndLayerInterface.md:
The loader library on Windows, Linux, Android and MacOS will export all core Vulkan and all appropriate Window System Interface (WSI) extensions.
That implies it may\does not export non-core non-"appropriate"-WSI commands.
来源:https://stackoverflow.com/questions/53463410/missing-vulkan-symbols-from-standard-linux-vulkan-library