d3d11: Implement d3d{10, 11}_input_layout_GetDevice().
Signed-off-by: Józef Kucia <jkucia@codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c84e395d65
commit
19f5732694
|
@ -9325,7 +9325,7 @@ static void test_create_input_layout(void)
|
|||
ok(SUCCEEDED(hr), "Failed to create input layout for format %#x, hr %#x.\n",
|
||||
vertex_formats[i], hr);
|
||||
refcount = get_refcount(device);
|
||||
todo_wine ok(refcount >= expected_refcount, "Got refcount %u, expected >= %u.\n",
|
||||
ok(refcount >= expected_refcount, "Got refcount %u, expected >= %u.\n",
|
||||
refcount, expected_refcount);
|
||||
ID3D10InputLayout_Release(input_layout);
|
||||
}
|
||||
|
|
|
@ -254,6 +254,7 @@ struct d3d_input_layout
|
|||
|
||||
struct wined3d_private_store private_store;
|
||||
struct wined3d_vertex_declaration *wined3d_decl;
|
||||
ID3D11Device *device;
|
||||
};
|
||||
|
||||
HRESULT d3d_input_layout_create(struct d3d_device *device,
|
||||
|
|
|
@ -151,9 +151,13 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *ifa
|
|||
|
||||
if (!refcount)
|
||||
{
|
||||
ID3D11Device *device = layout->device;
|
||||
|
||||
wined3d_mutex_lock();
|
||||
wined3d_vertex_declaration_decref(layout->wined3d_decl);
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
ID3D11Device_Release(device);
|
||||
}
|
||||
|
||||
return refcount;
|
||||
|
@ -162,7 +166,11 @@ static ULONG STDMETHODCALLTYPE d3d11_input_layout_Release(ID3D11InputLayout *ifa
|
|||
static void STDMETHODCALLTYPE d3d11_input_layout_GetDevice(ID3D11InputLayout *iface,
|
||||
ID3D11Device **device)
|
||||
{
|
||||
FIXME("iface %p, device %p stub!\n", iface, device);
|
||||
struct d3d_input_layout *layout = impl_from_ID3D11InputLayout(iface);
|
||||
|
||||
TRACE("iface %p, device %p.\n", iface, device);
|
||||
|
||||
ID3D11Device_AddRef(*device = layout->device);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d11_input_layout_GetPrivateData(ID3D11InputLayout *iface,
|
||||
|
@ -249,7 +257,11 @@ static ULONG STDMETHODCALLTYPE d3d10_input_layout_Release(ID3D10InputLayout *ifa
|
|||
|
||||
static void STDMETHODCALLTYPE d3d10_input_layout_GetDevice(ID3D10InputLayout *iface, ID3D10Device **device)
|
||||
{
|
||||
FIXME("iface %p, device %p stub!\n", iface, device);
|
||||
struct d3d_input_layout *layout = impl_from_ID3D10InputLayout(iface);
|
||||
|
||||
TRACE("iface %p, device %p.\n", iface, device);
|
||||
|
||||
ID3D11Device_QueryInterface(layout->device, &IID_ID3D10Device, (void **)device);
|
||||
}
|
||||
|
||||
static HRESULT STDMETHODCALLTYPE d3d10_input_layout_GetPrivateData(ID3D10InputLayout *iface,
|
||||
|
@ -344,6 +356,8 @@ static HRESULT d3d_input_layout_init(struct d3d_input_layout *layout, struct d3d
|
|||
}
|
||||
wined3d_mutex_unlock();
|
||||
|
||||
ID3D11Device_AddRef(layout->device = &device->ID3D11Device_iface);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -10321,7 +10321,7 @@ static void test_create_input_layout(void)
|
|||
ok(SUCCEEDED(hr), "Failed to create input layout for format %#x, hr %#x.\n",
|
||||
vertex_formats[i], hr);
|
||||
refcount = get_refcount(device);
|
||||
todo_wine ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n",
|
||||
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n",
|
||||
refcount, expected_refcount);
|
||||
ID3D11InputLayout_Release(input_layout);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue