gpt4 book ai didi

c++ - 找不到一些 lunar SDK 验证层

转载 作者:塔克拉玛干 更新时间:2023-11-03 01:54:46 25 4
gpt4 key购买 nike

我正在手动检查由 VK_LAYER_LUNARG_standard_validation 包裹的底层

已找到包装器,但它应该根据 documentation 包装一些验证层不是。

我正在这样查询图层:

const std::vector<const char*> validationLayers =
{
"VK_LAYER_GOOGLE_threading",
"VK_LAYER_LUNARG_parameter_validation",
"VK_LAYER_LUNARG_device_limits",
"VK_LAYER_LUNARG_object_tracker",
"VK_LAYER_LUNARG_image",
"VK_LAYER_LUNARG_core_validation",
"VK_LAYER_LUNARG_swapchain",
"VK_LAYER_GOOGLE_unique_objects",
};

void PrintLayerStatus(VkLayerProperties layer_info, string layer_name, bool layer_found)
{
string major = to_string(VK_VERSION_MAJOR(layer_info.specVersion));
string minor = to_string(VK_VERSION_MINOR(layer_info.specVersion));
string patch = to_string(VK_VERSION_PATCH(layer_info.specVersion));
string version = major + "." + minor + "." + patch;

string mark = (layer_found) ? string(CHECK) : string(CROSS);
RecordLog("\n" + string(layer_name) + ", "
"Vulkan version " + version + ", "
+ "layer version " + to_string(layer_info.implementationVersion),
"[" + mark + "]", 77, '.');
if(layer_found) RecordLog("\tDescription:", string(layer_info.description), 20);
}

// Find available validation layers
bool CheckValidationLayerSupport()
{
// Query validation layers currently isntalled
uint32_t layerCount;
vkEnumerateInstanceLayerProperties(&layerCount, nullptr);
std::vector<VkLayerProperties> availableLayers(layerCount);
vkEnumerateInstanceLayerProperties(&layerCount, availableLayers.data());

RecordLogHeader("Requesting Vulkan validation layers\t ["
+ to_string(layerCount) + "]");

RecordLog("Layer", "Found Status", 80-12);
RecordLog(SEPARATOR_BAR);
// Check needed validation layers against found layers`
for (const char* layerName : validationLayers)
{
bool layerFound = false;
VkLayerProperties layer_info;
for (const auto& layerProperties : availableLayers)
{
if (strcmp(layerName, layerProperties.layerName) == 0)
{
layerFound = true;
layer_info = layerProperties;
break;
}
}

PrintLayerStatus(layer_info, layerName, layerFound);
}

return true;
}

产生输出:

================================================================================
Requesting Vulkan validation layers [16]
================================================================================

Layer Found Status
--------------------------------------------------------------------------------

VK_LAYER_GOOGLE_threading, Vulkan version 1.1.92, layer version 1............[✓]
Description: Google Validation Layer

VK_LAYER_LUNARG_parameter_validation, Vulkan version 1.1.92, layer version 1.[✓]
Description: LunarG Validation Layer

VK_LAYER_LUNARG_device_limits, Vulkan version 1.1.92, layer version 1........[✗]

VK_LAYER_LUNARG_object_tracker, Vulkan version 1.1.92, layer version 1.......[✓]
Description: LunarG Validation Layer

VK_LAYER_LUNARG_image, Vulkan version 1.1.92, layer version 1................[✗]

VK_LAYER_LUNARG_core_validation, Vulkan version 1.1.92, layer version 1......[✓]
Description: LunarG Validation Layer

VK_LAYER_LUNARG_swapchain, Vulkan version 1.1.92, layer version 1............[✗]

VK_LAYER_GOOGLE_unique_objects, Vulkan version 1.1.92, layer version 1.......[✓]
Description: Google Validation Layer

例如,我还使用 grep 运行 vulkaninfo 以查看是否可以找到这些层

vulkaninfo | grep VK_LAYER_LUNARG_image

返回的都是空的,看来我没有正确安装 SDK 或者我做错了什么。

我的安装只是简单地下载 sdk 并链接到包含目录并运行 setup-env.sh 脚本(我每次在编译之前都这样做)。我不确定我是否不小心跳过了一个步骤,比如运行脚本。

最佳答案

您使用的是旧文档。在撰写本文时,最新的 SDK 版本是 1.1.101。

根据 doc VK_LAYER_LUNARG_standard_validation 包括:

  1. VK_LAYER_GOOGLE_threading
  2. VK_LAYER_LUNARG_parameter_validation
  3. VK_LAYER_LUNARG_object_tracker
  4. VK_LAYER_LUNARG_core_validation
  5. VK_LAYER_GOOGLE_unique_objects

这些似乎符合您的输出。

当然这可能(并且确实)随着时间的推移而改变:

VK_LAYER_LUNARG_device_limits 在 SDK 1.0.21 中与 VK_LAYER_LUNARG_core_validationVK_LAYER_LUNARG_parameter_validation 合并。

VK_LAYER_LUNARG_image 在 SDK 1.0.42 中与 VK_LAYER_LUNARG_core_validation 合并。

VK_LAYER_LUNARG_swapchain 在 SDK 1.0.51 中与 VK_LAYER_LUNARG_core_validation 合并。

更新:在 1.1.106 中引入了 VK_LAYER_KHRONOS_validation,并且以上所有内容都已弃用。

关于c++ - 找不到一些 lunar SDK 验证层,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55154788/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com