Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong error detection on vkCmdSetPrimitiveTopologyEXT #8597

Open
asuessenbach opened this issue Sep 26, 2024 · 1 comment
Open

Wrong error detection on vkCmdSetPrimitiveTopologyEXT #8597

asuessenbach opened this issue Sep 26, 2024 · 1 comment

Comments

@asuessenbach
Copy link

Environment:

  • OS: Windows 10
  • GPU and driver version: NVIDIA RTX 3000 Laptop GPU, driver version 556.12
  • SDK or header version if building from repo: SDK version 1.3.290.0
  • Options enabled (synchronization, best practices, etc.): none

Describe the Issue

In the Vulkan-Samples repository, there's a sample extended_dynamic_state2, containing this code sequence:

		vkCmdBindPipeline(draw_cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline.baseline);
		vkCmdSetPrimitiveTopologyEXT(draw_cmd_buffer, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST);

... draw some triangles here

		vkCmdSetPrimitiveTopologyEXT(draw_cmd_buffer, VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP);

... draw some triangle strips here

		vkCmdBindPipeline(draw_cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline.tesselation);
		vkCmdSetPrimitiveTopologyEXT(draw_cmd_buffer, VK_PRIMITIVE_TOPOLOGY_PATCH_LIST);

... draw some patches here

The pipeline.tesselation, that is bound here has VK_PRIMITIVE_TOPOLOGY_PATCH_LIST as its input_assembly_state.topology.
But on drawing the patches, I get this error:
Validation Error: [ VUID-vkCmdDrawIndexed-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1bf164c2290, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xa182620000000079, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0x66b035ea | vkCmdDrawIndexed(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_PATCH_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP. The Vulkan spec states: If the bound graphics pipeline state was created with the VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state enabled and the dynamicPrimitiveTopologyUnrestricted is VK_FALSE, then the primitiveTopology parameter of vkCmdSetPrimitiveTopology must be of the same topology class as the pipeline VkPipelineInputAssemblyStateCreateInfo::topology state (https://vulkan.lunarg.com/doc/view/1.3.290.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDrawIndexed-dynamicPrimitiveTopologyUnrestricted-07500)

Expected behavior

No error message.

Additional context

In CoreChecks::ValidateGraphicsDynamicStateValue, the pipeline.create_info.pInputAssemblyState->topology is VK_PRIMITIVE_TOPOLOGY_PATCH_LIST. But pipeline.topology_at_rasterizer, which is used to check here, is VK_PRIMITIVE_TOPOLOGY_TRIANGLE_STRIP.
It seems, this value is not adjusted on vkCmdBindPipeline.

@spencer-lunarg
Copy link
Contributor

I am 95% sure this is fixed in #8394 and hopefully we can confirm when the next SDK is released in a few days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants