- November 3, 2011 at 6:46 am #30677
Can any body tell me when is the appropriate time to delete the render buffer which attach to the frame buffer object as a depth attachment on SGX GPU from PowerVR on Android platform?
I come across this question when I use render to texture. I delete the render buffer(depth attachment of FBO) immediately after the process of render to texture, and then use the texture for other rendering process, a strange problem occur on Android
platform. Nothing is rendered and the screen become black. It seem glClear neither have any effect. I test the same code in GLES2 pc emulation and desktop OGL, everything is ok, but on SGX GPU from PowerVR on Android platform, I got nothing but a black screen. I port the same code on SGX530 GPU(Samsung Galaxy S I9008), SGX540 GPU(LG Optimus 3D) and other SGX GPUs, All return me the black screen. However When I test the same code on Adreno GPU from Qualcomm, Everying is ok. So Is this an Issue of SGX GPU? And can anyone tell me when is the appropriate time to delete the render buffer in FBO?
If the PowerVR Technique Support want the code I use to reproduce the problem, Please concast me by this email: email@example.com
Following are the some codes I use to render to texture.
Code to creat the frame buffer object:
// create a render buffer to used as the depth buffer
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT16, texSize, texSize);
// create a blank texture to used as the color buffer
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, texSize, texSize, 0, GL_RGBA, GL_UNSIGNED_BYTE, 0);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
// create the frame buffer
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, colorBuffer, 0);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depthBuffer);
Code to delete the render buffer and frame buffer after render to texture process
if (0 != frameBuffer)
if (0 != depthBuffer)
// do not delete the texture so as to use the result of render to texture
}April 17, 2012 at 4:39 pm #35213
Any news on this issue?
Have you found a way to resolve it?