Esempio n. 1
0
SHADERDECL(int) ShaderSetVertexShader(void *pShaderContext, void *pShaderObj)
{
    IWineD3DDeviceImpl *This;
    IWineD3DVertexShader* pShader;
    IWineD3DVertexShader* oldShader;

    SHADER_SET_CURRENT_CONTEXT(pShaderContext);
    This = g_pCurrentContext->pDeviceContext;
    pShader   = (IWineD3DVertexShader* )pShaderObj;
    oldShader = This->updateStateBlock->vertexShader;

    if(oldShader == pShader) {
        /* Checked here to allow proper stateblock recording */
        Log(("App is setting the old shader over, nothing to do\n"));
        return VINF_SUCCESS;
    }

    This->updateStateBlock->vertexShader         = pShader;
    This->updateStateBlock->changed.vertexShader = TRUE;

    Log(("(%p) : setting pShader(%p)\n", This, pShader));
    if(pShader) IWineD3DVertexShader_AddRef(pShader);
    if(oldShader) IWineD3DVertexShader_Release(oldShader);

    g_pCurrentContext->fChangedVertexShader = true;
    g_pCurrentContext->fChangedVertexShaderConstant = true;    /* force constant reload. */

    return VINF_SUCCESS;
}
Esempio n. 2
0
File: shader.c Progetto: r6144/wine
static ULONG STDMETHODCALLTYPE d3d10_vertex_shader_AddRef(ID3D10VertexShader *iface)
{
    struct d3d10_vertex_shader *This = (struct d3d10_vertex_shader *)iface;
    ULONG refcount = InterlockedIncrement(&This->refcount);

    TRACE("%p increasing refcount to %u\n", This, refcount);

    if (refcount == 1)
    {
        IWineD3DVertexShader_AddRef(This->wined3d_shader);
    }

    return refcount;
}
Esempio n. 3
0
static ULONG WINAPI IDirect3DVertexShader9Impl_AddRef(LPDIRECT3DVERTEXSHADER9 iface) {
    IDirect3DVertexShader9Impl *This = (IDirect3DVertexShader9Impl *)iface;
    ULONG ref = InterlockedIncrement(&This->ref);

    TRACE("%p increasing refcount to %u.\n", iface, ref);

    if (ref == 1)
    {
        IDirect3DDevice9Ex_AddRef(This->parentDevice);
        wined3d_mutex_lock();
        IWineD3DVertexShader_AddRef(This->wineD3DVertexShader);
        wined3d_mutex_unlock();
    }

    return ref;
}