LWJGL Forum

Please login or register.

Login with username, password and session length

Author Topic: Why does VkSubpassDescription have a setter for the colorAttachmentCount?  (Read 226 times)

bcbradle

  • Newbie
  • *
  • Offline Offline
  • Posts: 17

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

spasi

  • Administrator
  • Nerdus Imperius
  • *****
  • Online Online
  • Posts: 1837

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.
Logged