Quesion about best {or decent} pratice around discrptors. paticulary WriteDescriptors

Hello, so, i’m working on a small project to teach myself vulkan, by porting part of my opengl program into vulkan app and i’ve been reading the specification and a bunch of tutorials. But when it comes to descriptors most examples have maybe one UBO, one or two textures samplers etc. my question is how is it best to organized it, currently i have 3

VkDescriptorSetLayoutCreateInfo

Which I organized along, the compute, frag and vertex shader (in the future I was planning on just adding more to those…

My 1st question:: is it better to organize them just across types of pipelines aka have one for the computer and done for the v-f pair?

I liked the idea of just having the sets 0, 1, 2 for each stage… however i could see how this would not scale well.

I have my 3 discriptorpools uniform, com-im-samp, and storage textel.

Note increase the size by my swapchain images vector size.

My vkAllocateDescriptorSets seems to work fine… With my multiply my descriprosetlayouts by 3 in a loop. And uses a loop offset for the VkDescriptorBufferInfo.

My issues arrsies now with VkWriteDescriptorSet

As it appears you set a binding at zero or a numbe rand it goes up.

So do I need to have a VkWriteDescriptorSet for each of my say uniform descriptors that are not in +1 binding order? Should the pBufferInfo

Be an array if i have more then one descriptor?

Basically what the best way to orginzes VkWriteDescriptorSet?

I have included what my needs are…

App layout

struct uniform_buffer_objz

{

alignas(16)glm::mat4 mvp[3];

alignas(16)glm::vec4 orgin;

alignas(16)glm::vec4 partc_attractor[MAX_ATTRACTORS];

alignas(16)bool has_channelz;

alignas(16)bool has_colour_map;

alignas(16)glm::vec4 colour_channelz[MAX_PARTICAL_COLOUR_CHANNELZ];

} uboz;

VkDescriptorSetLayoutBinding

  1. A uniform buffer array{vec4}
  2. A storage textel buffer
  3. A storage textel buffer
  4. A storage textel buffer

—(i may combine them to an array but for the moment their separate)

Fragment shader:

  1. Uniform buffer array{bool*2}
  2. Uniform buffer array{vec4*4}
  3. Combined image sampler
  4. Combined image sampler.

Vertex shader:

  1. Uniform buffer array{mat4*3}