-
Notifications
You must be signed in to change notification settings - Fork 661
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
Vulkan 1 3 hello triangle sample #1230
Vulkan 1 3 hello triangle sample #1230
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to be missing a change to samples/CMakeLists.txt that actually exposes the sample.
I know very little about the background to this change, but it does seem a little odd that using the newer version of Vulkan results in 200 more lines of code for hello_triangle than we used to have.
I think that's at least partially due to the sample doing things that the original hello triangle sample is missing. E.g. creating a proper vertex buffer instead of hardcoding it in the shaders like the non 1.3 sample does. But I agree that this sample could be an opportunity to reduce line count. It does a several not so optimal things 1:1 like the hello triangle sample. E.g. having a function to deduce the shader stage from a file extension while it only uses vertex and fragment shader stages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did add a few comments, mostly things also not that great with the VK 1.0 hello triangle sample.
But I also noticed lots of validation errors when running this sample that need to be fixed:
[error] -1733013297 Validation Layer: Error: VUID-VkBufferCreateInfo-flags-parameter: Validation Error: [ VUID-VkBufferCreateInfo-flags-parameter ] | MessageID = 0x98b450cf | vkCreateBuffer(): pCreateInfo->flags contains flag bits (0x80) which are not recognized members of VkBufferCreateFlagBits.
The Vulkan spec states: flags must be a valid combination of VkBufferCreateFlagBits values (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-VkBufferCreateInfo-flags-parameter)
[error] -153856805 Validation Layer: Error: VUID-VkBufferCreateInfo-None-09500: Validation Error: [ VUID-VkBufferCreateInfo-None-09500 ] | MessageID = 0xf6d454db | vkCreateBuffer(): pCreateInfo->usage is zero.
The Vulkan spec states: If the pNext chain does not include a VkBufferUsageFlags2CreateInfoKHR structure, usage must not be 0 (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-VkBufferCreateInfo-None-09500)
[error] 1895430949 Validation Layer: Error: VUID-VkGraphicsPipelineCreateInfo-topology-08773: Validation Error: [ VUID-VkGraphicsPipelineCreateInfo-topology-08773 ] Object 0: handle = 0xd175b40000000013, type = VK_OBJECT_TYPE_SHADER_MODULE; | MessageID = 0x70f9fb25 | vkCreateGraphicsPipelines(): pCreateInfos[0].pStages[0] SPIR-V (Vertex) PointSize is not written to, but Pipeline topology is set to VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
The Vulkan spec states: If the pipeline is being created with a Vertex Execution Model and no TessellationEvaluation or Geometry Execution Model, and the topology member of pInputAssembly is VK_PRIMITIVE_TOPOLOGY_POINT_LIST, and either VK_DYNAMIC_STATE_PRIMITIVE_TOPOLOGY dynamic state is not enabled or dynamicPrimitiveTopologyUnrestricted is VK_FALSE, a PointSize decorated variable must be written to if maintenance5 is not enabled (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-VkGraphicsPipelineCreateInfo-topology-08773)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6f93d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6f93d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6efca0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6f93d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6f93d0, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
[error] -1696391559 Validation Layer: Error: VUID-vkCmdBindVertexBuffers-pBuffers-00627: Validation Error: [ VUID-vkCmdBindVertexBuffers-pBuffers-00627 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xfa21a40000000003, type = VK_OBJECT_TYPE_BUFFER; | MessageID = 0x9ae31e79 | vkCmdBindVertexBuffers(): pBuffers[0] (VkBuffer 0xfa21a40000000003[]) was created with VkBufferUsageFlags2KHR(0) but requires VK_BUFFER_USAGE_VERTEX_BUFFER_BIT.
The Vulkan spec states: All elements of pBuffers must have been created with the VK_BUFFER_USAGE_VERTEX_BUFFER_BIT flag (https://vulkan.lunarg.com/doc/view/1.3.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdBindVertexBuffers-pBuffers-00627)
[error] -901174136 Validation Layer: Error: VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500: Validation Error: [ VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500 ] Object 0: handle = 0x1fb5f6f3830, type = VK_OBJECT_TYPE_COMMAND_BUFFER; Object 1: handle = 0xdd3a8a0000000015, type = VK_OBJECT_TYPE_PIPELINE; | MessageID = 0xca492c88 | vkCmdDraw(): the last primitive topology VK_PRIMITIVE_TOPOLOGY_TRIANGLE_LIST state set by vkCmdSetPrimitiveTopology is not compatible with the pipeline topology VK_PRIMITIVE_TOPOLOGY_POINT_LIST.
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.296.0/windows/1.3-extensions/vkspec.html#VUID-vkCmdDraw-dynamicPrimitiveTopologyUnrestricted-07500)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just a few issues.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more validation errors :)
Added a few comments, but mostly (if not all) are cosmetic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sample itself looks good to me now :)
One thing that should be expanded though is the readme. Newer samples should come with at least a basic tutorial or overview of what the sample does / how it works.
1: It is using vertex buffer to load vertices compared to hardcoded in shader in hello_triangle 1.0 2: It is using dynamic rendering so frame buffers and Render passes removed 3: Used Synchronization2 in image layout transition. 3: Updated the code to use VK_DEBUG_UTILS (new) instead VK_DEBUG_REPORT(old) 4: Update the code to use Dynamic pipeline status 5: Removed unused parameters from functions 6: Used C++20 initializers Signed-off-by: aliasifhuawei <[email protected]>
e6fee4d
to
88e2a2a
Compare
Re worked the structs to enable only the required features
I accidentally force-pushed earlier without rebasing my branch on the latest main. I have now rebased my branch onto the latest main, resolved all feedback, and force-pushed the corrected changes. The branch is now clean and ready for review. Apologies for the confusion caused by the rewritten history. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The readme is great and a nice list of things that make VK 1.3 so interesting 👍🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for correctly checking for the features. Looks good now.
Just one duplicate comment remaining and a couple of suggestions.
3 approvals - merging. Thanks! |
This Pull Request introduces a new sample, "Hello Triangle", leveraging Vulkan 1.3 features and modern C++20 language enhancements. The sample aims to provide developers with an updated and clean starting point for learning and experimenting with the latest Vulkan API functionalities.
1: Sample is using vertex buffer to load vertices compared to hardcoded in the vertex shader in hello_triangle 1.0.
2: Sample is using dynamic rendering so frame buffers and Render passes removed.
3: Used Synchronization2 in image layout transition.
3: Updated the code to use VK_DEBUG_UTILS (new) instead VK_DEBUG_REPORT(old).
4: Update the code to use Dynamic pipeline status.
5: Removed unused parameters from functions.
6: Used C++20 initializers.
The sample is built and tested on Windows and Linux OS.
General Checklist:
Please ensure the following points are checked:
Sample Checklist