Imagination PowerVR SDK Blog

Couple of oddities with PVRFrame



I’ve been messing with setting up a framebuffer with a renderable texture as colorbuffer on gles 1.1 using the PVRFrame drivers for windows. (

The main issue seem to be when I’m allocating the colorbuffer surface using glTexImage2D, with NULL as data argument.

Sometimes it will generate a GL_INVALID_VALUE, and sometimes not. And it doesn’t really matter what resolutions I pass. I always pass GL_RGBA and GL_UNSIGNED_BYTE as format and type.

But even when it generates a glError it’s still perfectly fine to bind and use as a framebuffer color attachment. I just want to know what the fudge is causing this error, which isn’t even constant. I can have for example 512x512 as resolution and the application will launch without generating an error, next time I launch it will generate an error.

The next thing is that I can’t seem to be able to attach a stencil buffer to the frame buffer. Whenever I try, glCheckFramebufferStatusOES will always return GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES.

I setup the stencilbuffer like this:


// my framebuffer is bound at this stage

GLint stencilbuffer;
glGenRenderbuffersOES(1, &stencilbuffer);
glBindRenderbufferOES(GL_RENDERBUFFER, stencilbuffer);
glRenderbufferStorageOES(GL_RENDERBUFFER, GL_STENCIL_INDEX8_OES, width, height);
// I have GL_OES_stencil8 extension, if I pass GL_STENCIL_INDEX it will generate a glError saying unsupported internal format

None of these commands generate any glError, but glCheckFramebufferStatus will always fail.

And one last thing, which doesn't really have anything to do with framebuffers, but odd/buggy non the less. glGetIntegerv(GL_TEXTURE_2D, &value); will generate GL_INVALID_ENUM and doesn't return the enable state of GL_TEXTURE_2D, this should not be the case for gles 1.1, only gles 2.0.

Note that all this only applies to the PVRframe driver for windows (libgles_cm.dll), It seems to work fine on devices with the PVR-chipset.

polarpeder2010-10-19 13:45:38


Many thanks for your input. Â We will shortly look to that so next release has this issues(at 2.7 there were some wronly set error messages) sorted out.