I am working on reusing as many command buffers as I can by pre-recording them at load time. This gives a significant boost on CPU although now I cannot get the GPU timestamps since there is no way to read back. I Map the readback buffer before and Unmap it after reading is done. Does this mean I need a persistently mapped readback buffer?
void Init()
{
beginCmd(cmd);
cmdBeginQuery(cmd);
// Do a bunch of stuff
cmdEndQuery(cmd);
endCmd(cmd);
}
void Draw()
{
CommandBuffer* cmd = commands[frameIdx];
submit(cmd);
}
The begin and end query do exactly what the names say.