Warm tip: This article is reproduced from stackoverflow.com, please click
vulkan

VkViewport negative height?

发布于 2020-03-27 15:42:54

The validation layer complains:

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

and yet the vulkan spec says in documentation of VkViewport:

The application can specify a negative term for height

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

What am I missing? These two statements seem to contradict each other.

Questioner
Andrew Tomazos
Viewed
28
krOoze 2020-01-31 19:31

In order to use negative height, you need to either enable VK_KHR_maintenance1 extension, or use Vulkan 1.1+.