So I’m trying to avoid stall between frames, when CPU waits for GPU to finish rendering the first frame and then CPU starts preparing for the second frame.
Work progress : TotalNumberOfSwapChainImages : 3 MaxNumOfFramesInFlight : 2 CommandBuffers: 3 RenderSemaphores: MaxNumOfFramesInFlight PresentationSemaphore : MaxNumOfFramesInFlight FenceCount: MaxNumOfFramesInFlight
With this setup the clearing and basic rendering loop is running without any issues.
Now the Question arises while setting up the shader resources.
PipelineLayout and descriptorsetlayout are not per frame, i believe they are not required to be unique for each frame or each frame in flight ( Please correct me if i’m wrong).
The confusion is with descriptorSets and associated buffers and memories. Which of the below config is a solution ? Or is there any other config which is better ? The below mentioned buffers are getting update in every frame. Is it allowed to update a buffer/memory at an offset when its in use at another offset ?
DescriptorSet : MaxNumOfFramesInFlight Buffer : MaxNumOfFramesInFlight Memory : MaxNumOfFramesInFlight
DescriptorSet : MaxNumOfFramesInFlight Buffer : 1 , with sizeOf(TransformationStruct) * MaxNumOfFramesInFlight, use offseting mechanism Memory : 1, with sizeOf(TransformationStruct) * MaxNumOfFramesInFlight, use offseting mechanism