X-Git-Url: https://git.libre-soc.org/?a=blobdiff_plain;f=src%2Fmesa%2Fmain%2Fdebug.c;h=3471b26aad860bb11f20eb3c78274829ffb1703a;hb=192de3f051c70ff1404369f88ae2d55f1ffcf806;hp=99b214789904242d88c62e5b01aad7aa4b283fe5;hpb=f56f875b8b72eda5abf124c8c4203b77b44b9670;p=mesa.git diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 99b21478990..3471b26aad8 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -23,13 +23,14 @@ * OTHER DEALINGS IN THE SOFTWARE. */ +#include #include "mtypes.h" #include "attrib.h" -#include "colormac.h" #include "enums.h" #include "formats.h" #include "hash.h" #include "imports.h" +#include "macros.h" #include "debug.h" #include "get.h" #include "pixelstore.h" @@ -58,8 +59,8 @@ tex_target_name(GLenum tgt) { GL_TEXTURE_EXTERNAL_OES, "GL_TEXTURE_EXTERNAL_OES" } }; GLuint i; - STATIC_ASSERT(Elements(tex_targets) == NUM_TEXTURE_TARGETS); - for (i = 0; i < Elements(tex_targets); i++) { + STATIC_ASSERT(ARRAY_SIZE(tex_targets) == NUM_TEXTURE_TARGETS); + for (i = 0; i < ARRAY_SIZE(tex_targets); i++) { if (tex_targets[i].target == tgt) return tex_targets[i].name; } @@ -117,11 +118,6 @@ void _mesa_print_info( struct gl_context *ctx ) */ _mesa_debug(NULL, "Mesa GL_EXTENSIONS = %s\n", ctx->Extensions.String); -#if defined(THREADS) - _mesa_debug(NULL, "Mesa thread-safe: YES\n"); -#else - _mesa_debug(NULL, "Mesa thread-safe: NO\n"); -#endif #if defined(USE_X86_ASM) _mesa_debug(NULL, "Mesa x86-optimized: YES\n"); #else @@ -168,7 +164,7 @@ set_verbose_flags(const char *str) return; MESA_VERBOSE = 0x0; - for (i = 0; i < Elements(opts); i++) { + for (i = 0; i < ARRAY_SIZE(opts); i++) { if (strstr(str, opts[i].name) || strcmp(str, "all") == 0) MESA_VERBOSE |= opts[i].flag; } @@ -193,7 +189,8 @@ set_debug_flags(const char *str) { "silent", DEBUG_SILENT }, /* turn off debug messages */ { "flush", DEBUG_ALWAYS_FLUSH }, /* flush after each drawing command */ { "incomplete_tex", DEBUG_INCOMPLETE_TEXTURE }, - { "incomplete_fbo", DEBUG_INCOMPLETE_FBO } + { "incomplete_fbo", DEBUG_INCOMPLETE_FBO }, + { "context", DEBUG_CONTEXT } /* force set GL_CONTEXT_FLAG_DEBUG_BIT flag */ }; GLuint i; @@ -201,7 +198,7 @@ set_debug_flags(const char *str) return; MESA_DEBUG_FLAGS = 0x0; - for (i = 0; i < Elements(opts); i++) { + for (i = 0; i < ARRAY_SIZE(opts); i++) { if (strstr(str, opts[i].name)) MESA_DEBUG_FLAGS |= opts[i].flag; } @@ -215,8 +212,8 @@ set_debug_flags(const char *str) void _mesa_init_debug( struct gl_context *ctx ) { - set_debug_flags(_mesa_getenv("MESA_DEBUG")); - set_verbose_flags(_mesa_getenv("MESA_VERBOSE")); + set_debug_flags(getenv("MESA_DEBUG")); + set_verbose_flags(getenv("MESA_VERBOSE")); } @@ -276,7 +273,9 @@ write_texture_image(struct gl_texture_object *texObj, store = ctx->Pack; /* save */ ctx->Pack = ctx->DefaultPacking; - ctx->Driver.GetTexImage(ctx, GL_RGBA, GL_UNSIGNED_BYTE, buffer, img); + ctx->Driver.GetTexSubImage(ctx, + 0, 0, 0, img->Width, img->Height, img->Depth, + GL_RGBA, GL_UNSIGNED_BYTE, buffer, img); /* make filename */ _mesa_snprintf(s, sizeof(s), "/tmp/tex%u.l%u.f%u.ppm", texObj->Name, level, face); @@ -415,7 +414,7 @@ dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) { printf("Renderbuffer %u: %u x %u IntFormat = %s\n", rb->Name, rb->Width, rb->Height, - _mesa_lookup_enum_by_nr(rb->InternalFormat)); + _mesa_enum_to_string(rb->InternalFormat)); if (writeImage) { _mesa_write_renderbuffer_image(rb); } @@ -615,21 +614,21 @@ _mesa_print_texture(struct gl_context *ctx, struct gl_texture_image *img) else { /* XXX add more formats or make into a new format utility function */ switch (img->TexFormat) { - case MESA_FORMAT_A8: - case MESA_FORMAT_L8: - case MESA_FORMAT_I8: + case MESA_FORMAT_A_UNORM8: + case MESA_FORMAT_L_UNORM8: + case MESA_FORMAT_I_UNORM8: c = 1; break; - case MESA_FORMAT_AL88: - case MESA_FORMAT_AL88_REV: + case MESA_FORMAT_L8A8_UNORM: + case MESA_FORMAT_A8L8_UNORM: c = 2; break; - case MESA_FORMAT_RGB888: - case MESA_FORMAT_BGR888: + case MESA_FORMAT_BGR_UNORM8: + case MESA_FORMAT_RGB_UNORM8: c = 3; break; - case MESA_FORMAT_RGBA8888: - case MESA_FORMAT_ARGB8888: + case MESA_FORMAT_A8B8G8R8_UNORM: + case MESA_FORMAT_B8G8R8A8_UNORM: c = 4; break; default: