Ejemplo n.º 1
0
static void crServerCleanupMuralCtxUsageCB(unsigned long key, void *data1, void *data2)
{
    CRMuralInfo *mural = (CRMuralInfo *) data1;
    CRContext *ctx = (CRContext *) data2;

    CR_STATE_SHAREDOBJ_USAGE_CLEAR(mural, ctx);
}
static void ctStateRenderbufferRefsCleanup(CRContext *g, GLuint fboId, CRRenderbufferObject *rbo)
{
    CRFramebufferObjectState *fbo = &g->framebufferobject;

    if (fbo->renderbuffer==rbo)
    {
        fbo->renderbuffer = NULL;
    }

    /* check the attachments of current framebuffers */
    crStateCheckFBOAttachments(fbo->readFB, fboId, GL_READ_FRAMEBUFFER);
    crStateCheckFBOAttachments(fbo->drawFB, fboId, GL_DRAW_FRAMEBUFFER);

    CR_STATE_SHAREDOBJ_USAGE_CLEAR(rbo, g);
}
Ejemplo n.º 3
0
static void ctStateBuffersRefsCleanup(CRContext *ctx, CRBufferObject *obj, CRbitvalue *neg_bitid)
{
    CRBufferObjectState *b = &(ctx->bufferobject);
    CRStateBits *sb = GetCurrentBits();
    CRBufferObjectBits *bb = &(sb->bufferobject);
    int j, k;

    if (obj == b->arrayBuffer)
    {
        b->arrayBuffer = b->nullBuffer;
        b->arrayBuffer->refCount++;
        DIRTY(bb->dirty, neg_bitid);
        DIRTY(bb->arrayBinding, neg_bitid);
    }
    if (obj == b->elementsBuffer)
    {
        b->elementsBuffer = b->nullBuffer;
        b->elementsBuffer->refCount++;
        DIRTY(bb->dirty, neg_bitid);
        DIRTY(bb->elementsBinding, neg_bitid);
    }
#ifdef CR_ARB_pixel_buffer_object
    if (obj == b->packBuffer)
    {
        b->packBuffer = b->nullBuffer;
        b->packBuffer->refCount++;
        DIRTY(bb->dirty, neg_bitid);
        DIRTY(bb->packBinding, neg_bitid);
    }
    if (obj == b->unpackBuffer)
    {
        b->unpackBuffer = b->nullBuffer;
        b->unpackBuffer->refCount++;
        DIRTY(bb->dirty, neg_bitid);
        DIRTY(bb->unpackBinding, neg_bitid);
    }
#endif

#ifdef CR_ARB_vertex_buffer_object
    for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j)
    {
        CRClientPointer *cp = crStateGetClientPointerByIndex(j, &ctx->client.array);
        if (obj == cp->buffer)
        {
            cp->buffer = b->nullBuffer;
            ++b->nullBuffer->refCount;
        }
    }

    for (k=0; k<ctx->client.vertexArrayStackDepth; ++k)
    {
        CRVertexArrays *pArray = &ctx->client.vertexArrayStack[k];
        for (j=0; j<CRSTATECLIENT_MAX_VERTEXARRAYS; ++j)
        {
            CRClientPointer *cp = crStateGetClientPointerByIndex(j, pArray);
            if (obj == cp->buffer)
            {
                cp->buffer = b->nullBuffer;
                ++b->nullBuffer->refCount;
            }
        }
    }
#endif

    CR_STATE_SHAREDOBJ_USAGE_CLEAR(obj, ctx);
}