VkDeviceQueueCreateInfo::pQueuePriorities 可以为空吗?

Can VkDeviceQueueCreateInfo::pQueuePriorities be null?

来自官方 Vulkan 编程指南:

The pQueuePriorities field is an optional pointer to an array of floating point values representing the relative priority of work submitted to each of the queues. These numbers are normalized numbers in the range of 0.0 to 1.0. Queues with higher priority may be allocated more processing resources or scheduled more aggressively than queues with lower priority. Setting pQueuePriorities to nullptr has the effect of leaving the queues at the same, default priority

但是,当我启用 VK_LAYER_KHRONOS_validation 层时,出现以下错误:

VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter(ERROR / SPEC): msgNum: -690544442 - Validation Error: [ VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter ] Object 0: VK_NULL_HANDLE, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xd6d720c6 | vkCreateDevice: required parameter pCreateInfo->pQueueCreateInfos[0].pQueuePriorities specified as NULL. The Vulkan spec states: pQueuePriorities must be a valid pointer to an array of queueCount float values (https://vulkan.lunarg.com/doc/view/1.2.176.1/linux/1.2-extensions/vkspec.html#VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter)

我应该将该错误视为警告吗?还是这本书错了?

现代 Vulkan 验证层的好处在于它们直接引用了它们相关的验证规则。他们的引文是可搜索的,因为每个验证规则都有一个 唯一的 名称。因此,如果您在 Vulkan 规范中搜索“VUID-VkDeviceQueueCreateInfo-pQueuePriorities-parameter”,you'll find exactly one match:

pQueuePriorities must be a valid pointer to an array of queueCount float values

当然还有下面那句:

queueCount must be greater than 0

所以这是书中的错误。我什至检查了旧的 Vulkan 1.0.10 规范(我拥有的最旧的规范)以确保是的,这个参数是 always 需要提供的。也许它在出版前的日子里是可选的,但我不知道发布的版本是可选的。