David Carpenter
David Carpenter

Reputation: 1640

Is this a validation layer bug/oversight?

In my VkPipelineViewportStateCreateInfo I initialize viewportCount and scissorCount to 0 since I can use vkCmdSetViewport and vkCmdSetScissor during my render pass anyway. Is the validator bugged or is it trying to tell me something other than "0 is not greater than 1"?

[ VUID-VkPipelineViewportStateCreateInfo-viewportCount-01216 ] Object 0: handle = 0x5610e4b1ed80, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0xe99671df | vkCreateGraphicsPipelines: The VkPhysicalDeviceFeatures::multiViewport feature is disabled, but pCreateInfos[0].pViewportState->viewportCount (=0) is not 1. The Vulkan spec states: If the multiple viewports feature is not enabled, viewportCount must not be greater than 1 (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPipelineViewportStateCreateInfo-viewportCount-01216)

Upvotes: 0

Views: 76

Answers (2)

krOoze
krOoze

Reputation: 13276

If VK_DYNAMIC_STATE_VIEWPORT_WITH_COUNT is not included, then the count must be greater than 0.

vkCmdSetViewport does not change the amount of viewports in the pipeline, just the values.

Upvotes: 1

Sh_gosha
Sh_gosha

Reputation: 111

The viewportCount member of VkPipelineViewportStateCreateInfo is the number of active viewports to use when the pipeline is bound to the command buffer. This can be different from the viewportCount used when vkCmdSetViewport is called. In particular, if you want to change the active viewport after the pipeline is bound, you must specify multiple viewports in the pipeline state create info.

Upvotes: 0

Related Questions