--- src/mesa/main/fbobject.c | 44 ++++++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 18 deletions(-)
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c index a63e8b8de52..82f7d522af9 100644 --- a/src/mesa/main/fbobject.c +++ b/src/mesa/main/fbobject.c @@ -656,8 +656,16 @@ _mesa_has_depthstencil_combined(const struct gl_framebuffer *fb) * For debug only. */ static void -att_incomplete(const char *msg) +att_incomplete(struct gl_context *ctx, const char *msg) { + static GLuint msg_id; + + _mesa_gl_debug(ctx, &msg_id, + MESA_DEBUG_SOURCE_API, + MESA_DEBUG_TYPE_OTHER, + MESA_DEBUG_SEVERITY_MEDIUM, + "Attachment incomplete: %s\n", msg); + if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_FBO) { _mesa_debug(NULL, "attachment incomplete: %s\n", msg); } @@ -782,7 +790,7 @@ is_legal_depth_format(const struct gl_context *ctx, GLenum baseFormat) * if GL_STENCIL, this is a stencil component attachment point. */ static void -test_attachment_completeness(const struct gl_context *ctx, GLenum format, +test_attachment_completeness(struct gl_context *ctx, GLenum format, struct gl_renderbuffer_attachment *att) { assert(format == GL_COLOR || format == GL_DEPTH || format == GL_STENCIL); @@ -797,19 +805,19 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, GLenum baseFormat; if (!texObj) { - att_incomplete("no texobj"); + att_incomplete(ctx, "no texobj"); att->Complete = GL_FALSE; return; } texImage = texObj->Image[att->CubeMapFace][att->TextureLevel]; if (!texImage) { - att_incomplete("no teximage"); + att_incomplete(ctx, "no teximage"); att->Complete = GL_FALSE; return; } if (texImage->Width < 1 || texImage->Height < 1) { - att_incomplete("teximage width/height=0"); + att_incomplete(ctx, "teximage width/height=0"); att->Complete = GL_FALSE; return; } @@ -817,28 +825,28 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, switch (texObj->Target) { case GL_TEXTURE_3D: if (att->Zoffset >= texImage->Depth) { - att_incomplete("bad z offset"); + att_incomplete(ctx, "bad z offset"); att->Complete = GL_FALSE; return; } break; case GL_TEXTURE_1D_ARRAY: if (att->Zoffset >= texImage->Height) { - att_incomplete("bad 1D-array layer"); + att_incomplete(ctx, "bad 1D-array layer"); att->Complete = GL_FALSE; return; } break; case GL_TEXTURE_2D_ARRAY: if (att->Zoffset >= texImage->Depth) { - att_incomplete("bad 2D-array layer"); + att_incomplete(ctx, "bad 2D-array layer"); att->Complete = GL_FALSE; return; } break; case GL_TEXTURE_CUBE_MAP_ARRAY: if (att->Zoffset >= texImage->Depth) { - att_incomplete("bad cube-array layer"); + att_incomplete(ctx, "bad cube-array layer"); att->Complete = GL_FALSE; return; } @@ -849,12 +857,12 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (format == GL_COLOR) { if (!_mesa_is_legal_color_format(ctx, baseFormat)) { - att_incomplete("bad format"); + att_incomplete(ctx, "bad format"); att->Complete = GL_FALSE; return; } if (_mesa_is_format_compressed(texImage->TexFormat)) { - att_incomplete("compressed internalformat"); + att_incomplete(ctx, "compressed internalformat"); att->Complete = GL_FALSE; return; } @@ -865,7 +873,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, * GL_EXT_color_buffer(_half)_float with set of new sized types. */ if (_mesa_is_gles(ctx) && (texObj->_IsFloat || texObj->_IsHalfFloat)) { - att_incomplete("bad internal format"); + att_incomplete(ctx, "bad internal format"); att->Complete = GL_FALSE; return; } @@ -880,7 +888,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } else { att->Complete = GL_FALSE; - att_incomplete("bad depth format"); + att_incomplete(ctx, "bad depth format"); return; } } @@ -894,7 +902,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, /* OK */ } else { /* no such thing as stencil-only textures */ - att_incomplete("illegal stencil texture"); + att_incomplete(ctx, "illegal stencil texture"); att->Complete = GL_FALSE; return; } @@ -907,13 +915,13 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (!att->Renderbuffer->InternalFormat || att->Renderbuffer->Width < 1 || att->Renderbuffer->Height < 1) { - att_incomplete("0x0 renderbuffer"); + att_incomplete(ctx, "0x0 renderbuffer"); att->Complete = GL_FALSE; return; } if (format == GL_COLOR) { if (!_mesa_is_legal_color_format(ctx, baseFormat)) { - att_incomplete("bad renderbuffer color format"); + att_incomplete(ctx, "bad renderbuffer color format"); att->Complete = GL_FALSE; return; } @@ -926,7 +934,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, /* OK */ } else { - att_incomplete("bad renderbuffer depth format"); + att_incomplete(ctx, "bad renderbuffer depth format"); att->Complete = GL_FALSE; return; } @@ -939,7 +947,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } else { att->Complete = GL_FALSE; - att_incomplete("bad renderbuffer stencil format"); + att_incomplete(ctx, "bad renderbuffer stencil format"); return; } } -- 2.17.0 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev