Thanks a lot for the elaborations and i will try the two pass thing you suggest as I already have that set up in my code.
But I’ll also explain a bit more why I feel I shouldn’t have to copy the pixel data.
I’m working on a Raspberry Pi4b and on these both the gpu and the cpu are using the same physical memory. But setting the pi up, you allocate a certain amount of memory for the GPU.
Further to that there are different ‘sections’ of memory that are being used in different ways. A short quote from one of the knowledgeable raspberry engineers on the pi forum who deals a lot with low level display and camera drivers:
“On Pi4, OpenGL allocations can be from any system memory for textures, although the rendered output has to be from the CMA heap if you want to display it, and hence in the bottom 1GB.”
Now since my goal is not to display the final pixels but use them in a computer vision program (slam) I am using off screen fbo textures to render to. And therefore I’m hoping that the rule of ‘if you want to display it’ does not apply and the memory is not in the CMA heap and because of that that I could access it directly from a cpu process.
You mention that ‘lower level API’ might be able to access the data directly? Would you be able to give some more explanation on that?