VkViewport 负高度?

VkViewport negative height?

验证层抱怨:

vkCreateGraphicsPipelines: pCreateInfos[0].pViewportState->pViewports[0].height is not greater than 0.0. The Vulkan spec states: height must be greater than 0.0

https://www.khronos.org/registry/vulkan/specs/1.1-extensions/html/vkspec.html#VUID-VkViewport-height-01772

然而 vulkan 规范在 VkViewport 的文档中说:

The application can specify a negative term for height

https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkViewport.html

我错过了什么?这两种说法似乎相互矛盾。

要使用负高度,您需要启用 VK_KHR_maintenance1 扩展,或使用 Vulkan 1.1+。