LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: bcbradle on April 12, 2017, 06:00:36

Title: Why does VkSubpassDescription have a setter for the colorAttachmentCount?
Post by: bcbradle on April 12, 2017, 06:00:36
Isn't that kind of thing already handled by ColorAttachment.Buffer?
Title: Re: Why does VkSubpassDescription have a setter for the colorAttachmentCount?
Post by: spasi on April 12, 2017, 07:56:24
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.