vkEnumerateDeviceExtensionProperties抛出神秘错误代码

时间:2019-02-12 01:58:38

标签: c++ graphics gpu vulkan

我正在遵循此vulkan tutorial并到达交换链部分。

我复制粘贴了有关修改checkDeviceExtensionProperties的部分,这为我提供了此功能:

//globally declared at the top of the file
const std::vector<const char*> deviceExtensions = {
    VK_KHR_SWAPCHAIN_EXTENSION_NAME
}; 

/* code */

bool checkDeviceExtensionSupport(VkPhysicalDevice pDevice) {
    uint32_t extensionCount;
    vkEnumerateDeviceExtensionProperties(pDevice, nullptr, &extensionCount, nullptr);

    std::vector<VkExtensionProperties> availableExtensions(extensionCount);
    vkEnumerateDeviceExtensionProperties(pDevice, nullptr, &extensionCount, availableExtensions.data());

   /* std::set<std::string> requiredExtensions(deviceExtensions.begin(), deviceExtensions.end());

    for (const auto& extension : availableExtensions) {
        requiredExtensions.erase(extension.extensionName);
    }*/

    return true;//requiredExtensions.empty();
}

取消注释函数vkEnumerateDeviceExtensionProperties时,将引发错误。

调试回调返回的错误代码(即VkDebugUtilsMessageSeverityFlagBitsEXT的位)为0b10000。 vulkan_core.h中没有定义的位。

关于我可能会搞砸的任何建议吗?

编辑:

调试消息的输出为:

[...]
validation layer: Device Extension: VK_KHR_device_group (libGLX_nvidia.so.0) version 0.0.3
Loader Message
16
validation layer: Device Extension: VK_KHR_draw_indirect_count (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_driver_properties (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_external_fence (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_external_fence_fd (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_external_memory (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_external_memory_fd (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_external_semaphore (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_external_semaphore_fd (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_get_memory_requirements2 (libGLX_nvidia.so.0) version 0.0.1
Loader Message
16
validation layer: Device Extension: VK_KHR_image_format_list (libGLX_nvidia.so.0) version 0.0.1
[...]

调试回调为:

static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(
    VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
    VkDebugUtilsMessageTypeFlagsEXT messageType,
    const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
    void* pUserData) {

    std::cerr << "validation layer: " << pCallbackData->pMessage << std::endl;
    cout << pCallbackData->pMessageIdName << endl;
    cout << messageSeverity << endl;

    if (messageSeverity >= VK_DEBUG_UTILS_MESSAGE_SEVERITY_WARNING_BIT_EXT) {
        // Message is important enough to show
    }


    return VK_FALSE;
}

1 个答案:

答案 0 :(得分:2)

library(tidyverse) library(tidytext) library(twitteR) # FUNCTION ---------- searchtwitterlastweek_ft <- function(topic, sinceID){ today <- as.character(Sys.Date()) lastweek <- as.character(Sys.Date() - 6) searchtwitterfortopic <- searchTwitteR(topic, n = 15000, since = lastweek, until = today, sinceID = sinceID) if(!length(searchtwitterfortopic) == 0){ twListToDF(searchtwitterfortopic) } else { data.frame(list()) } } # LOAD DATASET FROM PREVIOUS WEEKS --------- load("DATA/rstats.Rda") df_r <- df_r %>% arrange(desc(id)) # figure out last ID, i.e. last tweet on subject lastid <- first(df_r$id) df_temporary <- searchtwitterlastweek_ft("#rstats", lastid) df_r <- rbind(df_r, df_temporary) %>% arrange(desc(id)) 0b10000。使用VK_DEBUG_UTILS_MESSAGE_SEVERITY_INFO_BIT_EXT创建回调时,只需过滤INFO条消息即可。