Example #1
0
void
NineStateBlock9_dtor( struct NineStateBlock9 *This )
{
    struct nine_state *state = &This->state;
    struct nine_range *r;
    struct nine_range_pool *pool = &This->base.device->range_pool;

    nine_state_clear(state, FALSE);

    FREE(state->vs_const_f);
    FREE(state->ps_const_f);

    FREE(state->ff.light);

    FREE(state->ff.transform);

    if (This->state.changed.ps_const_f) {
        for (r = This->state.changed.ps_const_f; r->next; r = r->next);
        nine_range_pool_put_chain(pool, This->state.changed.ps_const_f, r);
    }
    if (This->state.changed.vs_const_f) {
        for (r = This->state.changed.vs_const_f; r->next; r = r->next);
        nine_range_pool_put_chain(pool, This->state.changed.vs_const_f, r);
    }

    NineUnknown_dtor(&This->base);
}
Example #2
0
void
NinePixelShader9_dtor( struct NinePixelShader9 *This )
{
    DBG("This=%p cso=%p\n", This, This->variant.cso);

    if (This->base.device) {
        struct pipe_context *pipe = This->base.device->pipe;
        struct nine_shader_variant *var = &This->variant;
        do {
            if (var->cso) {
                if (This->base.device->state.cso.ps == var->cso)
                    pipe->bind_fs_state(pipe, NULL);
                pipe->delete_fs_state(pipe, var->cso);
            }
            var = var->next;
        } while (var);
    }
    nine_shader_variants_free(&This->variant);

    if (This->byte_code.tokens)
        FREE((void *)This->byte_code.tokens); /* const_cast */

    FREE(This->lconstf.data);
    FREE(This->lconstf.ranges);

    NineUnknown_dtor(&This->base);
}
Example #3
0
void
NineSwapChain9_dtor( struct NineSwapChain9 *This )
{
    unsigned i;

    DBG("This=%p\n", This);

    if (This->pool)
        _mesa_threadpool_destroy(This, This->pool);

    for (i = 0; i < This->num_back_buffers; i++) {
        if (This->buffers[i])
            NineUnknown_Detach(NineUnknown(This->buffers[i]));
        if (This->present_handles[i])
            ID3DPresent_DestroyD3DWindowBuffer(This->present, This->present_handles[i]);
        if (This->present_buffers[i])
            pipe_resource_reference(&(This->present_buffers[i]), NULL);
    }
    if (This->zsbuf)
        NineUnknown_Unbind(NineUnknown(This->zsbuf));

    if (This->present)
        ID3DPresent_Release(This->present);

    swap_fences_unref(This);
    NineUnknown_dtor(&This->base);
}
Example #4
0
void
NinePixelShader9_dtor( struct NinePixelShader9 *This )
{
    DBG("This=%p\n", This);

    if (This->base.device) {
        struct pipe_context *pipe = nine_context_get_pipe_multithread(This->base.device);
        struct nine_shader_variant *var = &This->variant;

        do {
            if (var->cso) {
                if (This->base.device->context.cso_shader.ps == var->cso)
                    pipe->bind_fs_state(pipe, NULL);
                pipe->delete_fs_state(pipe, var->cso);
            }
            var = var->next;
        } while (var);

        if (This->ff_cso) {
            if (This->ff_cso == This->base.device->context.cso_shader.ps)
                pipe->bind_fs_state(pipe, NULL);
            pipe->delete_fs_state(pipe, This->ff_cso);
        }
    }
    nine_shader_variants_free(&This->variant);

    FREE((void *)This->byte_code.tokens); /* const_cast */

    NineUnknown_dtor(&This->base);
}
Example #5
0
void
NineQuery9_dtor( struct NineQuery9 *This )
{
    struct pipe_context *pipe = This->base.device->pipe;

    if (This->pq) {
        if (This->state == NINE_QUERY_STATE_RUNNING)
            pipe->end_query(pipe, This->pq);
        pipe->destroy_query(pipe, This->pq);
    }

    NineUnknown_dtor(&This->base);
}
Example #6
0
void
NineAdapter9_dtor( struct NineAdapter9 *This )
{
    struct d3dadapter9_context *ctx = This->ctx;

    DBG("This=%p\n", This);

    NineUnknown_dtor(&This->base);

    /* special case, call backend-specific dtor AFTER destroying this object
     * completely. */
    if (ctx) {
        if (ctx->destroy) { ctx->destroy(ctx); }
    }
}
Example #7
0
static void
NineVolume9_dtor( struct NineVolume9 *This )
{
    DBG("This=%p\n", This);

    if (This->transfer)
        NineVolume9_UnlockBox(This);

    if (This->data)
           FREE(This->data);

    pipe_resource_reference(&This->resource, NULL);

    NineUnknown_dtor(&This->base);
}
Example #8
0
void
NineResource9_dtor( struct NineResource9 *This )
{
    if (This->pdata) {
        util_hash_table_foreach(This->pdata, ht_guid_delete, NULL);
        util_hash_table_destroy(This->pdata);
    }

    /* NOTE: We do have to use refcounting, the driver might
     * still hold a reference. */
    pipe_resource_reference(&This->resource, NULL);

    /* release allocated system memory for non-D3DPOOL_DEFAULT resources */
    if (This->data)
        FREE(This->data);

    NineUnknown_dtor(&This->base);
}
Example #9
0
void
NineVertexShader9_dtor( struct NineVertexShader9 *This )
{
    DBG("This=%p\n", This);

    if (This->base.device) {
        struct pipe_context *pipe = This->base.device->pipe;
        struct nine_shader_variant *var = &This->variant;
        struct nine_shader_variant_so *var_so = &This->variant_so;

        do {
            if (var->cso) {
                if (This->base.device->state.cso.vs == var->cso)
                    pipe->bind_vs_state(pipe, NULL);
                pipe->delete_vs_state(pipe, var->cso);
            }
            var = var->next;
        } while (var);

        while (var_so && var_so->vdecl) {
            if (var_so->cso) {
                cso_delete_vertex_shader(This->base.device->cso_sw, var_so->cso );
            }
            var_so = var_so->next;
        }

        if (This->ff_cso) {
            if (This->ff_cso == This->base.device->state.cso.vs)
                pipe->bind_vs_state(pipe, NULL);
            pipe->delete_vs_state(pipe, This->ff_cso);
        }
    }
    nine_shader_variants_free(&This->variant);
    nine_shader_variants_so_free(&This->variant_so);

    FREE((void *)This->byte_code.tokens); /* const_cast */

    FREE(This->lconstf.data);
    FREE(This->lconstf.ranges);

    NineUnknown_dtor(&This->base);
}
Example #10
0
void
NineSwapChain9_dtor( struct NineSwapChain9 *This )
{
    unsigned i;

    DBG("This=%p\n", This);

    if (This->buffers) {
        for (i = 0; i < This->params.BackBufferCount; i++)
            NineUnknown_Destroy(NineUnknown(This->buffers[i]));
        FREE(This->buffers);
    }
    if (This->zsbuf)
        NineUnknown_Destroy(NineUnknown(This->zsbuf));

    if (This->present)
        ID3DPresent_Release(This->present);

    NineUnknown_dtor(&This->base);
}