Closed jcelerier closed 2 years ago
if memory serves, you need a GPU sync point - glFlushRenderersApple()
or some such
glGetTexImage()
has never worked for an IOSurface-backed GL texture - it's a poorly documented limitation of the OpenGL/IOSurface integration. I'm afraid you'll have to draw into an FBO then do a PBO download from the texture backing the FBO.
Aah yes. Thanks for the reminder! I forgot about that!
ouch :) okay.. my original issue is that the rendering framework I'm using does not support importing textures in the GL_TEXTURE_RECTANGLE format, only GL_TEXTURE_2D... would changing this in my local Syphon code break compatibility with normal servers ?
IIRC I dont believe IOSurface supports GL_TEXTURE_2D at all. I dont think that will work. You will need to blit to a GL_TEXTURE_2D backed FBO and use that texture.
okay, I'll try to fix the framework I'm using instead aha
thanks for the quick answers !
Hi,
When trying to read back textures from Syphon in my code, I only get the first line of the texture being sent. But I don't understand when things go wrong in the following (example, for me to try to understand) code:
The glGetTexImage only writes the first line (if I fill my
m_pixels
array with some values, all the lines besides the first line are unchanged after the call). I tried using GL_TEXTURE_RECTANGLE_ARB, using GL_UNSIGNED_INT_8_8_8_8 or GL_UNSIGNED_INT_8_8_8_8_REV to retrieve the data instead, but the result is always the same (in the relevant data types). I also tried core and legacy/compat contexts, 4.1, 3.2 ... not much change.