瀏覽代碼

mesa: added _mesa_print_framebuffer() for debugging

tags/mesa-7.9-rc1
Brian Paul 15 年之前
父節點
當前提交
421e9aa71c
共有 2 個檔案被更改,包括 44 行新增0 行删除
  1. 41
    0
      src/mesa/main/framebuffer.c
  2. 3
    0
      src/mesa/main/framebuffer.h

+ 41
- 0
src/mesa/main/framebuffer.c 查看文件

@@ -35,6 +35,7 @@
#include "buffers.h"
#include "context.h"
#include "depthstencil.h"
#include "enums.h"
#include "formats.h"
#include "macros.h"
#include "mtypes.h"
@@ -1019,3 +1020,43 @@ _mesa_get_color_read_type(GLcontext *ctx)
return GL_UNSIGNED_BYTE;
}
}


/**
* Print framebuffer info to stderr, for debugging.
*/
void
_mesa_print_framebuffer(const struct gl_framebuffer *fb)
{
GLuint i;

fprintf(stderr, "Mesa Framebuffer %u at %p\n", fb->Name, (void *) fb);
fprintf(stderr, " Size: %u x %u Status: %s\n", fb->Width, fb->Height,
_mesa_lookup_enum_by_nr(fb->_Status));
fprintf(stderr, " Attachments:\n");

for (i = 0; i < BUFFER_COUNT; i++) {
const struct gl_renderbuffer_attachment *att = &fb->Attachment[i];
if (att->Type == GL_TEXTURE) {
const struct gl_texture_image *texImage;
fprintf(stderr,
" %2d: Texture %u, level %u, face %u, slice %u, complete %d\n",
i, att->Texture->Name, att->TextureLevel, att->CubeMapFace,
att->Zoffset, att->Complete);
texImage = att->Texture->Image[att->CubeMapFace][att->TextureLevel];
fprintf(stderr, " Size: %u x %u x %u Format %s\n",
texImage->Width, texImage->Height, texImage->Depth,
_mesa_get_format_name(texImage->TexFormat));
}
else if (att->Type == GL_RENDERBUFFER) {
fprintf(stderr, " %2d: Renderbuffer %u, complete %d\n",
i, att->Renderbuffer->Name, att->Complete);
fprintf(stderr, " Size: %u x %u Format %s\n",
att->Renderbuffer->Width, att->Renderbuffer->Height,
_mesa_get_format_name(att->Renderbuffer->Format));
}
else {
fprintf(stderr, " %2d: none\n", i);
}
}
}

+ 3
- 0
src/mesa/main/framebuffer.h 查看文件

@@ -91,4 +91,7 @@ _mesa_get_color_read_type(GLcontext *ctx);
extern GLenum
_mesa_get_color_read_format(GLcontext *ctx);

extern void
_mesa_print_framebuffer(const struct gl_framebuffer *fb);

#endif /* FRAMEBUFFER_H */

Loading…
取消
儲存