From b02ef740b90029bc40629e5b81270a8cf77101d3 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Mon, 5 Oct 2009 15:50:11 +0100 Subject: mesa/st: add ST_DEBUG environment variable At last it's possible to turn on tgsi dumps and other debugging in the state tracker without modifying sources... --- src/mesa/state_tracker/st_cb_texture.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/mesa/state_tracker/st_cb_texture.c') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 9a634bb930..b943787106 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -43,6 +43,7 @@ #include "main/texobj.h" #include "main/texstore.h" +#include "state_tracker/st_debug.h" #include "state_tracker/st_context.h" #include "state_tracker/st_cb_fbo.h" #include "state_tracker/st_cb_texture.h" @@ -903,6 +904,9 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, GLvoid *dest = _mesa_image_address2d(&ctx->Pack, pixels, width, height, format, type, row, 0); + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback format translation\n", __FUNCTION__); + /* get float[4] rgba row from surface */ pipe_get_tile_rgba(tex_xfer, 0, row, width, 1, rgba); @@ -1294,6 +1298,9 @@ fallback_copy_texsubimage(GLcontext *ctx, GLenum target, GLint level, struct pipe_transfer *src_trans; GLvoid *texDest; enum pipe_transfer_usage transfer_usage; + + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s: fallback processing\n", __FUNCTION__); assert(width <= MAX_WIDTH); @@ -1419,6 +1426,12 @@ compatible_src_dst_formats(const struct gl_renderbuffer *src, return TGSI_WRITEMASK_XYZ; /* A ==> 1.0 */ } else { + if (ST_DEBUG & DEBUG_FALLBACK) + debug_printf("%s failed for src %s, dst %s\n", + __FUNCTION__, + _mesa_lookup_enum_by_nr(srcFormat), + _mesa_lookup_enum_by_nr(dstLogicalFormat)); + /* Otherwise fail. */ return 0; -- cgit v1.2.3