[Mesa-dev] [PATCH] RFC: mesa: remove MESA_VERBOSE env variable

Brian Paul brianp at vmware.com
Thu Apr 20 17:32:11 UTC 2017


On 04/20/2017 08:12 AM, Emil Velikov wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> The env variable was useful in the early days of mesa development, when
> tools such at Apitrace were not available.
>
> Nowadays, out of the 12 options only a third are used. With nearly all
> instances printing the API state. And even then not all entry points
> are annotated, thus one cannot rely upon it.
>
> The current patch removes the variable all together alongside a few
> instances (listed below) which developers may see value in keeping.
>
> FLUSH_VERTICES/FLUSH_CURRENT macros in src/mesa/main/context.h
> _mesa_GetGraphicsResetStatusARB in src/mesa/main/robustness.c
> _mesa_print_state() in src/mesa/main/state.c
> _mesa_notifySwapBuffers() in src/mesa/main/context.c
>
> Do we want to keep any of the MESA_VERBOSE instances? If so documenting
> the variable seems reasonable.
>
> Cc: Brian Paul <brianp at vmware.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Brian, I assume that you're the author for most of these. How do you
> feel on the topic?

I think Keith was the original author of MESA_VERBOSE (but that may have 
been a clean-up of some of even earlier code of mine).

I haven't used this in years so I'm OK with removing it.

-Brian

> ---
>   src/mesa/main/attrib.c              |   8 ---
>   src/mesa/main/blend.c               |  40 ------------
>   src/mesa/main/blit.c                |  17 -----
>   src/mesa/main/bufferobj.c           |  38 -----------
>   src/mesa/main/buffers.c             |   7 ---
>   src/mesa/main/clear.c               |   3 -
>   src/mesa/main/compute.c             |  13 ----
>   src/mesa/main/context.c             |  19 +-----
>   src/mesa/main/context.h             |   4 --
>   src/mesa/main/copyimage.c           |  10 ---
>   src/mesa/main/debug.c               |  42 -------------
>   src/mesa/main/depth.c               |  12 ----
>   src/mesa/main/dlist.c               |  17 -----
>   src/mesa/main/drawpix.c             |  21 -------
>   src/mesa/main/enable.c              |   6 --
>   src/mesa/main/fbobject.c            |  32 ----------
>   src/mesa/main/feedback.c            |   3 -
>   src/mesa/main/getstring.c           |   6 --
>   src/mesa/main/hint.c                |   5 --
>   src/mesa/main/light.c               |  14 -----
>   src/mesa/main/lines.c               |   6 --
>   src/mesa/main/matrix.c              |  29 ---------
>   src/mesa/main/mtypes.h              |  22 -------
>   src/mesa/main/performance_monitor.c |   6 --
>   src/mesa/main/pipelineobj.c         |  33 ----------
>   src/mesa/main/polygon.c             |  23 -------
>   src/mesa/main/program_resource.c    |  33 ----------
>   src/mesa/main/queryobj.c            |  31 ---------
>   src/mesa/main/readpix.c             |   7 ---
>   src/mesa/main/robustness.c          |  14 +----
>   src/mesa/main/samplerobj.c          |   3 -
>   src/mesa/main/scissor.c             |  11 ----
>   src/mesa/main/shaderapi.c           |  16 -----
>   src/mesa/main/state.c               |   3 -
>   src/mesa/main/stencil.c             |  27 --------
>   src/mesa/main/texenv.c              |   7 ---
>   src/mesa/main/texgen.c              |   7 ---
>   src/mesa/main/texgetimage.c         |  17 -----
>   src/mesa/main/teximage.c            |  52 ---------------
>   src/mesa/main/texobj.c              |  29 ---------
>   src/mesa/main/texstate.c            |   8 ---
>   src/mesa/main/texstorage.c          |  13 ----
>   src/mesa/main/textureview.c         |   6 --
>   src/mesa/main/varray.c              |   6 --
>   src/mesa/main/viewport.c            |  28 ---------
>   src/mesa/tnl/t_vb_render.c          |   5 --
>   src/mesa/vbo/vbo_exec_array.c       | 122 ------------------------------------
>   47 files changed, 2 insertions(+), 879 deletions(-)
>
> diff --git a/src/mesa/main/attrib.c b/src/mesa/main/attrib.c
> index 8e738c91c8f..bb230404d29 100644
> --- a/src/mesa/main/attrib.c
> +++ b/src/mesa/main/attrib.c
> @@ -245,9 +245,6 @@ _mesa_PushAttrib(GLbitfield mask)
>
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glPushAttrib %x\n", (int) mask);
> -
>      if (ctx->AttribStackDepth >= MAX_ATTRIB_STACK_DEPTH) {
>         _mesa_error( ctx, GL_STACK_OVERFLOW, "glPushAttrib" );
>         return;
> @@ -935,11 +932,6 @@ _mesa_PopAttrib(void)
>
>      while (attr) {
>
> -      if (MESA_VERBOSE & VERBOSE_API) {
> -         _mesa_debug(ctx, "glPopAttrib %s\n",
> -                     _mesa_enum_to_string(attr->kind));
> -      }
> -
>         switch (attr->kind) {
>            case DUMMY_BIT:
>               /* do nothing */
> diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
> index 955fda1158c..52c473a9d8b 100644
> --- a/src/mesa/main/blend.c
> +++ b/src/mesa/main/blend.c
> @@ -220,13 +220,6 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
>      unsigned buf;
>      bool changed = false;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBlendFuncSeparate %s %s %s %s\n",
> -                  _mesa_enum_to_string(sfactorRGB),
> -                  _mesa_enum_to_string(dfactorRGB),
> -                  _mesa_enum_to_string(sfactorA),
> -                  _mesa_enum_to_string(dfactorA));
> -
>      /* Check if we're really changing any state.  If not, return early. */
>      if (ctx->Color._BlendFuncPerBuffer) {
>         /* Check all per-buffer states */
> @@ -417,10 +410,6 @@ _mesa_BlendEquation( GLenum mode )
>      bool changed = false;
>      enum gl_advanced_blend_mode advanced_mode = advanced_blend_mode(ctx, mode);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBlendEquation(%s)\n",
> -                  _mesa_enum_to_string(mode));
> -
>      if (ctx->Color._BlendEquationPerBuffer) {
>         /* Check all per-buffer states */
>         for (buf = 0; buf < numBuffers; buf++) {
> @@ -471,10 +460,6 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
>      GET_CURRENT_CONTEXT(ctx);
>      enum gl_advanced_blend_mode advanced_mode = advanced_blend_mode(ctx, mode);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBlendEquationi(%u, %s)\n",
> -                  buf, _mesa_enum_to_string(mode));
> -
>      if (buf >= ctx->Const.MaxDrawBuffers) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glBlendEquationi(buffer=%u)",
>                     buf);
> @@ -508,11 +493,6 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
>      unsigned buf;
>      bool changed = false;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBlendEquationSeparateEXT(%s %s)\n",
> -                  _mesa_enum_to_string(modeRGB),
> -                  _mesa_enum_to_string(modeA));
> -
>      if (ctx->Color._BlendEquationPerBuffer) {
>         /* Check all per-buffer states */
>         for (buf = 0; buf < numBuffers; buf++) {
> @@ -578,11 +558,6 @@ _mesa_BlendEquationSeparateiARB(GLuint buf, GLenum modeRGB, GLenum modeA)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBlendEquationSeparatei(%u, %s %s)\n", buf,
> -                  _mesa_enum_to_string(modeRGB),
> -                  _mesa_enum_to_string(modeA));
> -
>      if (buf >= ctx->Const.MaxDrawBuffers) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glBlendEquationSeparatei(buffer=%u)",
>                     buf);
> @@ -673,10 +648,6 @@ _mesa_AlphaFunc( GLenum func, GLclampf ref )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glAlphaFunc(%s, %f)\n",
> -                  _mesa_enum_to_string(func), ref);
> -
>      if (ctx->Color.AlphaFunc == func && ctx->Color.AlphaRefUnclamped == ref)
>         return; /* no change */
>
> @@ -720,9 +691,6 @@ _mesa_LogicOp( GLenum opcode )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLogicOp(%s)\n", _mesa_enum_to_string(opcode));
> -
>      switch (opcode) {
>         case GL_CLEAR:
>         case GL_SET:
> @@ -793,10 +761,6 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
>      GLuint i;
>      GLboolean flushed;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glColorMask(%d, %d, %d, %d)\n",
> -                  red, green, blue, alpha);
> -
>      /* Shouldn't have any information about channel depth in core mesa
>       * -- should probably store these as the native booleans:
>       */
> @@ -831,10 +795,6 @@ _mesa_ColorMaski( GLuint buf, GLboolean red, GLboolean green,
>      GLubyte tmp[4];
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glColorMaskIndexed %u %d %d %d %d\n",
> -                  buf, red, green, blue, alpha);
> -
>      if (buf >= ctx->Const.MaxDrawBuffers) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glColorMaskIndexed(buf=%u)", buf);
>         return;
> diff --git a/src/mesa/main/blit.c b/src/mesa/main/blit.c
> index e739130f984..168e83b7b87 100644
> --- a/src/mesa/main/blit.c
> +++ b/src/mesa/main/blit.c
> @@ -553,14 +553,6 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx,
> -                  "glBlitFramebuffer(%d, %d, %d, %d, "
> -                  " %d, %d, %d, %d, 0x%x, %s)\n",
> -                  srcX0, srcY0, srcX1, srcY1,
> -                  dstX0, dstY0, dstX1, dstY1,
> -                  mask, _mesa_enum_to_string(filter));
> -
>      _mesa_blit_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer,
>                             srcX0, srcY0, srcX1, srcY1,
>                             dstX0, dstY0, dstX1, dstY1,
> @@ -577,15 +569,6 @@ _mesa_BlitNamedFramebuffer(GLuint readFramebuffer, GLuint drawFramebuffer,
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_framebuffer *readFb, *drawFb;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx,
> -                  "glBlitNamedFramebuffer(%u %u %d, %d, %d, %d, "
> -                  " %d, %d, %d, %d, 0x%x, %s)\n",
> -                  readFramebuffer, drawFramebuffer,
> -                  srcX0, srcY0, srcX1, srcY1,
> -                  dstX0, dstY0, dstX1, dstY1,
> -                  mask, _mesa_enum_to_string(filter));
> -
>      /*
>       * According to PDF page 533 of the OpenGL 4.5 core spec (30.10.2014,
>       * Section 18.3 Copying Pixels):
> diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
> index 922c7d82fcb..fc9bb9f112b 100644
> --- a/src/mesa/main/bufferobj.c
> +++ b/src/mesa/main/bufferobj.c
> @@ -1241,11 +1241,6 @@ _mesa_BindBuffer(GLenum target, GLuint buffer)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glBindBuffer(%s, %u)\n",
> -                  _mesa_enum_to_string(target), buffer);
> -   }
> -
>      struct gl_buffer_object **bindTarget = get_buffer_target(ctx, target);
>      if (!bindTarget) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glBindBufferARB(target %s)",
> @@ -1423,9 +1418,6 @@ create_buffers(GLsizei n, GLuint *buffers, bool dsa)
>
>      const char *func = dsa ? "glCreateBuffers" : "glGenBuffers";
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s(%d)\n", func, n);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "%s(n %d < 0)", func, n);
>         return;
> @@ -1633,14 +1625,6 @@ _mesa_buffer_data(struct gl_context *ctx, struct gl_buffer_object *bufObj,
>   {
>      bool valid_usage;
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "%s(%s, %ld, %p, %s)\n",
> -                  func,
> -                  _mesa_enum_to_string(target),
> -                  (long int) size, data,
> -                  _mesa_enum_to_string(usage));
> -   }
> -
>      if (size < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "%s(size < 0)", func);
>         return;
> @@ -3757,12 +3741,6 @@ _mesa_BindBufferRange(GLenum target, GLuint index,
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_buffer_object *bufObj;
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glBindBufferRange(%s, %u, %u, %lu, %lu)\n",
> -                  _mesa_enum_to_string(target), index, buffer,
> -                  (unsigned long) offset, (unsigned long) size);
> -   }
> -
>      if (buffer == 0) {
>         bufObj = ctx->Shared->NullBufferObj;
>      } else {
> @@ -3815,11 +3793,6 @@ _mesa_BindBufferBase(GLenum target, GLuint index, GLuint buffer)
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_buffer_object *bufObj;
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glBindBufferBase(%s, %u, %u)\n",
> -                  _mesa_enum_to_string(target), index, buffer);
> -   }
> -
>      if (buffer == 0) {
>         bufObj = ctx->Shared->NullBufferObj;
>      } else {
> @@ -3890,12 +3863,6 @@ _mesa_BindBuffersRange(GLenum target, GLuint first, GLsizei count,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glBindBuffersRange(%s, %u, %d, %p, %p, %p)\n",
> -                  _mesa_enum_to_string(target), first, count,
> -                  buffers, offsets, sizes);
> -   }
> -
>      switch (target) {
>      case GL_TRANSFORM_FEEDBACK_BUFFER:
>         bind_xfb_buffers(ctx, first, count, buffers, true, offsets, sizes,
> @@ -3926,11 +3893,6 @@ _mesa_BindBuffersBase(GLenum target, GLuint first, GLsizei count,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glBindBuffersBase(%s, %u, %d, %p)\n",
> -                  _mesa_enum_to_string(target), first, count, buffers);
> -   }
> -
>      switch (target) {
>      case GL_TRANSFORM_FEEDBACK_BUFFER:
>         bind_xfb_buffers(ctx, first, count, buffers, false, NULL, NULL,
> diff --git a/src/mesa/main/buffers.c b/src/mesa/main/buffers.c
> index 7d17ae92de2..6631be1928d 100644
> --- a/src/mesa/main/buffers.c
> +++ b/src/mesa/main/buffers.c
> @@ -272,10 +272,6 @@ draw_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "%s %s\n", caller, _mesa_enum_to_string(buffer));
> -   }
> -
>      if (buffer == GL_NONE) {
>         destMask = 0x0;
>      }
> @@ -747,9 +743,6 @@ read_buffer(struct gl_context *ctx, struct gl_framebuffer *fb,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s %s\n", caller, _mesa_enum_to_string(buffer));
> -
>      if (buffer == GL_NONE) {
>         /* This is legal--it means that no buffer should be bound for reading. */
>         srcBuffer = -1;
> diff --git a/src/mesa/main/clear.c b/src/mesa/main/clear.c
> index a1bb36efe24..858ce00eac3 100644
> --- a/src/mesa/main/clear.c
> +++ b/src/mesa/main/clear.c
> @@ -147,9 +147,6 @@ _mesa_Clear( GLbitfield mask )
>
>      FLUSH_CURRENT(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glClear 0x%x\n", mask);
> -
>      if (mask & ~(GL_COLOR_BUFFER_BIT |
>                   GL_DEPTH_BUFFER_BIT |
>                   GL_STENCIL_BUFFER_BIT |
> diff --git a/src/mesa/main/compute.c b/src/mesa/main/compute.c
> index bb6253906bc..dfb467924f3 100644
> --- a/src/mesa/main/compute.c
> +++ b/src/mesa/main/compute.c
> @@ -34,10 +34,6 @@ _mesa_DispatchCompute(GLuint num_groups_x,
>      GET_CURRENT_CONTEXT(ctx);
>      const GLuint num_groups[3] = { num_groups_x, num_groups_y, num_groups_z };
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDispatchCompute(%d, %d, %d)\n",
> -                  num_groups_x, num_groups_y, num_groups_z);
> -
>      if (!_mesa_validate_DispatchCompute(ctx, num_groups))
>         return;
>
> @@ -52,9 +48,6 @@ _mesa_DispatchComputeIndirect(GLintptr indirect)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDispatchComputeIndirect(%ld)\n", (long) indirect);
> -
>      if (!_mesa_validate_DispatchComputeIndirect(ctx, indirect))
>         return;
>
> @@ -70,12 +63,6 @@ _mesa_DispatchComputeGroupSizeARB(GLuint num_groups_x, GLuint num_groups_y,
>      const GLuint num_groups[3] = { num_groups_x, num_groups_y, num_groups_z };
>      const GLuint group_size[3] = { group_size_x, group_size_y, group_size_z };
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx,
> -                  "glDispatchComputeGroupSizeARB(%d, %d, %d, %d, %d, %d)\n",
> -                  num_groups_x, num_groups_y, num_groups_z,
> -                  group_size_x, group_size_y, group_size_z);
> -
>      if (!_mesa_validate_DispatchComputeGroupSizeARB(ctx, num_groups,
>                                                      group_size))
>         return;
> diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c
> index 984c9e00bbf..48f20686176 100644
> --- a/src/mesa/main/context.c
> +++ b/src/mesa/main/context.c
> @@ -147,10 +147,6 @@
>   #include <stdbool.h>
>
>
> -#ifndef MESA_VERBOSE
> -int MESA_VERBOSE = 0;
> -#endif
> -
>   #ifndef MESA_DEBUG_FLAGS
>   int MESA_DEBUG_FLAGS = 0;
>   #endif
> @@ -172,8 +168,6 @@ GLfloat _mesa_ubyte_to_float_color_tab[256];
>   void
>   _mesa_notifySwapBuffers(struct gl_context *ctx)
>   {
> -   if (MESA_VERBOSE & VERBOSE_SWAPBUFFERS)
> -      _mesa_debug(ctx, "SwapBuffers\n");
>      FLUSH_CURRENT( ctx, 0 );
>      if (ctx->Driver.Flush) {
>         ctx->Driver.Flush(ctx);
> @@ -396,13 +390,6 @@ one_time_init( struct gl_context *ctx )
>         }
>
>         atexit(one_time_fini);
> -
> -#if defined(DEBUG) && defined(__DATE__) && defined(__TIME__)
> -      if (MESA_VERBOSE != 0) {
> -         _mesa_debug(ctx, "Mesa %s DEBUG build %s %s\n",
> -                     PACKAGE_VERSION, __DATE__, __TIME__);
> -      }
> -#endif
>      }
>
>      /* per-API one-time init */
> @@ -1140,8 +1127,7 @@ _mesa_initialize_dispatch_tables(struct gl_context *ctx)
>    * miscellaneous one-time initializations. If no shared context is supplied one
>    * is allocated, and increase its reference count.  Setups the GL API dispatch
>    * tables.  Initialize the TNL module. Sets the maximum Z buffer depth.
> - * Finally queries the \c MESA_DEBUG and \c MESA_VERBOSE environment variables
> - * for debug flags.
> + * Finally queries the \c MESA_DEBUG environment variable for debug flags.
>    *
>    * \param ctx the context to initialize
>    * \param api the GL API type to create the context for
> @@ -1631,9 +1617,6 @@ _mesa_make_current( struct gl_context *newCtx,
>   {
>      GET_CURRENT_CONTEXT(curCtx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(newCtx, "_mesa_make_current()\n");
> -
>      /* Check that the context's and framebuffer's visuals are compatible.
>       */
>      if (newCtx && drawBuffer && newCtx->WinSysDrawBuffer != drawBuffer) {
> diff --git a/src/mesa/main/context.h b/src/mesa/main/context.h
> index ccb54635def..804422bd04f 100644
> --- a/src/mesa/main/context.h
> +++ b/src/mesa/main/context.h
> @@ -216,8 +216,6 @@ _mesa_inside_dlist_begin_end(const struct gl_context *ctx)
>    */
>   #define FLUSH_VERTICES(ctx, newstate)				\
>   do {								\
> -   if (MESA_VERBOSE & VERBOSE_STATE)				\
> -      _mesa_debug(ctx, "FLUSH_VERTICES in %s\n", MESA_FUNCTION);\
>      if (ctx->Driver.NeedFlush & FLUSH_STORED_VERTICES)		\
>         vbo_exec_FlushVertices(ctx, FLUSH_STORED_VERTICES);	\
>      ctx->NewState |= newstate;					\
> @@ -235,8 +233,6 @@ do {								\
>    */
>   #define FLUSH_CURRENT(ctx, newstate)				\
>   do {								\
> -   if (MESA_VERBOSE & VERBOSE_STATE)				\
> -      _mesa_debug(ctx, "FLUSH_CURRENT in %s\n", MESA_FUNCTION);	\
>      if (ctx->Driver.NeedFlush & FLUSH_UPDATE_CURRENT)		\
>         vbo_exec_FlushVertices(ctx, FLUSH_UPDATE_CURRENT);	\
>      ctx->NewState |= newstate;					\
> diff --git a/src/mesa/main/copyimage.c b/src/mesa/main/copyimage.c
> index 877c8ac246d..97a4e0381ec 100644
> --- a/src/mesa/main/copyimage.c
> +++ b/src/mesa/main/copyimage.c
> @@ -489,16 +489,6 @@ _mesa_CopyImageSubData(GLuint srcName, GLenum srcTarget, GLint srcLevel,
>      int dstWidth, dstHeight, dstDepth;
>      int i;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCopyImageSubData(%u, %s, %d, %d, %d, %d, "
> -                                          "%u, %s, %d, %d, %d, %d, "
> -                                          "%d, %d, %d)\n",
> -                  srcName, _mesa_enum_to_string(srcTarget), srcLevel,
> -                  srcX, srcY, srcZ,
> -                  dstName, _mesa_enum_to_string(dstTarget), dstLevel,
> -                  dstX, dstY, dstZ,
> -                  srcWidth, srcHeight, srcDepth);
> -
>      if (!ctx->Extensions.ARB_copy_image) {
>         _mesa_error(ctx, GL_INVALID_OPERATION,
>                     "glCopyImageSubData(extension not available)");
> diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
> index 7b76a949698..34d4acc6354 100644
> --- a/src/mesa/main/debug.c
> +++ b/src/mesa/main/debug.c
> @@ -133,47 +133,6 @@ void _mesa_print_info( struct gl_context *ctx )
>
>
>   /**
> - * Set verbose logging flags.  When these flags are set, GL API calls
> - * in the various categories will be printed to stderr.
> - * \param str  a comma-separated list of keywords
> - */
> -static void
> -set_verbose_flags(const char *str)
> -{
> -#ifdef DEBUG
> -   struct option {
> -      const char *name;
> -      GLbitfield flag;
> -   };
> -   static const struct option opts[] = {
> -      { "varray",    VERBOSE_VARRAY },
> -      { "tex",       VERBOSE_TEXTURE },
> -      { "mat",       VERBOSE_MATERIAL },
> -      { "pipe",      VERBOSE_PIPELINE },
> -      { "driver",    VERBOSE_DRIVER },
> -      { "state",     VERBOSE_STATE },
> -      { "api",       VERBOSE_API },
> -      { "list",      VERBOSE_DISPLAY_LIST },
> -      { "lighting",  VERBOSE_LIGHTING },
> -      { "disassem",  VERBOSE_DISASSEM },
> -      { "draw",      VERBOSE_DRAW },
> -      { "swap",      VERBOSE_SWAPBUFFERS }
> -   };
> -   GLuint i;
> -
> -   if (!str)
> -      return;
> -
> -   MESA_VERBOSE = 0x0;
> -   for (i = 0; i < ARRAY_SIZE(opts); i++) {
> -      if (strstr(str, opts[i].name) || strcmp(str, "all") == 0)
> -         MESA_VERBOSE |= opts[i].flag;
> -   }
> -#endif
> -}
> -
> -
> -/**
>    * Set debugging flags.  When these flags are set, Mesa will do additional
>    * debug checks or actions.
>    * \param str  a comma-separated list of keywords
> @@ -214,7 +173,6 @@ void
>   _mesa_init_debug( struct gl_context *ctx )
>   {
>      set_debug_flags(getenv("MESA_DEBUG"));
> -   set_verbose_flags(getenv("MESA_VERBOSE"));
>   }
>
>
> diff --git a/src/mesa/main/depth.c b/src/mesa/main/depth.c
> index c3534407599..e70ab8575d0 100644
> --- a/src/mesa/main/depth.c
> +++ b/src/mesa/main/depth.c
> @@ -43,9 +43,6 @@ _mesa_ClearDepth( GLclampd depth )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glClearDepth(%f)\n", depth);
> -
>      ctx->Depth.Clear = CLAMP( depth, 0.0, 1.0 );
>   }
>
> @@ -62,9 +59,6 @@ _mesa_DepthFunc( GLenum func )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthFunc %s\n", _mesa_enum_to_string(func));
> -
>      if (ctx->Depth.Func == func)
>         return;
>
> @@ -97,9 +91,6 @@ _mesa_DepthMask( GLboolean flag )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthMask %d\n", flag);
> -
>      /*
>       * GL_TRUE indicates depth buffer writing is enabled (default)
>       * GL_FALSE indicates depth buffer writing is disabled
> @@ -124,9 +115,6 @@ _mesa_DepthBoundsEXT( GLclampd zmin, GLclampd zmax )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthBounds(%f, %f)\n", zmin, zmax);
> -
>      if (zmin > zmax) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glDepthBoundsEXT(zmin > zmax)");
>         return;
> diff --git a/src/mesa/main/dlist.c b/src/mesa/main/dlist.c
> index 7e440549e5b..ce071bd38ff 100644
> --- a/src/mesa/main/dlist.c
> +++ b/src/mesa/main/dlist.c
> @@ -9307,10 +9307,6 @@ _mesa_NewList(GLuint name, GLenum mode)
>      FLUSH_CURRENT(ctx, 0);       /* must be called before assert */
>      ASSERT_OUTSIDE_BEGIN_END(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glNewList %u %s\n", name,
> -                  _mesa_enum_to_string(mode));
> -
>      if (name == 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glNewList");
>         return;
> @@ -9358,9 +9354,6 @@ _mesa_EndList(void)
>      SAVE_FLUSH_VERTICES(ctx);
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glEndList\n");
> -
>      if (ctx->ExecuteFlag && _mesa_inside_dlist_begin_end(ctx)) {
>         _mesa_error(ctx, GL_INVALID_OPERATION,
>                     "glEndList() called inside glBegin/End");
> @@ -9389,10 +9382,6 @@ _mesa_EndList(void)
>                       ctx->ListState.CurrentList->Name,
>                       ctx->ListState.CurrentList);
>
> -
> -   if (MESA_VERBOSE & VERBOSE_DISPLAY_LIST)
> -      mesa_print_display_list(ctx->ListState.CurrentList->Name);
> -
>      ctx->ListState.CurrentList = NULL;
>      ctx->ListState.CurrentBlock = NULL;
>      ctx->ListState.CurrentPos = 0;
> @@ -9414,9 +9403,6 @@ _mesa_CallList(GLuint list)
>      GET_CURRENT_CONTEXT(ctx);
>      FLUSH_CURRENT(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCallList %d\n", list);
> -
>      if (list == 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glCallList(list==0)");
>         return;
> @@ -9516,9 +9502,6 @@ _mesa_CallLists(GLsizei n, GLenum type, const GLvoid * lists)
>      GLint i;
>      GLboolean save_compile_flag;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCallLists %d\n", n);
> -
>      switch (type) {
>      case GL_BYTE:
>      case GL_UNSIGNED_BYTE:
> diff --git a/src/mesa/main/drawpix.c b/src/mesa/main/drawpix.c
> index ec1d2618cad..d24fad794fc 100644
> --- a/src/mesa/main/drawpix.c
> +++ b/src/mesa/main/drawpix.c
> @@ -51,17 +51,6 @@ _mesa_DrawPixels( GLsizei width, GLsizei height,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDrawPixels(%d, %d, %s, %s, %p) // to %s at %d, %d\n",
> -                  width, height,
> -                  _mesa_enum_to_string(format),
> -                  _mesa_enum_to_string(type),
> -                  pixels,
> -                  _mesa_enum_to_string(ctx->DrawBuffer->ColorDrawBuffer[0]),
> -                  IROUND(ctx->Current.RasterPos[0]),
> -                  IROUND(ctx->Current.RasterPos[1]));
> -
> -
>      if (width < 0 || height < 0) {
>         _mesa_error( ctx, GL_INVALID_VALUE, "glDrawPixels(width or height < 0)" );
>         return;
> @@ -195,16 +184,6 @@ _mesa_CopyPixels( GLint srcx, GLint srcy, GLsizei width, GLsizei height,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx,
> -                  "glCopyPixels(%d, %d, %d, %d, %s) // from %s to %s at %d, %d\n",
> -                  srcx, srcy, width, height,
> -                  _mesa_enum_to_string(type),
> -                  _mesa_enum_to_string(ctx->ReadBuffer->ColorReadBuffer),
> -                  _mesa_enum_to_string(ctx->DrawBuffer->ColorDrawBuffer[0]),
> -                  IROUND(ctx->Current.RasterPos[0]),
> -                  IROUND(ctx->Current.RasterPos[1]));
> -
>      if (width < 0 || height < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glCopyPixels(width or height < 0)");
>         return;
> diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
> index ef278a318a1..0bd2de9233c 100644
> --- a/src/mesa/main/enable.c
> +++ b/src/mesa/main/enable.c
> @@ -281,12 +281,6 @@ _mesa_set_framebuffer_srgb(struct gl_context *ctx, GLboolean state)
>   void
>   _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
>   {
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s %s (newstate is %x)\n",
> -                  state ? "glEnable" : "glDisable",
> -                  _mesa_enum_to_string(cap),
> -                  ctx->NewState);
> -
>      switch (cap) {
>         case GL_ALPHA_TEST:
>            if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
> diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
> index d486d01195f..ed0557e6b27 100644
> --- a/src/mesa/main/fbobject.c
> +++ b/src/mesa/main/fbobject.c
> @@ -2215,19 +2215,6 @@ renderbuffer_storage_named(GLuint renderbuffer, GLenum internalFormat,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      if (samples == NO_SAMPLES)
> -         _mesa_debug(ctx, "%s(%u, %s, %d, %d)\n",
> -                     func, renderbuffer,
> -                     _mesa_enum_to_string(internalFormat),
> -                     width, height);
> -      else
> -         _mesa_debug(ctx, "%s(%u, %s, %d, %d, %d)\n",
> -                     func, renderbuffer,
> -                     _mesa_enum_to_string(internalFormat),
> -                     width, height, samples);
> -   }
> -
>      struct gl_renderbuffer *rb = _mesa_lookup_renderbuffer(ctx, renderbuffer);
>      if (!rb || rb == &DummyRenderbuffer) {
>         /* ID was reserved, but no real renderbuffer object made yet */
> @@ -2251,21 +2238,6 @@ renderbuffer_storage_target(GLenum target, GLenum internalFormat,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      if (samples == NO_SAMPLES)
> -         _mesa_debug(ctx, "%s(%s, %s, %d, %d)\n",
> -                     func,
> -                     _mesa_enum_to_string(target),
> -                     _mesa_enum_to_string(internalFormat),
> -                     width, height);
> -      else
> -         _mesa_debug(ctx, "%s(%s, %s, %d, %d, %d)\n",
> -                     func,
> -                     _mesa_enum_to_string(target),
> -                     _mesa_enum_to_string(internalFormat),
> -                     width, height, samples);
> -   }
> -
>      if (target != GL_RENDERBUFFER_EXT) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "%s(target)", func);
>         return;
> @@ -2828,10 +2800,6 @@ _mesa_CheckFramebufferStatus(GLenum target)
>      struct gl_framebuffer *fb;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCheckFramebufferStatus(%s)\n",
> -                  _mesa_enum_to_string(target));
> -
>      fb = get_framebuffer_target(ctx, target);
>      if (!fb) {
>         _mesa_error(ctx, GL_INVALID_ENUM,
> diff --git a/src/mesa/main/feedback.c b/src/mesa/main/feedback.c
> index 699e2a855a3..882bbec17e2 100644
> --- a/src/mesa/main/feedback.c
> +++ b/src/mesa/main/feedback.c
> @@ -414,9 +414,6 @@ _mesa_RenderMode( GLenum mode )
>      GLint result;
>      ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glRenderMode %s\n", _mesa_enum_to_string(mode));
> -
>      FLUSH_VERTICES(ctx, _NEW_RENDERMODE);
>
>      switch (ctx->RenderMode) {
> diff --git a/src/mesa/main/getstring.c b/src/mesa/main/getstring.c
> index 5da405d9fa4..61fe1b4e10f 100644
> --- a/src/mesa/main/getstring.c
> +++ b/src/mesa/main/getstring.c
> @@ -216,9 +216,6 @@ _mesa_GetPointerv( GLenum pname, GLvoid **params )
>      if (!params)
>         return;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s %s\n", callerstr, _mesa_enum_to_string(pname));
> -
>      switch (pname) {
>         case GL_VERTEX_ARRAY_POINTER:
>            if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
> @@ -315,9 +312,6 @@ _mesa_GetError( void )
>         e = GL_NO_ERROR;
>      }
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_enum_to_string(e));
> -
>      ctx->ErrorValue = (GLenum) GL_NO_ERROR;
>      ctx->ErrorDebugCount = 0;
>      return e;
> diff --git a/src/mesa/main/hint.c b/src/mesa/main/hint.c
> index 5d0c15d35ab..c8bfb026cf0 100644
> --- a/src/mesa/main/hint.c
> +++ b/src/mesa/main/hint.c
> @@ -38,11 +38,6 @@ _mesa_Hint( GLenum target, GLenum mode )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glHint %s %s\n",
> -                  _mesa_enum_to_string(target),
> -                  _mesa_enum_to_string(mode));
> -
>      if (mode != GL_NICEST && mode != GL_FASTEST && mode != GL_DONT_CARE) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glHint(mode)");
>         return;
> diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c
> index 87a06db309d..8409a3ce62d 100644
> --- a/src/mesa/main/light.c
> +++ b/src/mesa/main/light.c
> @@ -41,9 +41,6 @@ _mesa_ShadeModel( GLenum mode )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glShadeModel %s\n", _mesa_enum_to_string(mode));
> -
>      if (ctx->Light.ShadeModel == mode)
>         return;
>
> @@ -70,9 +67,6 @@ _mesa_ProvokingVertex(GLenum mode)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glProvokingVertexEXT 0x%x\n", mode);
> -
>      switch (mode) {
>      case GL_FIRST_VERTEX_CONVENTION_EXT:
>      case GL_LAST_VERTEX_CONVENTION_EXT:
> @@ -614,9 +608,6 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
>   {
>      GLfloat (*mat)[4] = ctx->Light.Material.Attrib;
>
> -   if (MESA_VERBOSE & VERBOSE_MATERIAL)
> -      _mesa_debug(ctx, "_mesa_update_material, mask 0x%x\n", bitmask);
> -
>      if (!bitmask)
>         return;
>
> @@ -729,11 +720,6 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
>   		   MAT_BIT_FRONT_DIFFUSE  | MAT_BIT_BACK_DIFFUSE  |
>   		   MAT_BIT_FRONT_AMBIENT  | MAT_BIT_BACK_AMBIENT);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glColorMaterial %s %s\n",
> -                  _mesa_enum_to_string(face),
> -                  _mesa_enum_to_string(mode));
> -
>      bitmask = _mesa_material_bitmask(ctx, face, mode, legal, "glColorMaterial");
>      if (bitmask == 0)
>         return; /* error was recorded */
> diff --git a/src/mesa/main/lines.c b/src/mesa/main/lines.c
> index 93b80af0dc4..8ee3b9e9359 100644
> --- a/src/mesa/main/lines.c
> +++ b/src/mesa/main/lines.c
> @@ -42,9 +42,6 @@ _mesa_LineWidth( GLfloat width )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLineWidth %f\n", width);
> -
>      /* If width is unchanged, there can't be an error */
>      if (ctx->Line.Width == width)
>         return;
> @@ -97,9 +94,6 @@ _mesa_LineStipple( GLint factor, GLushort pattern )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLineStipple %d %u\n", factor, pattern);
> -
>      factor = CLAMP( factor, 1, 256 );
>
>      if (ctx->Line.StippleFactor == factor &&
> diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c
> index 83f081e88e5..9900123d35f 100644
> --- a/src/mesa/main/matrix.c
> +++ b/src/mesa/main/matrix.c
> @@ -114,10 +114,6 @@ _mesa_Ortho( GLdouble left, GLdouble right,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glOrtho(%f, %f, %f, %f, %f, %f)\n",
> -                  left, right, bottom, top, nearval, farval);
> -
>      if (left == right ||
>          bottom == top ||
>          nearval == farval)
> @@ -227,10 +223,6 @@ _mesa_PushMatrix( void )
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_matrix_stack *stack = ctx->CurrentStack;
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glPushMatrix %s\n",
> -                  _mesa_enum_to_string(ctx->Transform.MatrixMode));
> -
>      if (stack->Depth + 1 >= stack->MaxDepth) {
>         if (ctx->Transform.MatrixMode == GL_TEXTURE) {
>            _mesa_error(ctx,  GL_STACK_OVERFLOW,
> @@ -286,10 +278,6 @@ _mesa_PopMatrix( void )
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glPopMatrix %s\n",
> -                  _mesa_enum_to_string(ctx->Transform.MatrixMode));
> -
>      if (stack->Depth == 0) {
>         if (ctx->Transform.MatrixMode == GL_TEXTURE) {
>            _mesa_error(ctx,  GL_STACK_UNDERFLOW,
> @@ -324,9 +312,6 @@ _mesa_LoadIdentity( void )
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLoadIdentity()\n");
> -
>      _math_matrix_set_identity( ctx->CurrentStack->Top );
>      ctx->NewState |= ctx->CurrentStack->DirtyFlag;
>   }
> @@ -348,13 +333,6 @@ _mesa_LoadMatrixf( const GLfloat *m )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>      if (!m) return;
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx,
> -          "glLoadMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
> -          m[0], m[4], m[8], m[12],
> -          m[1], m[5], m[9], m[13],
> -          m[2], m[6], m[10], m[14],
> -          m[3], m[7], m[11], m[15]);
>
>      if (memcmp(m, ctx->CurrentStack->Top->m, 16 * sizeof(GLfloat)) != 0) {
>         FLUSH_VERTICES(ctx, 0);
> @@ -380,13 +358,6 @@ _mesa_MultMatrixf( const GLfloat *m )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>      if (!m) return;
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx,
> -          "glMultMatrix(%f %f %f %f, %f %f %f %f, %f %f %f %f, %f %f %f %f\n",
> -          m[0], m[4], m[8], m[12],
> -          m[1], m[5], m[9], m[13],
> -          m[2], m[6], m[10], m[14],
> -          m[3], m[7], m[11], m[15]);
>
>      FLUSH_VERTICES(ctx, 0);
>      _math_matrix_mul_floats( ctx->CurrentStack->Top, m );
> diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
> index c4fab9dbac2..d9a11bfe04a 100644
> --- a/src/mesa/main/mtypes.h
> +++ b/src/mesa/main/mtypes.h
> @@ -4868,36 +4868,14 @@ struct gl_memory_info
>   };
>
>   #ifdef DEBUG
> -extern int MESA_VERBOSE;
>   extern int MESA_DEBUG_FLAGS;
>   # define MESA_FUNCTION __func__
>   #else
> -# define MESA_VERBOSE 0
>   # define MESA_DEBUG_FLAGS 0
>   # define MESA_FUNCTION "a function"
>   #endif
>
>
> -/** The MESA_VERBOSE var is a bitmask of these flags */
> -enum _verbose
> -{
> -   VERBOSE_VARRAY		= 0x0001,
> -   VERBOSE_TEXTURE		= 0x0002,
> -   VERBOSE_MATERIAL		= 0x0004,
> -   VERBOSE_PIPELINE		= 0x0008,
> -   VERBOSE_DRIVER		= 0x0010,
> -   VERBOSE_STATE		= 0x0020,
> -   VERBOSE_API			= 0x0040,
> -   VERBOSE_DISPLAY_LIST		= 0x0100,
> -   VERBOSE_LIGHTING		= 0x0200,
> -   VERBOSE_PRIMS		= 0x0400,
> -   VERBOSE_VERTS		= 0x0800,
> -   VERBOSE_DISASSEM		= 0x1000,
> -   VERBOSE_DRAW                 = 0x2000,
> -   VERBOSE_SWAPBUFFERS          = 0x4000
> -};
> -
> -
>   /** The MESA_DEBUG_FLAGS var is a bitmask of these flags */
>   enum _debug
>   {
> diff --git a/src/mesa/main/performance_monitor.c b/src/mesa/main/performance_monitor.c
> index 65ea8437fd8..55ffa99e74b 100644
> --- a/src/mesa/main/performance_monitor.c
> +++ b/src/mesa/main/performance_monitor.c
> @@ -341,9 +341,6 @@ _mesa_GenPerfMonitorsAMD(GLsizei n, GLuint *monitors)
>      GLuint first;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGenPerfMonitorsAMD(%d)\n", n);
> -
>      init_groups(ctx);
>
>      if (n < 0) {
> @@ -382,9 +379,6 @@ _mesa_DeletePerfMonitorsAMD(GLsizei n, GLuint *monitors)
>      GLint i;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDeletePerfMonitorsAMD(%d)\n", n);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glDeletePerfMonitorsAMD(n < 0)");
>         return;
> diff --git a/src/mesa/main/pipelineobj.c b/src/mesa/main/pipelineobj.c
> index c1dd8d75c76..7fb76fe47ba 100644
> --- a/src/mesa/main/pipelineobj.c
> +++ b/src/mesa/main/pipelineobj.c
> @@ -244,10 +244,6 @@ _mesa_UseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
>      struct gl_shader_program *shProg = NULL;
>      GLbitfield any_valid_stages;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glUseProgramStages(%u, 0x%x, %u)\n",
> -                  pipeline, stages, program);
> -
>      if (!pipe) {
>         _mesa_error(ctx, GL_INVALID_OPERATION, "glUseProgramStages(pipeline)");
>         return;
> @@ -370,9 +366,6 @@ _mesa_ActiveShaderProgram(GLuint pipeline, GLuint program)
>      struct gl_shader_program *shProg = NULL;
>      struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glActiveShaderProgram(%u, %u)\n", pipeline, program);
> -
>      if (program != 0) {
>         shProg = _mesa_lookup_shader_program_err(ctx, program,
>                                                  "glActiveShaderProgram(program)");
> @@ -408,9 +401,6 @@ _mesa_BindProgramPipeline(GLuint pipeline)
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_pipeline_object *newObj = NULL;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBindProgramPipeline(%u)\n", pipeline);
> -
>      /* Rebinding the same pipeline object: no change.
>       */
>      if (ctx->_Shader->Name == pipeline)
> @@ -503,9 +493,6 @@ _mesa_DeleteProgramPipelines(GLsizei n, const GLuint *pipelines)
>      GET_CURRENT_CONTEXT(ctx);
>      GLsizei i;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDeleteProgramPipelines(%d, %p)\n", n, pipelines);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteProgramPipelines(n<0)");
>         return;
> @@ -590,9 +577,6 @@ _mesa_GenProgramPipelines(GLsizei n, GLuint *pipelines)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGenProgramPipelines(%d, %p)\n", n, pipelines);
> -
>      create_program_pipelines(ctx, n, pipelines, false);
>   }
>
> @@ -601,9 +585,6 @@ _mesa_CreateProgramPipelines(GLsizei n, GLuint *pipelines)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCreateProgramPipelines(%d, %p)\n", n, pipelines);
> -
>      create_program_pipelines(ctx, n, pipelines, true);
>   }
>
> @@ -619,9 +600,6 @@ _mesa_IsProgramPipeline(GLuint pipeline)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glIsProgramPipeline(%u)\n", pipeline);
> -
>      struct gl_pipeline_object *obj = _mesa_lookup_pipeline_object(ctx, pipeline);
>      if (obj == NULL)
>         return GL_FALSE;
> @@ -638,10 +616,6 @@ _mesa_GetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params)
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGetProgramPipelineiv(%u, %d, %p)\n",
> -                  pipeline, pname, params);
> -
>      /* Are geometry shaders available in this context?
>       */
>      const bool has_gs = _mesa_has_geometry_shaders(ctx);
> @@ -976,9 +950,6 @@ _mesa_ValidateProgramPipeline(GLuint pipeline)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glValidateProgramPipeline(%u)\n", pipeline);
> -
>      struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
>
>      if (!pipe) {
> @@ -996,10 +967,6 @@ _mesa_GetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGetProgramPipelineInfoLog(%u, %d, %p, %p)\n",
> -                  pipeline, bufSize, length, infoLog);
> -
>      struct gl_pipeline_object *pipe = _mesa_lookup_pipeline_object(ctx, pipeline);
>
>      if (!pipe) {
> diff --git a/src/mesa/main/polygon.c b/src/mesa/main/polygon.c
> index 1bb7190bc24..b51aee2392f 100644
> --- a/src/mesa/main/polygon.c
> +++ b/src/mesa/main/polygon.c
> @@ -55,9 +55,6 @@ _mesa_CullFace( GLenum mode )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glCullFace %s\n", _mesa_enum_to_string(mode));
> -
>      if (mode!=GL_FRONT && mode!=GL_BACK && mode!=GL_FRONT_AND_BACK) {
>         _mesa_error( ctx, GL_INVALID_ENUM, "glCullFace" );
>         return;
> @@ -90,9 +87,6 @@ _mesa_FrontFace( GLenum mode )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glFrontFace %s\n", _mesa_enum_to_string(mode));
> -
>      if (ctx->Polygon.FrontFace == mode)
>         return;
>
> @@ -126,11 +120,6 @@ _mesa_PolygonMode( GLenum face, GLenum mode )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glPolygonMode %s %s\n",
> -                  _mesa_enum_to_string(face),
> -                  _mesa_enum_to_string(mode));
> -
>      switch (mode) {
>      case GL_POINT:
>      case GL_LINE:
> @@ -191,9 +180,6 @@ _mesa_PolygonStipple(const GLubyte *pattern)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glPolygonStipple\n");
> -
>      FLUSH_VERTICES(ctx, _NEW_POLYGONSTIPPLE);
>
>      pattern = _mesa_map_validate_pbo_source(ctx, 2,
> @@ -221,9 +207,6 @@ _mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glGetPolygonStipple\n");
> -
>      dest = _mesa_map_validate_pbo_dest(ctx, 2,
>                                         &ctx->Pack, 32, 32, 1,
>                                         GL_COLOR_INDEX, GL_BITMAP,
> @@ -266,9 +249,6 @@ _mesa_PolygonOffset( GLfloat factor, GLfloat units )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glPolygonOffset %f %f\n", factor, units);
> -
>      _mesa_polygon_offset_clamp(ctx, factor, units, 0.0);
>   }
>
> @@ -292,9 +272,6 @@ _mesa_PolygonOffsetClampEXT( GLfloat factor, GLfloat units, GLfloat clamp )
>         return;
>      }
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glPolygonOffsetClampEXT %f %f %f\n", factor, units, clamp);
> -
>      _mesa_polygon_offset_clamp(ctx, factor, units, clamp);
>   }
>
> diff --git a/src/mesa/main/program_resource.c b/src/mesa/main/program_resource.c
> index 4eacdfb9e9a..3be658468b1 100644
> --- a/src/mesa/main/program_resource.c
> +++ b/src/mesa/main/program_resource.c
> @@ -90,12 +90,6 @@ _mesa_GetProgramInterfaceiv(GLuint program, GLenum programInterface,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glGetProgramInterfaceiv(%u, %s, %s, %p)\n",
> -                  program, _mesa_enum_to_string(programInterface),
> -                  _mesa_enum_to_string(pname), params);
> -   }
> -
>      unsigned i;
>      struct gl_shader_program *shProg =
>         _mesa_lookup_shader_program_err(ctx, program,
> @@ -264,11 +258,6 @@ _mesa_GetProgramResourceIndex(GLuint program, GLenum programInterface,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glGetProgramResourceIndex(%u, %s, %s)\n",
> -                  program, _mesa_enum_to_string(programInterface), name);
> -   }
> -
>      unsigned array_index = 0;
>      struct gl_program_resource *res;
>      struct gl_shader_program *shProg =
> @@ -335,12 +324,6 @@ _mesa_GetProgramResourceName(GLuint program, GLenum programInterface,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glGetProgramResourceName(%u, %s, %u, %d, %p, %p)\n",
> -                  program, _mesa_enum_to_string(programInterface), index,
> -                  bufSize, length, name);
> -   }
> -
>      struct gl_shader_program *shProg =
>         _mesa_lookup_shader_program_err(ctx, program,
>                                         "glGetProgramResourceName");
> @@ -368,12 +351,6 @@ _mesa_GetProgramResourceiv(GLuint program, GLenum programInterface,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glGetProgramResourceiv(%u, %s, %u, %d, %p, %d, %p, %p)\n",
> -                  program, _mesa_enum_to_string(programInterface), index,
> -                  propCount, props, bufSize, length, params);
> -   }
> -
>      struct gl_shader_program *shProg =
>         _mesa_lookup_shader_program_err(ctx, program, "glGetProgramResourceiv");
>
> @@ -399,11 +376,6 @@ _mesa_GetProgramResourceLocation(GLuint program, GLenum programInterface,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glGetProgramResourceLocation(%u, %s, %s)\n",
> -                  program, _mesa_enum_to_string(programInterface), name);
> -   }
> -
>      struct gl_shader_program *shProg =
>         lookup_linked_program(program, "glGetProgramResourceLocation");
>
> @@ -455,11 +427,6 @@ _mesa_GetProgramResourceLocationIndex(GLuint program, GLenum programInterface,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      _mesa_debug(ctx, "glGetProgramResourceLocationIndex(%u, %s, %s)\n",
> -                  program, _mesa_enum_to_string(programInterface), name);
> -   }
> -
>      struct gl_shader_program *shProg =
>         lookup_linked_program(program, "glGetProgramResourceLocationIndex");
>
> diff --git a/src/mesa/main/queryobj.c b/src/mesa/main/queryobj.c
> index e4edb519344..1a3ed8e64fe 100644
> --- a/src/mesa/main/queryobj.c
> +++ b/src/mesa/main/queryobj.c
> @@ -255,9 +255,6 @@ create_queries(struct gl_context *ctx, GLenum target, GLsizei n, GLuint *ids,
>      const char *func = dsa ? "glGenQueries" : "glCreateQueries";
>      GLuint first;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s(%d)\n", func, n);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", func);
>         return;
> @@ -323,9 +320,6 @@ _mesa_DeleteQueries(GLsizei n, const GLuint *ids)
>      GET_CURRENT_CONTEXT(ctx);
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDeleteQueries(%d)\n", n);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteQueriesARB(n < 0)");
>         return;
> @@ -361,9 +355,6 @@ _mesa_IsQuery(GLuint id)
>      GET_CURRENT_CONTEXT(ctx);
>      ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glIsQuery(%u)\n", id);
> -
>      if (id == 0)
>         return GL_FALSE;
>
> @@ -402,10 +393,6 @@ _mesa_BeginQueryIndexed(GLenum target, GLuint index, GLuint id)
>      struct gl_query_object *q, **bindpt;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glBeginQueryIndexed(%s, %u, %u)\n",
> -                  _mesa_enum_to_string(target), index, id);
> -
>      if (!query_error_check_index(ctx, target, index))
>         return;
>
> @@ -508,10 +495,6 @@ _mesa_EndQueryIndexed(GLenum target, GLuint index)
>      struct gl_query_object *q, **bindpt;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glEndQueryIndexed(%s, %u)\n",
> -                  _mesa_enum_to_string(target), index);
> -
>      if (!query_error_check_index(ctx, target, index))
>         return;
>
> @@ -565,10 +548,6 @@ _mesa_QueryCounter(GLuint id, GLenum target)
>      struct gl_query_object *q;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glQueryCounter(%u, %s)\n", id,
> -                  _mesa_enum_to_string(target));
> -
>      /* error checking */
>      if (target != GL_TIMESTAMP) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glQueryCounter(target)");
> @@ -640,12 +619,6 @@ _mesa_GetQueryIndexediv(GLenum target, GLuint index, GLenum pname,
>      struct gl_query_object *q = NULL, **bindpt = NULL;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glGetQueryIndexediv(%s, %u, %s)\n",
> -                  _mesa_enum_to_string(target),
> -                  index,
> -                  _mesa_enum_to_string(pname));
> -
>      if (!query_error_check_index(ctx, target, index))
>         return;
>
> @@ -762,10 +735,6 @@ get_query_object(struct gl_context *ctx, const char *func,
>      struct gl_query_object *q = NULL;
>      uint64_t value;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s(%u, %s)\n", func, id,
> -                  _mesa_enum_to_string(pname));
> -
>      if (id)
>         q = _mesa_lookup_query_object(ctx, id);
>
> diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
> index 606d1e58e5a..77c6ad839f6 100644
> --- a/src/mesa/main/readpix.c
> +++ b/src/mesa/main/readpix.c
> @@ -998,13 +998,6 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height,
>      FLUSH_VERTICES(ctx, 0);
>      FLUSH_CURRENT(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glReadPixels(%d, %d, %s, %s, %p)\n",
> -                  width, height,
> -                  _mesa_enum_to_string(format),
> -                  _mesa_enum_to_string(type),
> -                  pixels);
> -
>      if (width < 0 || height < 0) {
>         _mesa_error( ctx, GL_INVALID_VALUE,
>                      "glReadPixels(width=%d height=%d)", width, height );
> diff --git a/src/mesa/main/robustness.c b/src/mesa/main/robustness.c
> index 47402a29304..1a1e747b497 100644
> --- a/src/mesa/main/robustness.c
> +++ b/src/mesa/main/robustness.c
> @@ -121,15 +121,8 @@ _mesa_GetGraphicsResetStatusARB( void )
>       *     then the implementation will never deliver notification of reset
>       *     events, and GetGraphicsResetStatusARB will always return NO_ERROR."
>       */
> -   if (ctx->Const.ResetStrategy == GL_NO_RESET_NOTIFICATION_ARB) {
> -      if (MESA_VERBOSE & VERBOSE_API)
> -         _mesa_debug(ctx,
> -                     "glGetGraphicsResetStatusARB always returns GL_NO_ERROR "
> -                     "because reset notifictation was not requested at context "
> -                     "creation.\n");
> -
> +   if (ctx->Const.ResetStrategy == GL_NO_RESET_NOTIFICATION_ARB)
>         return GL_NO_ERROR;
> -   }
>
>      if (ctx->Driver.GetGraphicsResetStatus) {
>         /* Query the reset status of this context from the driver core.
> @@ -156,10 +149,5 @@ _mesa_GetGraphicsResetStatusARB( void )
>      if (status != GL_NO_ERROR)
>         _mesa_set_context_lost_dispatch(ctx);
>
> -   if (!ctx->Driver.GetGraphicsResetStatus && (MESA_VERBOSE & VERBOSE_API))
> -      _mesa_debug(ctx,
> -                  "glGetGraphicsResetStatusARB always returns GL_NO_ERROR "
> -                  "because the driver doesn't track reset status.\n");
> -
>      return status;
>   }
> diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
> index 183f1d2a862..85bc3fe020c 100644
> --- a/src/mesa/main/samplerobj.c
> +++ b/src/mesa/main/samplerobj.c
> @@ -160,9 +160,6 @@ create_samplers(struct gl_context *ctx, GLsizei count, GLuint *samplers,
>      GLuint first;
>      GLint i;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s(%d)\n", caller, count);
> -
>      if (count < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "%s(n<0)", caller);
>         return;
> diff --git a/src/mesa/main/scissor.c b/src/mesa/main/scissor.c
> index 631ea4d3205..a49e8c83777 100644
> --- a/src/mesa/main/scissor.c
> +++ b/src/mesa/main/scissor.c
> @@ -64,9 +64,6 @@ _mesa_Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
>      unsigned i;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glScissor %d %d %d %d\n", x, y, width, height);
> -
>      if (width < 0 || height < 0) {
>         _mesa_error( ctx, GL_INVALID_VALUE, "glScissor" );
>         return;
> @@ -174,10 +171,6 @@ ScissorIndexed(GLuint index, GLint left, GLint bottom,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s(%d, %d, %d, %d, %d)\n",
> -                  function, index, left, bottom, width, height);
> -
>      if (index >= ctx->Const.MaxViewports) {
>         _mesa_error(ctx, GL_INVALID_VALUE,
>                     "%s: index (%d) >= MaxViewports (%d)",
> @@ -218,10 +211,6 @@ _mesa_WindowRectanglesEXT(GLenum mode, GLsizei count, const GLint *box)
>      struct gl_scissor_rect newval[MAX_WINDOW_RECTANGLES];
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glWindowRectanglesEXT(%s, %d, %p)\n",
> -                  _mesa_enum_to_string(mode), count, box);
> -
>      if (mode != GL_INCLUSIVE_EXT && mode != GL_EXCLUSIVE_EXT) {
>         _mesa_error(ctx, GL_INVALID_ENUM,
>                     "glWindowRectanglesEXT(invalid mode 0x%x)", mode);
> diff --git a/src/mesa/main/shaderapi.c b/src/mesa/main/shaderapi.c
> index 187475f1277..bbf61f21a77 100644
> --- a/src/mesa/main/shaderapi.c
> +++ b/src/mesa/main/shaderapi.c
> @@ -1396,8 +1396,6 @@ void GLAPIENTRY
>   _mesa_CompileShader(GLuint shaderObj)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCompileShader %u\n", shaderObj);
>      _mesa_compile_shader(ctx, _mesa_lookup_shader_err(ctx, shaderObj,
>                                                        "glCompileShader"));
>   }
> @@ -1407,8 +1405,6 @@ GLuint GLAPIENTRY
>   _mesa_CreateShader(GLenum type)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCreateShader %s\n", _mesa_enum_to_string(type));
>      return create_shader(ctx, type);
>   }
>
> @@ -1425,8 +1421,6 @@ GLuint GLAPIENTRY
>   _mesa_CreateProgram(void)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glCreateProgram\n");
>      return create_shader_program(ctx);
>   }
>
> @@ -1442,11 +1436,6 @@ _mesa_CreateProgramObjectARB(void)
>   void GLAPIENTRY
>   _mesa_DeleteObjectARB(GLhandleARB obj)
>   {
> -   if (MESA_VERBOSE & VERBOSE_API) {
> -      GET_CURRENT_CONTEXT(ctx);
> -      _mesa_debug(ctx, "glDeleteObjectARB(%lu)\n", (unsigned long)obj);
> -   }
> -
>      if (obj) {
>         GET_CURRENT_CONTEXT(ctx);
>         FLUSH_VERTICES(ctx, 0);
> @@ -1644,8 +1633,6 @@ void GLAPIENTRY
>   _mesa_LinkProgram(GLuint programObj)
>   {
>      GET_CURRENT_CONTEXT(ctx);
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLinkProgram %u\n", programObj);
>      _mesa_link_program(ctx, _mesa_lookup_shader_program_err(ctx, programObj,
>                                                              "glLinkProgram"));
>   }
> @@ -1861,9 +1848,6 @@ _mesa_UseProgram(GLuint program)
>      GET_CURRENT_CONTEXT(ctx);
>      struct gl_shader_program *shProg;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glUseProgram %u\n", program);
> -
>      if (_mesa_is_xfb_active_and_unpaused(ctx)) {
>         _mesa_error(ctx, GL_INVALID_OPERATION,
>                     "glUseProgram(transform feedback active)");
> diff --git a/src/mesa/main/state.c b/src/mesa/main/state.c
> index 5a760f5e5d0..7f80e7c924e 100644
> --- a/src/mesa/main/state.c
> +++ b/src/mesa/main/state.c
> @@ -338,9 +338,6 @@ _mesa_update_state_locked( struct gl_context *ctx )
>      if ((new_state & computed_states) == 0)
>         goto out;
>
> -   if (MESA_VERBOSE & VERBOSE_STATE)
> -      _mesa_print_state("_mesa_update_state", new_state);
> -
>      /* Determine which state flags effect vertex/fragment program state */
>      if (ctx->FragmentProgram._MaintainTexEnvProgram) {
>         prog_flags |= (_NEW_BUFFERS | _NEW_TEXTURE_OBJECT | _NEW_FOG |
> diff --git a/src/mesa/main/stencil.c b/src/mesa/main/stencil.c
> index b303bb7c13f..45da921c907 100644
> --- a/src/mesa/main/stencil.c
> +++ b/src/mesa/main/stencil.c
> @@ -109,9 +109,6 @@ _mesa_ClearStencil( GLint s )
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glClearStencil(%d)\n", s);
> -
>      ctx->Stencil.Clear = (GLuint) s;
>   }
>
> @@ -135,9 +132,6 @@ _mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLui
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilFuncSeparateATI()\n");
> -
>      if (!validate_stencil_func(ctx, frontfunc)) {
>         _mesa_error(ctx, GL_INVALID_ENUM,
>                     "glStencilFuncSeparateATI(frontfunc)");
> @@ -190,9 +184,6 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask )
>      GET_CURRENT_CONTEXT(ctx);
>      const GLint face = ctx->Stencil.ActiveFace;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilFunc()\n");
> -
>      if (!validate_stencil_func(ctx, func)) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFunc(func)");
>         return;
> @@ -255,9 +246,6 @@ _mesa_StencilMask( GLuint mask )
>      GET_CURRENT_CONTEXT(ctx);
>      const GLint face = ctx->Stencil.ActiveFace;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilMask()\n");
> -
>      if (face != 0) {
>         /* Only modify the EXT_stencil_two_side back-face state.
>          */
> @@ -310,9 +298,6 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
>      GET_CURRENT_CONTEXT(ctx);
>      const GLint face = ctx->Stencil.ActiveFace;
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilOp()\n");
> -
>      if (!validate_stencil_op(ctx, fail)) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOp(sfail)");
>         return;
> @@ -374,9 +359,6 @@ _mesa_ActiveStencilFaceEXT(GLenum face)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glActiveStencilFaceEXT()\n");
> -
>      if (!ctx->Extensions.EXT_stencil_two_side) {
>         _mesa_error(ctx, GL_INVALID_OPERATION, "glActiveStencilFaceEXT");
>         return;
> @@ -398,9 +380,6 @@ _mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass)
>      GLboolean set = GL_FALSE;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilOpSeparate()\n");
> -
>      if (!validate_stencil_op(ctx, sfail)) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(sfail)");
>         return;
> @@ -454,9 +433,6 @@ _mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilFuncSeparate()\n");
> -
>      if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)");
>         return;
> @@ -492,9 +468,6 @@ _mesa_StencilMaskSeparate(GLenum face, GLuint mask)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glStencilMaskSeparate()\n");
> -
>      if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glStencilaMaskSeparate(face)");
>         return;
> diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c
> index ee5171c5c6a..24bb97e1bac 100644
> --- a/src/mesa/main/texenv.c
> +++ b/src/mesa/main/texenv.c
> @@ -488,13 +488,6 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param )
>         return;
>      }
>
> -   if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glTexEnv %s %s %.1f(%s) ...\n",
> -                  _mesa_enum_to_string(target),
> -                  _mesa_enum_to_string(pname),
> -                  *param,
> -                  _mesa_enum_to_string((GLenum) iparam0));
> -
>      /* Tell device driver about the new texture environment */
>      if (ctx->Driver.TexEnv) {
>         ctx->Driver.TexEnv(ctx, target, pname, param);
> diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c
> index 1b8d187cd3b..cb2602ad155 100644
> --- a/src/mesa/main/texgen.c
> +++ b/src/mesa/main/texgen.c
> @@ -74,13 +74,6 @@ _mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params )
>      struct gl_texgen *texgen;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&(VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glTexGen %s %s %.1f(%s)...\n",
> -                  _mesa_enum_to_string(coord),
> -                  _mesa_enum_to_string(pname),
> -                  *params,
> -		  _mesa_enum_to_string((GLenum) (GLint) *params));
> -
>      if (ctx->Texture.CurrentUnit >= ctx->Const.MaxTextureCoordUnits) {
>         _mesa_error(ctx, GL_INVALID_OPERATION, "glTexGen(current unit)");
>         return;
> diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
> index 658b0e58e6d..72fcc0b972f 100644
> --- a/src/mesa/main/texgetimage.c
> +++ b/src/mesa/main/texgetimage.c
> @@ -1311,15 +1311,6 @@ get_texture_image(struct gl_context *ctx,
>         return;
>      }
>
> -   if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) {
> -      _mesa_debug(ctx, "%s(tex %u) format = %s, w=%d, h=%d,"
> -                  " dstFmt=0x%x, dstType=0x%x\n",
> -                  caller, texObj->Name,
> -                  _mesa_get_format_name(texImage->TexFormat),
> -                  texImage->Width, texImage->Height,
> -                  format, type);
> -   }
> -
>      if (target == GL_TEXTURE_CUBE_MAP) {
>         /* Compute stride between cube faces */
>         imageStride = _mesa_image_image_stride(&ctx->Pack, width, height,
> @@ -1630,14 +1621,6 @@ get_compressed_texture_image(struct gl_context *ctx,
>      if (_mesa_is_zero_size_texture(texImage))
>         return;
>
> -   if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE)) {
> -      _mesa_debug(ctx,
> -                  "%s(tex %u) format = %s, w=%d, h=%d\n",
> -                  caller, texObj->Name,
> -                  _mesa_get_format_name(texImage->TexFormat),
> -                  texImage->Width, texImage->Height);
> -   }
> -
>      if (target == GL_TEXTURE_CUBE_MAP) {
>         struct compressed_pixelstore store;
>
> diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
> index 1a00d251324..7029dc3b4c6 100644
> --- a/src/mesa/main/teximage.c
> +++ b/src/mesa/main/teximage.c
> @@ -2870,25 +2870,6 @@ teximage(struct gl_context *ctx, GLboolean compressed, GLuint dims,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) {
> -      if (compressed)
> -         _mesa_debug(ctx,
> -                     "glCompressedTexImage%uD %s %d %s %d %d %d %d %p\n",
> -                     dims,
> -                     _mesa_enum_to_string(target), level,
> -                     _mesa_enum_to_string(internalFormat),
> -                     width, height, depth, border, pixels);
> -      else
> -         _mesa_debug(ctx,
> -                     "glTexImage%uD %s %d %s %d %d %d %d %s %s %p\n",
> -                     dims,
> -                     _mesa_enum_to_string(target), level,
> -                     _mesa_enum_to_string(internalFormat),
> -                     width, height, depth, border,
> -                     _mesa_enum_to_string(format),
> -                     _mesa_enum_to_string(type), pixels);
> -   }
> -
>      internalFormat = override_internal_format(internalFormat, width, height);
>
>      /* target error checking */
> @@ -3268,14 +3249,6 @@ texsubimage(struct gl_context *ctx, GLuint dims, GLenum target, GLint level,
>      texImage = _mesa_select_tex_image(texObj, target, level);
>      /* texsubimage_error_check ensures that texImage is not NULL */
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glTexSubImage%uD %s %d %d %d %d %d %d %d %s %s %p\n",
> -                  dims,
> -                  _mesa_enum_to_string(target), level,
> -                  xoffset, yoffset, zoffset, width, height, depth,
> -                  _mesa_enum_to_string(format),
> -                  _mesa_enum_to_string(type), pixels);
> -
>      _mesa_texture_sub_image(ctx, dims, texObj, texImage, target, level,
>                              xoffset, yoffset, zoffset, width, height, depth,
>                              format, type, pixels, false);
> @@ -3298,14 +3271,6 @@ texturesubimage(struct gl_context *ctx, GLuint dims,
>      struct gl_texture_image *texImage;
>      int i;
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx,
> -                  "glTextureSubImage%uD %d %d %d %d %d %d %d %d %s %s %p\n",
> -                  dims, texture, level,
> -                  xoffset, yoffset, zoffset, width, height, depth,
> -                  _mesa_enum_to_string(format),
> -                  _mesa_enum_to_string(type), pixels);
> -
>      /* Get the texture object by Name. */
>      texObj = _mesa_lookup_texture(ctx, texture);
>      if (!texObj) {
> @@ -3594,13 +3559,6 @@ copyteximage(struct gl_context *ctx, GLuint dims,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glCopyTexImage%uD %s %d %s %d %d %d %d %d\n",
> -                  dims,
> -                  _mesa_enum_to_string(target), level,
> -                  _mesa_enum_to_string(internalFormat),
> -                  x, y, width, height, border);
> -
>      if (ctx->NewState & NEW_COPY_TEX_STATE)
>         _mesa_update_state(ctx);
>
> @@ -3774,11 +3732,6 @@ _mesa_copy_texture_sub_image(struct gl_context *ctx, GLuint dims,
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "%s %s %d %d %d %d %d %d %d %d\n", caller,
> -                  _mesa_enum_to_string(target),
> -                  level, xoffset, yoffset, zoffset, x, y, width, height);
> -
>      if (ctx->NewState & NEW_COPY_TEX_STATE)
>         _mesa_update_state(ctx);
>
> @@ -5346,11 +5299,6 @@ texture_image_multisample(struct gl_context *ctx, GLuint dims,
>      GLenum sample_count_error;
>      bool dsa = strstr(func, "ture") ? true : false;
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) {
> -      _mesa_debug(ctx, "%s(target=%s, samples=%d)\n", func,
> -                  _mesa_enum_to_string(target), samples);
> -   }
> -
>      if (!((ctx->Extensions.ARB_texture_multisample
>            && _mesa_is_desktop_gl(ctx))) && !_mesa_is_gles31(ctx)) {
>         _mesa_error(ctx, GL_INVALID_OPERATION, "%s(unsupported)", func);
> diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
> index ad644ca1ca3..40f83ad9cc4 100644
> --- a/src/mesa/main/texobj.c
> +++ b/src/mesa/main/texobj.c
> @@ -1190,9 +1190,6 @@ create_textures(struct gl_context *ctx, GLenum target,
>      GLuint first;
>      GLint i;
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "%s %d\n", caller, n);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "%s(n < 0)", caller);
>         return;
> @@ -1424,9 +1421,6 @@ _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);
> -
>      if (n < 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteTextures(n < 0)");
>         return;
> @@ -1657,10 +1651,6 @@ _mesa_BindTexture( GLenum target, GLuint texName )
>      struct gl_texture_object *newTexObj = NULL;
>      GLint targetIndex;
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glBindTexture %s %d\n",
> -                  _mesa_enum_to_string(target), (GLint) texName);
> -
>      targetIndex = _mesa_tex_target_to_index(ctx, target);
>      if (targetIndex < 0) {
>         _mesa_error(ctx, GL_INVALID_ENUM, "glBindTexture(target)");
> @@ -1742,10 +1732,6 @@ _mesa_BindTextureUnit(GLuint unit, GLuint texture)
>         return;
>      }
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glBindTextureUnit %s %d\n",
> -                  _mesa_enum_to_string(GL_TEXTURE0+unit), (GLint) texture);
> -
>      /* Section 8.1 (Texture Objects) of the OpenGL 4.5 core profile spec
>       * (20141030) says:
>       *    "When texture is zero, each of the targets enumerated at the
> @@ -1880,9 +1866,6 @@ _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) {
> @@ -1928,9 +1911,6 @@ _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;
> @@ -1976,9 +1956,6 @@ _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;
>
> @@ -2029,9 +2006,6 @@ _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");
>
> @@ -2172,9 +2146,6 @@ _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");
>
> diff --git a/src/mesa/main/texstate.c b/src/mesa/main/texstate.c
> index 830b230b5d7..026a3b7cfdb 100644
> --- a/src/mesa/main/texstate.c
> +++ b/src/mesa/main/texstate.c
> @@ -289,10 +289,6 @@ _mesa_ActiveTexture(GLenum texture)
>      GLuint k;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glActiveTexture %s\n",
> -                  _mesa_enum_to_string(texture));
> -
>      if (ctx->Texture.CurrentUnit == texUnit)
>         return;
>
> @@ -323,10 +319,6 @@ _mesa_ClientActiveTexture(GLenum texture)
>      GET_CURRENT_CONTEXT(ctx);
>      GLuint texUnit = texture - GL_TEXTURE0;
>
> -   if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glClientActiveTexture %s\n",
> -                  _mesa_enum_to_string(texture));
> -
>      if (ctx->Array.ActiveTexture == texUnit)
>         return;
>
> diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c
> index 817a7464d9f..bc8e09f7458 100644
> --- a/src/mesa/main/texstorage.c
> +++ b/src/mesa/main/texstorage.c
> @@ -490,13 +490,6 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat,
>         return;
>      }
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glTexStorage%uD %s %d %s %d %d %d\n",
> -                  dims,
> -                  _mesa_enum_to_string(target), levels,
> -                  _mesa_enum_to_string(internalformat),
> -                  width, height, depth);
> -
>      /* Check the format to make sure it is sized. */
>      if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
>         _mesa_error(ctx, GL_INVALID_ENUM,
> @@ -525,12 +518,6 @@ texturestorage(GLuint dims, GLuint texture, GLsizei levels,
>      struct gl_texture_object *texObj;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glTextureStorage%uD %d %d %s %d %d %d\n",
> -                  dims, texture, levels,
> -                  _mesa_enum_to_string(internalformat),
> -                  width, height, depth);
> -
>      /* Check the format to make sure it is sized. */
>      if (!_mesa_is_legal_tex_storage_format(ctx, internalformat)) {
>         _mesa_error(ctx, GL_INVALID_ENUM,
> diff --git a/src/mesa/main/textureview.c b/src/mesa/main/textureview.c
> index ed66c179589..9a3296d295b 100644
> --- a/src/mesa/main/textureview.c
> +++ b/src/mesa/main/textureview.c
> @@ -536,12 +536,6 @@ _mesa_TextureView(GLuint texture, GLenum target, GLuint origtexture,
>
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & (VERBOSE_API | VERBOSE_TEXTURE))
> -      _mesa_debug(ctx, "glTextureView %d %s %d %s %d %d %d %d\n",
> -                  texture, _mesa_enum_to_string(target), origtexture,
> -                  _mesa_enum_to_string(internalformat),
> -                  minlevel, numlevels, minlayer, numlayers);
> -
>      if (origtexture == 0) {
>         _mesa_error(ctx, GL_INVALID_VALUE, "glTextureView(origtexture = %u)",
>                     origtexture);
> diff --git a/src/mesa/main/varray.c b/src/mesa/main/varray.c
> index e1d6bc677f5..336797e21fc 100644
> --- a/src/mesa/main/varray.c
> +++ b/src/mesa/main/varray.c
> @@ -1652,9 +1652,6 @@ _mesa_LockArraysEXT(GLint first, GLsizei count)
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glLockArrays %d %d\n", first, count);
> -
>      if (first < 0) {
>         _mesa_error( ctx, GL_INVALID_VALUE, "glLockArraysEXT(first)" );
>         return;
> @@ -1682,9 +1679,6 @@ _mesa_UnlockArraysEXT( void )
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glUnlockArrays\n");
> -
>      if (ctx->Array.LockCount == 0) {
>         _mesa_error( ctx, GL_INVALID_OPERATION, "glUnlockArraysEXT(reexit)" );
>         return;
> diff --git a/src/mesa/main/viewport.c b/src/mesa/main/viewport.c
> index bd580446f76..4e7ea09a066 100644
> --- a/src/mesa/main/viewport.c
> +++ b/src/mesa/main/viewport.c
> @@ -97,9 +97,6 @@ _mesa_Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
>      GET_CURRENT_CONTEXT(ctx);
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glViewport %d %d %d %d\n", x, y, width, height);
> -
>      if (width < 0 || height < 0) {
>         _mesa_error(ctx,  GL_INVALID_VALUE,
>                      "glViewport(%d, %d, %d, %d)", x, y, width, height);
> @@ -160,9 +157,6 @@ _mesa_ViewportArrayv(GLuint first, GLsizei count, const GLfloat *v)
>      const struct gl_viewport_inputs *const p = (struct gl_viewport_inputs *) v;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glViewportArrayv %d %d\n", first, count);
> -
>      if ((first + count) > ctx->Const.MaxViewports) {
>         _mesa_error(ctx, GL_INVALID_VALUE,
>                     "glViewportArrayv: first (%d) + count (%d) > MaxViewports "
> @@ -197,10 +191,6 @@ ViewportIndexedf(GLuint index, GLfloat x, GLfloat y,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "%s(%d, %f, %f, %f, %f)\n",
> -                  function, index, x, y, w, h);
> -
>      if (index >= ctx->Const.MaxViewports) {
>         _mesa_error(ctx, GL_INVALID_VALUE,
>                     "%s: index (%d) >= MaxViewports (%d)",
> @@ -271,9 +261,6 @@ _mesa_DepthRange(GLclampd nearval, GLclampd farval)
>
>      FLUSH_VERTICES(ctx, 0);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthRange %f %f\n", nearval, farval);
> -
>      /* The GL_ARB_viewport_array spec says:
>       *
>       *     "DepthRange sets the depth range for all viewports to the same
> @@ -315,9 +302,6 @@ _mesa_DepthRangeArrayv(GLuint first, GLsizei count, const GLclampd *v)
>         (struct gl_depthrange_inputs *) v;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthRangeArrayv %d %d\n", first, count);
> -
>      if ((first + count) > ctx->Const.MaxViewports) {
>         _mesa_error(ctx, GL_INVALID_VALUE,
>                     "glDepthRangev: first (%d) + count (%d) >= MaxViewports (%d)",
> @@ -338,9 +322,6 @@ _mesa_DepthRangeArrayfvOES(GLuint first, GLsizei count, const GLfloat *v)
>      int i;
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthRangeArrayfv %d %d\n", first, count);
> -
>      if ((first + count) > ctx->Const.MaxViewports) {
>         _mesa_error(ctx, GL_INVALID_VALUE,
>                     "glDepthRangeArrayfv: first (%d) + count (%d) >= MaxViewports (%d)",
> @@ -369,10 +350,6 @@ _mesa_DepthRangeIndexed(GLuint index, GLclampd nearval, GLclampd farval)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_API)
> -      _mesa_debug(ctx, "glDepthRangeIndexed(%d, %f, %f)\n",
> -                  index, nearval, farval);
> -
>      if (index >= ctx->Const.MaxViewports) {
>         _mesa_error(ctx, GL_INVALID_VALUE,
>                     "glDepthRangeIndexed: index (%d) >= MaxViewports (%d)",
> @@ -420,11 +397,6 @@ _mesa_ClipControl(GLenum origin, GLenum depth)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE&VERBOSE_API)
> -      _mesa_debug(ctx, "glClipControl(%s, %s)\n",
> -	          _mesa_enum_to_string(origin),
> -                  _mesa_enum_to_string(depth));
> -
>      ASSERT_OUTSIDE_BEGIN_END(ctx);
>
>      if (!ctx->Extensions.ARB_clip_control) {
> diff --git a/src/mesa/tnl/t_vb_render.c b/src/mesa/tnl/t_vb_render.c
> index 9ff1f18f53b..2709fa4ea49 100644
> --- a/src/mesa/tnl/t_vb_render.c
> +++ b/src/mesa/tnl/t_vb_render.c
> @@ -314,11 +314,6 @@ static GLboolean run_render( struct gl_context *ctx,
>
>   	 assert((prim & PRIM_MODE_MASK) <= GL_POLYGON);
>
> -	 if (MESA_VERBOSE & VERBOSE_PRIMS)
> -	    _mesa_debug(NULL, "MESA prim %s %d..%d\n",
> -			_mesa_enum_to_string(prim & PRIM_MODE_MASK),
> -			start, start+length);
> -
>   	 if (length)
>   	    tab[prim & PRIM_MODE_MASK]( ctx, start, start + length, prim );
>         }
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 1bf4b11da2e..a0b1e1704e4 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -621,10 +621,6 @@ vbo_exec_DrawArrays(GLenum mode, GLint start, GLsizei count)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawArrays(%s, %d, %d)\n",
> -                  _mesa_enum_to_string(mode), start, count);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -655,11 +651,6 @@ vbo_exec_DrawArraysInstanced(GLenum mode, GLint start, GLsizei count,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawArraysInstanced(%s, %d, %d, %d)\n",
> -                  _mesa_enum_to_string(mode), start, count, numInstances);
> -
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -691,12 +682,6 @@ vbo_exec_DrawArraysInstancedBaseInstance(GLenum mode, GLint first,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx,
> -                  "glDrawArraysInstancedBaseInstance(%s, %d, %d, %d, %d)\n",
> -                  _mesa_enum_to_string(mode), first, count,
> -                  numInstances, baseInstance);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -728,11 +713,6 @@ vbo_exec_MultiDrawArrays(GLenum mode, const GLint *first,
>      GET_CURRENT_CONTEXT(ctx);
>      GLint i;
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx,
> -                  "glMultiDrawArrays(%s, %p, %p, %d)\n",
> -                  _mesa_enum_to_string(mode), first, count, primcount);
> -
>      if (!_mesa_validate_MultiDrawArrays(ctx, mode, count, primcount))
>         return;
>
> @@ -937,12 +917,6 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end,
>
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx,
> -                  "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n",
> -                  _mesa_enum_to_string(mode), start, end, count,
> -                  _mesa_enum_to_string(type), indices, basevertex);
> -
>      if (!_mesa_validate_DrawRangeElements(ctx, mode, start, end, count,
>                                            type, indices))
>         return;
> @@ -1011,14 +985,6 @@ static void GLAPIENTRY
>   vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end,
>                              GLsizei count, GLenum type, const GLvoid * indices)
>   {
> -   if (MESA_VERBOSE & VERBOSE_DRAW) {
> -      GET_CURRENT_CONTEXT(ctx);
> -      _mesa_debug(ctx,
> -                  "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n",
> -                  _mesa_enum_to_string(mode), start, end, count,
> -                  _mesa_enum_to_string(type), indices);
> -   }
> -
>      vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type,
>                                           indices, 0);
>   }
> @@ -1033,11 +999,6 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
> -                  _mesa_enum_to_string(mode), count,
> -                  _mesa_enum_to_string(type), indices);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1062,11 +1023,6 @@ vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
> -                  _mesa_enum_to_string(mode), count,
> -                  _mesa_enum_to_string(type), indices);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1091,11 +1047,6 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawElements(%s, %u, %s, %p)\n",
> -                  _mesa_enum_to_string(mode), count,
> -                  _mesa_enum_to_string(type), indices);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1123,14 +1074,6 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx,
> -                  "glDrawElementsInstancedBaseVertex"
> -                  "(%s, %d, %s, %p, %d; %d)\n",
> -                  _mesa_enum_to_string(mode), count,
> -                  _mesa_enum_to_string(type), indices,
> -                  numInstances, basevertex);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1160,14 +1103,6 @@ vbo_exec_DrawElementsInstancedBaseInstance(GLenum mode, GLsizei count,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx,
> -                  "glDrawElementsInstancedBaseInstance"
> -                  "(%s, %d, %s, %p, %d, %d)\n",
> -                  _mesa_enum_to_string(mode), count,
> -                  _mesa_enum_to_string(type), indices,
> -                  numInstances, baseInstance);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1199,14 +1134,6 @@ vbo_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx,
> -                  "glDrawElementsInstancedBaseVertexBaseInstance"
> -                  "(%s, %d, %s, %p, %d, %d, %d)\n",
> -                  _mesa_enum_to_string(mode), count,
> -                  _mesa_enum_to_string(type), indices,
> -                  numInstances, basevertex, baseInstance);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1466,10 +1393,6 @@ vbo_exec_DrawTransformFeedback(GLenum mode, GLuint name)
>      struct gl_transform_feedback_object *obj =
>         _mesa_lookup_transform_feedback_object(ctx, name);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawTransformFeedback(%s, %d)\n",
> -                  _mesa_enum_to_string(mode), name);
> -
>      vbo_draw_transform_feedback(ctx, mode, obj, 0, 1);
>   }
>
> @@ -1481,10 +1404,6 @@ vbo_exec_DrawTransformFeedbackStream(GLenum mode, GLuint name, GLuint stream)
>      struct gl_transform_feedback_object *obj =
>         _mesa_lookup_transform_feedback_object(ctx, name);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawTransformFeedbackStream(%s, %u, %u)\n",
> -                  _mesa_enum_to_string(mode), name, stream);
> -
>      vbo_draw_transform_feedback(ctx, mode, obj, stream, 1);
>   }
>
> @@ -1497,10 +1416,6 @@ vbo_exec_DrawTransformFeedbackInstanced(GLenum mode, GLuint name,
>      struct gl_transform_feedback_object *obj =
>         _mesa_lookup_transform_feedback_object(ctx, name);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawTransformFeedbackInstanced(%s, %d)\n",
> -                  _mesa_enum_to_string(mode), name);
> -
>      vbo_draw_transform_feedback(ctx, mode, obj, 0, primcount);
>   }
>
> @@ -1514,11 +1429,6 @@ vbo_exec_DrawTransformFeedbackStreamInstanced(GLenum mode, GLuint name,
>      struct gl_transform_feedback_object *obj =
>         _mesa_lookup_transform_feedback_object(ctx, name);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawTransformFeedbackStreamInstanced"
> -                  "(%s, %u, %u, %i)\n",
> -                  _mesa_enum_to_string(mode), name, stream, primcount);
> -
>      vbo_draw_transform_feedback(ctx, mode, obj, stream, primcount);
>   }
>
> @@ -1628,10 +1538,6 @@ vbo_exec_DrawArraysIndirect(GLenum mode, const GLvoid *indirect)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawArraysIndirect(%s, %p)\n",
> -                  _mesa_enum_to_string(mode), indirect);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1654,11 +1560,6 @@ vbo_exec_DrawElementsIndirect(GLenum mode, GLenum type, const GLvoid *indirect)
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glDrawElementsIndirect(%s, %s, %p)\n",
> -                  _mesa_enum_to_string(mode),
> -                  _mesa_enum_to_string(type), indirect);
> -
>      if (_mesa_is_no_error_enabled(ctx)) {
>         FLUSH_CURRENT(ctx, 0);
>
> @@ -1682,10 +1583,6 @@ vbo_exec_MultiDrawArraysIndirect(GLenum mode, const GLvoid *indirect,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glMultiDrawArraysIndirect(%s, %p, %i, %i)\n",
> -                  _mesa_enum_to_string(mode), indirect, primcount, stride);
> -
>      /* If <stride> is zero, the array elements are treated as tightly packed. */
>      if (stride == 0)
>         stride = 4 * sizeof(GLuint);      /* sizeof(DrawArraysIndirectCommand) */
> @@ -1709,11 +1606,6 @@ vbo_exec_MultiDrawElementsIndirect(GLenum mode, GLenum type,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glMultiDrawElementsIndirect(%s, %s, %p, %i, %i)\n",
> -                  _mesa_enum_to_string(mode),
> -                  _mesa_enum_to_string(type), indirect, primcount, stride);
> -
>      /* If <stride> is zero, the array elements are treated as tightly packed. */
>      if (stride == 0)
>         stride = 5 * sizeof(GLuint);      /* sizeof(DrawElementsIndirectCommand) */
> @@ -1797,13 +1689,6 @@ vbo_exec_MultiDrawArraysIndirectCount(GLenum mode, GLintptr indirect,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glMultiDrawArraysIndirectCountARB"
> -                  "(%s, %lx, %lx, %i, %i)\n",
> -                  _mesa_enum_to_string(mode),
> -                  (unsigned long) indirect, (unsigned long) drawcount,
> -                  maxdrawcount, stride);
> -
>      /* If <stride> is zero, the array elements are treated as tightly packed. */
>      if (stride == 0)
>         stride = 4 * sizeof(GLuint);      /* sizeof(DrawArraysIndirectCommand) */
> @@ -1828,13 +1713,6 @@ vbo_exec_MultiDrawElementsIndirectCount(GLenum mode, GLenum type,
>   {
>      GET_CURRENT_CONTEXT(ctx);
>
> -   if (MESA_VERBOSE & VERBOSE_DRAW)
> -      _mesa_debug(ctx, "glMultiDrawElementsIndirectCountARB"
> -                  "(%s, %s, %lx, %lx, %i, %i)\n",
> -                  _mesa_enum_to_string(mode), _mesa_enum_to_string(type),
> -                  (unsigned long) indirect, (unsigned long) drawcount,
> -                  maxdrawcount, stride);
> -
>      /* If <stride> is zero, the array elements are treated as tightly packed. */
>      if (stride == 0)
>         stride = 5 * sizeof(GLuint);      /* sizeof(DrawElementsIndirectCommand) */
>



More information about the mesa-dev mailing list