Hello Everyone!
I have a problem with framebuffer color attachments. When I use one color attachment everything all right, but when I create FBO with multiple color attachments and switch between them (calls function glDrawBuffers) I get error:
W/Adreno200-ES20(17390): <core_glDrawBuffers:3013>: GL_INVALID_OPERATION
I use device Nexus 7
Functions glGetString(GL_RENDERER) returns:
Adreno (TM) 320
glGetString(GL_RENDERER) returns:
OpenGL ES 3.0 [email protected]
glGetIntegerv(GL_MAX_COLOR_ATTACHMENTS, &n) returns:
4
Can someone explain my device (Nexus 7) supports multiple color attachments?
I can confirm that this issue exists on my Nexus 4, Android 4.3.
Specifically, a call like this :
GLenum Buffer = GL_COLOR_ATTACHMENT0;
glDrawBuffers( 1, &Buffer );
is throwing out that W/Adreno200-ES20(1326): <core_glDrawBuffers:3013>: GL_INVALID_OPERATION
It's weird that when doing
GLenum Buffers[2]= { GL_COLOR_ATTACHMENT0, GL_COLOR_ATTACHMENT1 };
glDrawBuffers( 2, Buffers );
Does NOT throw an error but actually works as intended with the adequate shaders, so the issue might be that it doesn't support texture detaching or reattaching ?
Multiple color attachments should be supported on the Nexus devices. Is this a problem you're finding unique to Nexus devices?
1) Check the error description in http://www.opengl.org/sdk/docs/man/xhtml/glDrawBuffers.xml and verify neither of those scenerios is appropriate.
2) Take a look at our Adreno SDK. There's a gles2 texture synthesis sample which uses 2 color render targets
https://developer.qualcomm.com/mobile-development/mobile-technologies/ga...
3) Is there an apk you can provide which reproduces the problem?
thanks,
mark
Ups, mea culpa on this one. After seeing the error on my desktop HD7850 I read why glDrawBuffers throws errors. One of the reasons is invalid color attachments. So basically, if you have a render target class (like I do) and call glDrawBuffers with GL_COLOR_ATTACHMENT0 on the backbuffer, well that is an invalid operation because it doesn't have said attachment. It's a bit weird and does imply that the backbuffer doesn't support multiple render targets but hey, now I check to see if I have a texture attached to my framebuffer object and the error is gone.