[Mesa-dev] [PATCH 1/2] st/mesa: add some debugging code in st_ChooseTextureFormat()

Marek Olšák maraeo at gmail.com
Tue Sep 29 10:21:58 PDT 2015


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

On Tue, Sep 29, 2015 at 5:39 PM, Brian Paul <brianp at vmware.com> wrote:
> I've temporarily added code like this many times.  Wrap it in a
> conditional that can be enabled when needed.
> ---
>  src/mesa/state_tracker/st_format.c | 18 +++++++++++++++++-
>  1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c
> index e3fb761..0c94428 100644
> --- a/src/mesa/state_tracker/st_format.c
> +++ b/src/mesa/state_tracker/st_format.c
> @@ -34,6 +34,8 @@
>
>  #include "main/imports.h"
>  #include "main/context.h"
> +#include "main/enums.h"
> +#include "main/formats.h"
>  #include "main/glformats.h"
>  #include "main/texgetimage.h"
>  #include "main/teximage.h"
> @@ -1938,6 +1940,7 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
>  {
>     struct st_context *st = st_context(ctx);
>     enum pipe_format pFormat;
> +   mesa_format mFormat;
>     unsigned bindings;
>     enum pipe_texture_target pTarget = gl_target_to_pipe(target);
>
> @@ -2010,7 +2013,20 @@ st_ChooseTextureFormat(struct gl_context *ctx, GLenum target,
>        return MESA_FORMAT_NONE;
>     }
>
> -   return st_pipe_format_to_mesa_format(pFormat);
> +   mFormat = st_pipe_format_to_mesa_format(pFormat);
> +
> +   /* Debugging aid */
> +   if (0) {
> +      debug_printf("%s(intFormat=%s, format=%s, type=%s) -> %s, %s\n",
> +                   __func__,
> +                   _mesa_enum_to_string(internalFormat),
> +                   _mesa_enum_to_string(format),
> +                   _mesa_enum_to_string(type),
> +                   util_format_name(pFormat),
> +                   _mesa_get_format_name(mFormat));
> +   }
> +
> +   return mFormat;
>  }
>
>
> --
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list