Hi,
I have a problem getting back exposure-data from my HDR-rendering pipeline on Mac OS X Lion on a Intel Sandy Bridge HD 3000 Macbook Air mid-2011 (MBA4,2) in an asynchronous fast way (tried on both 10.7.1 and 10.7.2).
It’s really annoying, because I really only need to read back like a single float (or ideally a couple of pixels, but the problem has nothing to do with bandwidth).
The theory, and which works fine on for example my Nvidia Linux box, is to create and bind a PBO, then issue glReadPixels asynchronously to trigger the readback of data. I’m using a bound FBO of GL_RGBA16F. Then several frames later I use glMapBuffer on the PBO and can read out the data (one or more pixels), thus hiding any latency due to the driver inserting the readback in the normal GPU command queue.
On Lion with HD3000 graphics, even the asynchronous glReadPixels stalls the pipeline for like 40 ms, I guess it simply flushes the entire GPU pipe and then uses the CPU to copy the data to the PBO.
On Nvidia, it does this too, unless you have exactly the right data type parameters (GL_BGRA and the same format as your FBO, for example GL_HALF_FLOAT in my case). So naturally I tried every combination of datatypes known to man, on the Intel, but all of them stalls.
I also tried with a normal 8-bit FBO (GL_BGRA and GL_RGBA with GL_UNSIGNED_BYTE), I tried reading back from the default window-system framebuffer, and I also tried glGetTexImage() to no avail.
I downloaded a small PBO-demo from one of the OpenGL forums which is supposed to demonstrate asynchronous use, and that too fails on the Macbook (no performance gain). So I’m fairly certain I’m not doing any trivial mistake here.
Is there no game with a HDR-rendering pipeline that does exposure that runs on Mac on a HD3000 that I can snoop to find the One Almighty Allowed Combination of Parameters ?
Or might it be so bad that asynchronous data-readout on this driver is simply not supported?
FWIW, on 10.7.1 the OpenGL version was 2.1 and on 10.7.2 I still run the 2.1, even though I could switch to core 3.2. Is there any reason to suspect that switching to core 3.2 on Lion would make this work (for example, does it actually switch to a physically different driver?).
Any help at all would be most welcome