[Mesa-dev] [PATCH 02/13] mesa: Remove debugging code from _mesa_reference_*.

Matt Turner mattst88 at gmail.com
Thu Aug 6 17:10:52 PDT 2015


---
 src/mesa/main/arrayobj.c     |  8 --------
 src/mesa/main/bufferobj.c    | 17 -----------------
 src/mesa/main/renderbuffer.c |  2 --
 src/mesa/main/samplerobj.c   |  8 --------
 src/mesa/main/shaderobj.c    | 12 ------------
 src/mesa/program/program.c   | 14 --------------
 6 files changed, 61 deletions(-)

diff --git a/src/mesa/main/arrayobj.c b/src/mesa/main/arrayobj.c
index 7c40040..2885143 100644
--- a/src/mesa/main/arrayobj.c
+++ b/src/mesa/main/arrayobj.c
@@ -200,10 +200,6 @@ _mesa_reference_vao_(struct gl_context *ctx,
       mtx_lock(&oldObj->Mutex);
       assert(oldObj->RefCount > 0);
       oldObj->RefCount--;
-#if 0
-      printf("ArrayObj %p %d DECR to %d\n",
-             (void *) oldObj, oldObj->Name, oldObj->RefCount);
-#endif
       deleteFlag = (oldObj->RefCount == 0);
       mtx_unlock(&oldObj->Mutex);
 
@@ -227,10 +223,6 @@ _mesa_reference_vao_(struct gl_context *ctx,
       }
       else {
          vao->RefCount++;
-#if 0
-         printf("ArrayObj %p %d INCR to %d\n",
-                (void *) vao, vao->Name, vao->RefCount);
-#endif
          *ptr = vao;
       }
       mtx_unlock(&vao->Mutex);
diff --git a/src/mesa/main/bufferobj.c b/src/mesa/main/bufferobj.c
index 6ddcc5c..cc035ff 100644
--- a/src/mesa/main/bufferobj.c
+++ b/src/mesa/main/bufferobj.c
@@ -449,23 +449,10 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
       mtx_lock(&oldObj->Mutex);
       assert(oldObj->RefCount > 0);
       oldObj->RefCount--;
-#if 0
-      printf("BufferObj %p %d DECR to %d\n",
-             (void *) oldObj, oldObj->Name, oldObj->RefCount);
-#endif
       deleteFlag = (oldObj->RefCount == 0);
       mtx_unlock(&oldObj->Mutex);
 
       if (deleteFlag) {
-
-         /* some sanity checking: don't delete a buffer still in use */
-#if 0
-         /* unfortunately, these tests are invalid during context tear-down */
-	 assert(ctx->Array.ArrayBufferObj != bufObj);
-	 assert(ctx->Array.VAO->IndexBufferObj != bufObj);
-	 assert(ctx->Array.VAO->Vertex.BufferObj != bufObj);
-#endif
-
 	 assert(ctx->Driver.DeleteBuffer);
          ctx->Driver.DeleteBuffer(ctx, oldObj);
       }
@@ -485,10 +472,6 @@ _mesa_reference_buffer_object_(struct gl_context *ctx,
       }
       else {
          bufObj->RefCount++;
-#if 0
-         printf("BufferObj %p %d INCR to %d\n",
-                (void *) bufObj, bufObj->Name, bufObj->RefCount);
-#endif
          *ptr = bufObj;
       }
       mtx_unlock(&bufObj->Mutex);
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index e9d129a..b0d4c8c 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -174,7 +174,6 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr,
       mtx_lock(&oldRb->Mutex);
       assert(oldRb->RefCount > 0);
       oldRb->RefCount--;
-      /*printf("RB DECR %p (%d) to %d\n", (void*) oldRb, oldRb->Name, oldRb->RefCount);*/
       deleteFlag = (oldRb->RefCount == 0);
       mtx_unlock(&oldRb->Mutex);
 
@@ -191,7 +190,6 @@ _mesa_reference_renderbuffer_(struct gl_renderbuffer **ptr,
       /* reference new renderbuffer */
       mtx_lock(&rb->Mutex);
       rb->RefCount++;
-      /*printf("RB INCR %p (%d) to %d\n", (void*) rb, rb->Name, rb->RefCount);*/
       mtx_unlock(&rb->Mutex);
       *ptr = rb;
    }
diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c
index 32180fb1..241b5cb 100644
--- a/src/mesa/main/samplerobj.c
+++ b/src/mesa/main/samplerobj.c
@@ -91,10 +91,6 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
       /*mtx_lock(&oldSamp->Mutex);*/
       assert(oldSamp->RefCount > 0);
       oldSamp->RefCount--;
-#if 0
-      printf("SamplerObj %p %d DECR to %d\n",
-             (void *) oldSamp, oldSamp->Name, oldSamp->RefCount);
-#endif
       deleteFlag = (oldSamp->RefCount == 0);
       /*mtx_unlock(&oldSamp->Mutex);*/
 
@@ -118,10 +114,6 @@ _mesa_reference_sampler_object_(struct gl_context *ctx,
       }
       else {
          samp->RefCount++;
-#if 0
-         printf("SamplerObj %p %d INCR to %d\n",
-                (void *) samp, samp->Name, samp->RefCount);
-#endif
          *ptr = samp;
       }
       /*mtx_unlock(&samp->Mutex);*/
diff --git a/src/mesa/main/shaderobj.c b/src/mesa/main/shaderobj.c
index 110a18e..71d4ed6 100644
--- a/src/mesa/main/shaderobj.c
+++ b/src/mesa/main/shaderobj.c
@@ -69,8 +69,6 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
 
       assert(old->RefCount > 0);
       old->RefCount--;
-      /*printf("SHADER DECR %p (%d) to %d\n",
-        (void*) old, old->Name, old->RefCount);*/
       deleteFlag = (old->RefCount == 0);
 
       if (deleteFlag) {
@@ -86,8 +84,6 @@ _mesa_reference_shader(struct gl_context *ctx, struct gl_shader **ptr,
    if (sh) {
       /* reference new */
       sh->RefCount++;
-      /*printf("SHADER INCR %p (%d) to %d\n",
-        (void*) sh, sh->Name, sh->RefCount);*/
       *ptr = sh;
    }
 }
@@ -209,10 +205,6 @@ _mesa_reference_shader_program_(struct gl_context *ctx,
 
       assert(old->RefCount > 0);
       old->RefCount--;
-#if 0
-      printf("ShaderProgram %p ID=%u  RefCount-- to %d\n",
-             (void *) old, old->Name, old->RefCount);
-#endif
       deleteFlag = (old->RefCount == 0);
 
       if (deleteFlag) {
@@ -227,10 +219,6 @@ _mesa_reference_shader_program_(struct gl_context *ctx,
 
    if (shProg) {
       shProg->RefCount++;
-#if 0
-      printf("ShaderProgram %p ID=%u  RefCount++ to %d\n",
-             (void *) shProg, shProg->Name, shProg->RefCount);
-#endif
       *ptr = shProg;
    }
 }
diff --git a/src/mesa/program/program.c b/src/mesa/program/program.c
index 2d03bba..18d6754 100644
--- a/src/mesa/program/program.c
+++ b/src/mesa/program/program.c
@@ -465,13 +465,6 @@ _mesa_reference_program_(struct gl_context *ctx,
       GLboolean deleteFlag;
 
       /*mtx_lock(&(*ptr)->Mutex);*/
-#if 0
-      printf("Program %p ID=%u Target=%s  Refcount-- to %d\n",
-             *ptr, (*ptr)->Id,
-             ((*ptr)->Target == GL_VERTEX_PROGRAM_ARB ? "VP" :
-              ((*ptr)->Target == GL_GEOMETRY_PROGRAM_NV ? "GP" : "FP")),
-             (*ptr)->RefCount - 1);
-#endif
       assert((*ptr)->RefCount > 0);
       (*ptr)->RefCount--;
 
@@ -490,13 +483,6 @@ _mesa_reference_program_(struct gl_context *ctx,
    if (prog) {
       /*mtx_lock(&prog->Mutex);*/
       prog->RefCount++;
-#if 0
-      printf("Program %p ID=%u Target=%s  Refcount++ to %d\n",
-             prog, prog->Id,
-             (prog->Target == GL_VERTEX_PROGRAM_ARB ? "VP" :
-              (prog->Target == GL_GEOMETRY_PROGRAM_NV ? "GP" : "FP")),
-             prog->RefCount);
-#endif
       /*mtx_unlock(&prog->Mutex);*/
    }
 
-- 
2.3.6



More information about the mesa-dev mailing list