I am currently working on a c++ program using OpenXR with OpenGL. I managed to render everything that I wanted into VR.
I have one framebuffer per eye, and then 3 more for layers (crosshair/menu) that are displayed with different button presses (which is done in VR with xrEndFrame).
The problem is that I want to mirror everything also onto the computer screen.
Most of it was simple because I just used glBlitNamedFramebuffer to mirror one of the eye framebuffers onto the 0/default framebuffer so it's displayed.
But I can't use this method for the layers, as it is just in 2D on the screen, and I need to position the layer for example to where I am looking in VR for the crosshair.
I can draw a quad to the position i want it to be, but i don't know how i can copy the content of the framebuffer onto the quad. I thought maybe glReadPixels might help, but that seemed rather inefficient.