Why does VkSubpassDescription have a setter for the colorAttachmentCount?

Started by bcbradle, April 12, 2017, 06:00:36

Previous topic - Next topic

bcbradle

Isn't that kind of thing already handled by ColorAttachment.Buffer?

spasi

When there are multiple buffer members that are sized by the same count/length member, then that member has an explicit setter. In the case of VkSubpassDescription, both pColorAttachments and pResolveAttachments are sized by colorAttachmentCount.

One could argue that you may set pColorAttachments without setting pResolveAttachments. You also cannot set pResolveAttachments without setting pColorAttachments. Both are optional, but pResolveAttachments is "more" optional. Additional logic for this scenario could be added to the LWJGL code generator, but I didn't think it was important enough. There are currently only two such cases in structs: vkSubpassDescription::pColorAttachments and AIMesh::mVertices.