Hi
I have some strange issue with FBO on ATI radeon 1900 and 1800
(i'v tested under catalyst 9.4, 9.5 and 9.6 under vista x64 and xp sp3 on radeon 1800 and 1900XT)
the max num of color attachments for that cards is 4 - and i need'em all
so the code
int FBOSizeX = 1024;
int FBOSizeY = 768;
GLuint ColorTextures[4];
glGenTextures(4, ColorTextures);
GLuint FBO;
glGenFramebuffersEXT(1, &FBO);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, FBO);
for (int i = 0; i < 4; i++)
{
glBindTexture(GL_TEXTURE_2D, ColorTextures);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, FBOSizeX, FBOSizeY, 0, GL_RGBA, GL_FLOAT, NULL);
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT,
GL_COLOR_ATTACHMENT0_EXT+i,
GL_TEXTURE_2D,
ColorTextures,
0);
}
GLenum Status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
// Status == GL_FRAMEBUFFER_COMPLETE_EXT
GLuint Depth;
glGenRenderbuffersEXT(1, &Depth);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, Depth);
glRenderbufferStorageEXT(GL_RENDERBUFFER_EXT, GL_DEPTH24_STENCIL8_EXT, FBOSizeX, FBOSizeY);
glBindRenderbufferEXT(GL_RENDERBUFFER_EXT, 0);
//
// Now bind depth
//
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, Depth);
glFramebufferRenderbufferEXT(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT, GL_RENDERBUFFER_EXT, Depth);
GLenum Status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
// Status == GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT
so i cannot render to this fbo
strangelly on all radeons HD and nvidias this works just fine
and now more mystery ... if i change FBOSizeY from 768 to 512 ... all works fine
is there any restrictions on radeons 1800 and 1900 so the depth and color attachments could only be pow(2) ?
IF i do not bind depth/stencil attachments only 4 color attachments all works perfect
but if i olso want to bind depth/stencil the dimensions must be pow(2) or error is generated ... what is going on here ?