Reputation: 8283
I am using glDebugMessageCallback to capture the OpenGL driver messages.
When I enable all message sources and severities, my program triggers this message:
Texture state usage warning: Texture 0 is base level inconsistent. Check texture size.
The message is triggered by a glReadPixels call that tries to read depth values from a FBO framebuffer using a PixelBufferObject (PBO.)
The exact glReadPixels call looks like this:
glBindBuffer( GL_PIXEL_PACK_BUFFER, pboid );
glReadPixels( srcx, srcy, 1, 1, GL_DEPTH_COMPONENT, GL_FLOAT, 0 );
And the PBO was created as:
glBindBuffer( GL_PIXEL_PACK_BUFFER, pboid );
glBufferData( GL_PIXEL_PACK_BUFFER, DATA_SIZE, 0, GL_STREAM_READ );
What does the message actually mean? What is "base level consistent?" And what does the level refer to?
The FBO that is being read has a COLOR_ATTACHMENT0 and a DEPTH_ATTACHMENT and is complete.
The color texture (800x640 texels) for the FBO was created with:
glTexImage2D
(
GL_TEXTURE_2D,
0,
GL_RGBA,
w, h,
0,
GL_RGBA,
GL_UNSIGNED_BYTE,
0
);
The depth texture (800x640 texels) for the FBO was created with:
GLint internal_fmt = GL_DEPTH_COMPONENT24;
glTexImage2D
(
GL_TEXTURE_2D, // target
0, // level
internal_fmt, // internal format
w, h, // width, height
0, // border
GL_DEPTH_COMPONENT, // format
GL_UNSIGNED_INT, // type
0 // pixels
);
glCheckFramebufferStatus(GL_FRAMEBUFFER) returns GL_FRAMEBUFFER_COMPLETE.
glGetError() returns no errors.
OS: Ubuntu LTS
GPU: nVidia GTX750Ti
GL Version: Core Profile 3.3
Driver: NVIDIA 390.116
Upvotes: 0
Views: 609