In my implementation I decide to record command buffer only when the number of geometries changes or are switched.
let say I have 3 cubes then as long as I only have the SAME 3 cubes I will just present the VkCommandBuffer[image_index].
However if one cube is let say temporary destroyed and has to reappear after a little while I have 2 Ideas now to do it but I don’t know about performance:
1/ all cubes are in geometries_map. if I have to hide a cube i just remove it from the map and record the command-buffers and submit it again.
2/ I change nothing else than the uniform value of that cube to scale it to vec3(0.0f) so it is invisible.
the second is easier to implement and on CPU side it looks faster than updating geometries_map. But I have no idea of what is happening on GPU side… I hope that a scaled vec3(0.0f) object is just ignored.
At the present moment I use 2 but I don’t like the fact that I don’t know about performances. I may need to hide thousand of more complex objects.
Once again thank you for your time.