FBO, integer texture and mipmapping

Hello!

I am trying to attach a specific mipmap level of an integer texture to a framebuffer object as a render target. The following code fragment produces the error message “GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT”.

Any suggestions on what I might be doing wrong?

Thanks in advance!!


GLuint fbo;
GLuint integerTexture;
glGenTextures(1, &integerTexture);
glBindTexture(GL_TEXTURE_2D, integerTexture);
	
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI_EXT,  windowWidth, windowHeight, 0, GL_RGBA_INTEGER_EXT, GL_UNSIGNED_INT, NULL);
glGenerateMipmapEXT(GL_TEXTURE_2D);		
	
glGenFramebuffersEXT(1, &fbo);
glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, fbo);
int mipMapLevel = 1;
glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, GL_TEXTURE_2D, integerTexture, mipMapLevel);
checkFBO();


bool checkFBO()
{
	GLenum status;                                            
	status = glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);
	switch(status) {
		case GL_FRAMEBUFFER_COMPLETE_EXT:
			return true;
			break;
		case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:
			assert(false && "GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT");
			return false;
			break;
		case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:
			assert(false && "GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT");
			return false;
			break;
		case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:
			assert(false && "GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT");
			return false;
			break;
		case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:
			assert(false && "GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT");
			return false;
			break;
		case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:
			assert(false && "GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT");
			return false;
			break;
		case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:
			assert(false && "GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT");
			return false;
			break;
		case GL_FRAMEBUFFER_UNSUPPORTED_EXT:
			assert(false && "GL_FRAMEBUFFER_UNSUPPORTED_EXT");
			return false;
			break;
		default:
			assert(false && "Unknown ERROR");
			return false;
	}
}

Is GL_RGBA32UI_EXT supported as an FBO texture format?

Hi!

I suppose so. If (in the above code fragment) mipMapLevel is set to 0, everything works fine…

Regards