Exemplo n.º 1
0
IDirect3DVertexShader9Impl *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface)
{
    if (!iface)
        return NULL;
    assert(iface->lpVtbl == &d3d9_vertexshader_vtbl);

    return impl_from_IDirect3DVertexShader9(iface);
}
Exemplo n.º 2
0
struct d3d9_vertexshader *unsafe_impl_from_IDirect3DVertexShader9(IDirect3DVertexShader9 *iface)
{
    if (!iface)
        return NULL;
    if (iface->lpVtbl != &d3d9_vertexshader_vtbl)
        WARN("Vertex shader %p with the wrong vtbl %p\n", iface, iface->lpVtbl);

    return impl_from_IDirect3DVertexShader9(iface);
}
Exemplo n.º 3
0
static HRESULT WINAPI d3d9_vertexshader_GetDevice(IDirect3DVertexShader9 *iface, IDirect3DDevice9 **device)
{
    IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface);

    TRACE("iface %p, device %p.\n", iface, device);

    *device = (IDirect3DDevice9 *)shader->parentDevice;
    IDirect3DDevice9_AddRef(*device);

    TRACE("Returning device %p.\n", *device);

    return D3D_OK;
}
Exemplo n.º 4
0
static HRESULT WINAPI d3d9_vertexshader_GetFunction(IDirect3DVertexShader9 *iface, void *data, UINT *data_size)
{
    struct d3d9_vertexshader *shader = impl_from_IDirect3DVertexShader9(iface);
    HRESULT hr;

    TRACE("iface %p, data %p, data_size %p.\n", iface, data, data_size);

    wined3d_mutex_lock();
    hr = wined3d_shader_get_byte_code(shader->wined3d_shader, data, data_size);
    wined3d_mutex_unlock();

    return hr;
}
Exemplo n.º 5
0
static ULONG WINAPI d3d9_vertexshader_AddRef(IDirect3DVertexShader9 *iface)
{
    IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface);
    ULONG refcount = InterlockedIncrement(&shader->ref);

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

    if (refcount == 1)
    {
        IDirect3DDevice9Ex_AddRef(shader->parentDevice);
        wined3d_mutex_lock();
        wined3d_shader_incref(shader->wined3d_shader);
        wined3d_mutex_unlock();
    }

    return refcount;
}
Exemplo n.º 6
0
static ULONG WINAPI d3d9_vertexshader_Release(IDirect3DVertexShader9 *iface)
{
    IDirect3DVertexShader9Impl *shader = impl_from_IDirect3DVertexShader9(iface);
    ULONG refcount = InterlockedDecrement(&shader->ref);

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

    if (!refcount)
    {
        IDirect3DDevice9Ex *device = shader->parentDevice;

        wined3d_mutex_lock();
        wined3d_shader_decref(shader->wined3d_shader);
        wined3d_mutex_unlock();

        /* Release the device last, as it may cause the device to be destroyed. */
        IDirect3DDevice9Ex_Release(device);
    }

    return refcount;
}