Incomplete FBO after attaching stencil

I haven’t fully investigated what’s wrong, but has anybody experienced an issue when attaching color (texture) and depth to framebuffer is Ok, but attaching stencil after that makes glCheckFrameBufferStatus() return that FBO is incomplete? And for stencil I do the same thing as for depth:


1. glGenRenderbuffers()


2. glBindRenderbuffer()


3. glRenderbufferStorage() with internalformat=GL_STENCIL_INDEX8


4. glFramebufferRenderbuffer(), attachment=GL_STENCIL_ATTACHMENT





All calls are successful, for glGetError() returns 0. Changing dimension of stencil buffer to, say, (width + 1, height) doesn’t change return value of glCheckFramebufferStatus() to GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS.





Also I tried ignoring the status, but then some glGetProgramiv() call fails, and my app closes.





I’m using OpenGL ES 2.0 2.08.28.0634 SDK on win32 platform.





Thank you