We are using PBO to async read back pixels GPU -> CPU (for hardware feedback in virtual texture).
Unfortunately, both glReadPixels and glGetTexImage causes stall (instead of immediate return).
PBO read Code is looking like that:
glBufferData(GL_PIXEL_PACK_BUFFER, width*height*4, NULL, GL_STREAM_READ);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, width, height, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureId, 0);
glGetTexImage( GL_TEXTURE_2D, 0, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0 );//<< causes stall!
//glReadBuffer( GL_COLOR_ATTACHMENT0 );
//glReadPixels( 0, 0, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, 0 );
Any ideas? Works fine on NVIDIA.
OS: Windows 7,
Video: Intel 4600
I am also having a similar problem. I am using a FrameBuffer object for selection and want to read back from the FrameBuffer. I can read back from the default buffer (GL_BACK) but not from the frame buffer. I have also tried the PACK_BUFFER approach which also fails.
I have an Intel HD 4600 with the latest drivers. I am getting an OpenGL Debug message back from the ig75icd32.dll of a GL_INVALID_OPERATION and a GLError 1282 is on the error stack.
I have this posted in https://communities.intel.com/message/263941. My code snippets have been reviewed as OK.
This code also works fine with NVIDEA and AMD cards.
I would like my code to work on Intel hardware so I can recommend this hardware for users of our software.
There has been no feedback on this Have you resolved it??
The very recent beta driver seem not stalling in that case.
According to what I see in your snippet, everything is correct.
I would suggest to experiment with glReadPixels format/type. Previous Intel drivers were very sensitive to it Try use GL_BGRA instead of GL_RGBA, or GL_RGBA32F, instead of GL_FLOAT.
Also, pixel buffer object (PBO) should work more correctly/stable, since this way you are not passing format in two different ways (both internal and general), like glReadPixels