d3d11: Do not keep reference to resources.

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:
Józef Kucia 2017-02-02 12:43:36 +01:00 committed by Alexandre Julliard
parent 0ce7d71c46
commit 57fac9b02e
2 changed files with 7 additions and 14 deletions

View File

@ -2755,7 +2755,7 @@ static void test_create_depthstencil_view(void)
hr = ID3D11Device_CreateDepthStencilView(device, (ID3D11Resource *)texture, current_desc, &dsview);
ok(SUCCEEDED(hr), "Test %u: Failed to create depth stencil view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
todo_wine ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D11DepthStencilView_QueryInterface(dsview, &IID_ID3D10DepthStencilView, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
@ -3119,7 +3119,7 @@ static void test_create_rendertarget_view(void)
hr = ID3D11Device_CreateRenderTargetView(device, texture, current_desc, &rtview);
ok(SUCCEEDED(hr), "Test %u: Failed to create render target view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
todo_wine ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D11RenderTargetView_QueryInterface(rtview, &IID_ID3D10RenderTargetView, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
@ -3478,7 +3478,7 @@ static void test_create_shader_resource_view(void)
hr = ID3D11Device_CreateShaderResourceView(device, texture, current_desc, &srview);
ok(SUCCEEDED(hr), "Test %u: Failed to create a shader resource view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
todo_wine ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
hr = ID3D11ShaderResourceView_QueryInterface(srview, &IID_ID3D10ShaderResourceView, (void **)&iface);
ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
@ -8164,7 +8164,7 @@ static void test_swapchain_views(void)
context = test_context.immediate_context;
refcount = get_refcount((IUnknown *)test_context.backbuffer);
todo_wine ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
draw_color_quad(&test_context, &color);
check_texture_color(test_context.backbuffer, 0xff7f4c33, 1);
@ -8177,7 +8177,7 @@ static void test_swapchain_views(void)
ID3D11DeviceContext_OMSetRenderTargets(context, 1, &rtv, NULL);
refcount = get_refcount((IUnknown *)test_context.backbuffer);
todo_wine ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
draw_color_quad(&test_context, &color);
todo_wine check_texture_color(test_context.backbuffer, 0xffbc957c, 1);
@ -10396,7 +10396,7 @@ static void test_create_unordered_access_view(void)
hr = ID3D11Device_CreateUnorderedAccessView(device, texture, current_desc, &uav);
ok(SUCCEEDED(hr), "Test %u: Failed to create unordered access view, hr %#x.\n", i, hr);
refcount = get_refcount((IUnknown *)texture);
todo_wine ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount);
memset(&uav_desc, 0, sizeof(uav_desc));
ID3D11UnorderedAccessView_GetDesc(uav, &uav_desc);

View File

@ -996,7 +996,6 @@ static ULONG STDMETHODCALLTYPE d3d11_depthstencil_view_Release(ID3D11DepthStenci
{
wined3d_mutex_lock();
wined3d_rendertarget_view_decref(view->wined3d_view);
ID3D11Resource_Release(view->resource);
ID3D11Device_Release(view->device);
wined3d_private_store_cleanup(&view->private_store);
wined3d_mutex_unlock();
@ -1312,7 +1311,6 @@ static HRESULT d3d_depthstencil_view_init(struct d3d_depthstencil_view *view, st
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
ID3D11Resource_AddRef(resource);
view->device = &device->ID3D11Device_iface;
ID3D11Device_AddRef(view->device);
@ -1419,7 +1417,6 @@ static ULONG STDMETHODCALLTYPE d3d11_rendertarget_view_Release(ID3D11RenderTarge
{
wined3d_mutex_lock();
wined3d_rendertarget_view_decref(view->wined3d_view);
ID3D11Resource_Release(view->resource);
ID3D11Device_Release(view->device);
wined3d_private_store_cleanup(&view->private_store);
wined3d_mutex_unlock();
@ -1740,7 +1737,6 @@ static HRESULT d3d_rendertarget_view_init(struct d3d_rendertarget_view *view, st
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
ID3D11Resource_AddRef(resource);
view->device = &device->ID3D11Device_iface;
ID3D11Device_AddRef(view->device);
@ -1848,7 +1844,6 @@ static ULONG STDMETHODCALLTYPE d3d11_shader_resource_view_Release(ID3D11ShaderRe
{
wined3d_mutex_lock();
wined3d_shader_resource_view_decref(view->wined3d_view);
ID3D11Resource_Release(view->resource);
ID3D11Device_Release(view->device);
wined3d_private_store_cleanup(&view->private_store);
wined3d_mutex_unlock();
@ -2221,7 +2216,6 @@ static HRESULT d3d_shader_resource_view_init(struct d3d_shader_resource_view *vi
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
view->resource = resource;
ID3D11Resource_AddRef(resource);
view->device = &device->ID3D11Device_iface;
ID3D11Device_AddRef(view->device);
@ -2314,7 +2308,6 @@ static ULONG STDMETHODCALLTYPE d3d11_unordered_access_view_Release(ID3D11Unorder
{
wined3d_mutex_lock();
wined3d_unordered_access_view_decref(view->wined3d_view);
ID3D11Resource_Release(view->resource);
ID3D11Device_Release(view->device);
wined3d_private_store_cleanup(&view->private_store);
wined3d_mutex_unlock();
@ -2510,7 +2503,7 @@ static HRESULT d3d11_unordered_access_view_init(struct d3d11_unordered_access_vi
wined3d_private_store_init(&view->private_store);
wined3d_mutex_unlock();
ID3D11Resource_AddRef(view->resource = resource);
view->resource = resource;
ID3D11Device_AddRef(view->device = &device->ID3D11Device_iface);
return S_OK;