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);
}
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);
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);
}
}
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);
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);
/* 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;
}
/*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);*/
}
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);*/
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) {
if (sh) {
/* reference new */
sh->RefCount++;
- /*printf("SHADER INCR %p (%d) to %d\n",
- (void*) sh, sh->Name, sh->RefCount);*/
*ptr = sh;
}
}
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) {
if (shProg) {
shProg->RefCount++;
-#if 0
- printf("ShaderProgram %p ID=%u RefCount++ to %d\n",
- (void *) shProg, shProg->Name, shProg->RefCount);
-#endif
*ptr = shProg;
}
}
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--;
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);*/
}