I really need to get RGB 8 bytes per channel for a GPU buffer. I need him to go to a trained convolutional neural network, and he only accepts data in this format. I cannot convert it to a CPU, as I am very attached to the processor, and it is rather slow.
Currently, I have a FBO with the renderbuffer application, which is defined using:
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGB8_OES, bufferWidth, bufferHeight);
There are no errors when linking, defining, and rendering in the buffer.
But when I use
glReadPixels(0, 0, bufferWidth, bufferHeight, GL_RGB, GL_UNSIGNED_BYTE, rgbBufferRawName);
it gives an incorrect enumeration error (0x0500). It works fine when transferring GL_RED_EXTor GL_RGBAand creates the correct buffers (I checked it by loading these buffers into the texture and executing them, and they looked correct).
I tried to install glPixelStorei(GL_PACK_ALIGNMENT, 1);, but that didn't matter.
I'm on iOS10 and iPhone 6. I did ES2.0, but now tried to switch to ES3.0 in the hope that this would help me solve the problem. This is not true.
I am very grateful for the help in creating the RGB8 buffer, Thank you.
source
share