[Mesa-dev] [PATCH] texobj: add verbose api trace messages to several routines

Matt Turner mattst88 at gmail.com
Mon Feb 25 15:13:42 PST 2013


On Mon, Feb 25, 2013 at 2:00 PM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> Motivated by wanting to see if GenTextures was called by an
> application while debugging another Steam overlay issue.
>
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  src/mesa/main/texobj.c |   21 +++++++++++++++++++++
>  1 file changed, 21 insertions(+)
>
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index e99b0dc..af5902f 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -960,6 +960,9 @@ _mesa_GenTextures( GLsizei n, GLuint *textures )
>     GLuint first;
>     GLint i;
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glGenTextures %d\n", n);
> +
>     if (n < 0) {
>        _mesa_error( ctx, GL_INVALID_VALUE, "glGenTextures" );
>        return;
> @@ -1069,6 +1072,9 @@ _mesa_DeleteTextures( GLsizei n, const GLuint *textures)
>     GET_CURRENT_CONTEXT(ctx);
>     GLint i;
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glDeleteTextures %d\n", n);
> +
>     FLUSH_VERTICES(ctx, 0); /* too complex */
>
>     if (!textures)
> @@ -1290,6 +1296,9 @@ _mesa_PrioritizeTextures( GLsizei n, const GLuint *texName,
>     GET_CURRENT_CONTEXT(ctx);
>     GLint i;
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glPrioritizeTextures %d\n", n);
> +
>     FLUSH_VERTICES(ctx, 0);
>
>     if (n < 0) {
> @@ -1334,6 +1343,9 @@ _mesa_AreTexturesResident(GLsizei n, const GLuint *texName,
>     GLint i;
>     ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glAreTexturesResident %d\n", n);
> +
>     if (n < 0) {
>        _mesa_error(ctx, GL_INVALID_VALUE, "glAreTexturesResident(n)");
>        return GL_FALSE;
> @@ -1379,6 +1391,9 @@ _mesa_IsTexture( GLuint texture )
>     GET_CURRENT_CONTEXT(ctx);
>     ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glIsTexture %d\n", texture);
> +
>     if (!texture)
>        return GL_FALSE;
>
> @@ -1428,6 +1443,9 @@ _mesa_InvalidateTexSubImage(GLuint texture, GLint level, GLint xoffset,
>     struct gl_texture_image *image;
>     GET_CURRENT_CONTEXT(ctx);
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glInvalidateTexSubImage %d\n", texture);
> +
>     t = invalidate_tex_image_error_check(ctx, texture, level,
>                                          "glInvalidateTexSubImage");
>
> @@ -1566,6 +1584,9 @@ _mesa_InvalidateTexImage(GLuint texture, GLint level)
>  {
>     GET_CURRENT_CONTEXT(ctx);
>
> +   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> +      _mesa_debug(ctx, "glInvalidateTexImage(%d, %d)\n", texture, level);
> +
>     invalidate_tex_image_error_check(ctx, texture, level,
>                                      "glInvalidateTexImage");
>
> --
> 1.7.10.4

Reviewed-by: Matt Turner <mattst88 at gmail.com>


More information about the mesa-dev mailing list