winehq.org
Sign In
Sign Up
Sign In
Sign Up
Manage this list
×
Keyboard Shortcuts
Thread View
j
: Next unread message
k
: Previous unread message
j a
: Jump to all threads
j l
: Jump to MailingList overview
2025
February
January
2024
December
November
October
September
August
July
June
May
April
March
February
January
2023
December
November
October
September
August
July
June
May
April
March
February
January
2022
December
November
October
September
August
July
June
May
April
March
February
January
2021
December
November
October
September
August
July
June
May
April
March
February
January
2020
December
November
October
September
August
July
June
May
April
March
February
January
2019
December
November
October
September
August
July
June
May
April
March
February
January
2018
December
November
October
September
August
July
June
May
April
March
February
January
2017
December
November
October
September
August
July
June
May
April
March
February
January
2016
December
November
October
September
August
July
June
May
April
March
February
January
2015
December
November
October
September
August
July
June
May
April
March
February
January
2014
December
November
October
September
August
July
June
May
April
March
February
January
2013
December
November
October
September
August
July
June
May
April
March
February
January
2012
December
November
October
September
August
July
June
May
April
March
February
January
2011
December
November
October
September
August
July
June
May
April
March
February
January
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008
December
November
October
September
August
July
June
May
April
March
February
January
2007
December
November
October
September
August
July
June
May
April
March
February
January
2006
December
November
October
September
August
July
June
May
April
March
February
January
2005
December
November
October
September
August
July
June
May
April
March
February
January
2004
December
November
October
September
August
July
June
May
April
March
February
January
2003
December
November
October
September
August
July
June
May
April
March
February
January
2002
December
November
October
September
August
July
June
May
April
March
February
January
2001
December
November
October
September
August
July
June
May
April
March
February
List overview
wine-commits
May 2019
----- 2025 -----
February 2025
January 2025
----- 2024 -----
December 2024
November 2024
October 2024
September 2024
August 2024
July 2024
June 2024
May 2024
April 2024
March 2024
February 2024
January 2024
----- 2023 -----
December 2023
November 2023
October 2023
September 2023
August 2023
July 2023
June 2023
May 2023
April 2023
March 2023
February 2023
January 2023
----- 2022 -----
December 2022
November 2022
October 2022
September 2022
August 2022
July 2022
June 2022
May 2022
April 2022
March 2022
February 2022
January 2022
----- 2021 -----
December 2021
November 2021
October 2021
September 2021
August 2021
July 2021
June 2021
May 2021
April 2021
March 2021
February 2021
January 2021
----- 2020 -----
December 2020
November 2020
October 2020
September 2020
August 2020
July 2020
June 2020
May 2020
April 2020
March 2020
February 2020
January 2020
----- 2019 -----
December 2019
November 2019
October 2019
September 2019
August 2019
July 2019
June 2019
May 2019
April 2019
March 2019
February 2019
January 2019
----- 2018 -----
December 2018
November 2018
October 2018
September 2018
August 2018
July 2018
June 2018
May 2018
April 2018
March 2018
February 2018
January 2018
----- 2017 -----
December 2017
November 2017
October 2017
September 2017
August 2017
July 2017
June 2017
May 2017
April 2017
March 2017
February 2017
January 2017
----- 2016 -----
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
----- 2015 -----
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
----- 2014 -----
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
----- 2013 -----
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
----- 2012 -----
December 2012
November 2012
October 2012
September 2012
August 2012
July 2012
June 2012
May 2012
April 2012
March 2012
February 2012
January 2012
----- 2011 -----
December 2011
November 2011
October 2011
September 2011
August 2011
July 2011
June 2011
May 2011
April 2011
March 2011
February 2011
January 2011
----- 2010 -----
December 2010
November 2010
October 2010
September 2010
August 2010
July 2010
June 2010
May 2010
April 2010
March 2010
February 2010
January 2010
----- 2009 -----
December 2009
November 2009
October 2009
September 2009
August 2009
July 2009
June 2009
May 2009
April 2009
March 2009
February 2009
January 2009
----- 2008 -----
December 2008
November 2008
October 2008
September 2008
August 2008
July 2008
June 2008
May 2008
April 2008
March 2008
February 2008
January 2008
----- 2007 -----
December 2007
November 2007
October 2007
September 2007
August 2007
July 2007
June 2007
May 2007
April 2007
March 2007
February 2007
January 2007
----- 2006 -----
December 2006
November 2006
October 2006
September 2006
August 2006
July 2006
June 2006
May 2006
April 2006
March 2006
February 2006
January 2006
----- 2005 -----
December 2005
November 2005
October 2005
September 2005
August 2005
July 2005
June 2005
May 2005
April 2005
March 2005
February 2005
January 2005
----- 2004 -----
December 2004
November 2004
October 2004
September 2004
August 2004
July 2004
June 2004
May 2004
April 2004
March 2004
February 2004
January 2004
----- 2003 -----
December 2003
November 2003
October 2003
September 2003
August 2003
July 2003
June 2003
May 2003
April 2003
March 2003
February 2003
January 2003
----- 2002 -----
December 2002
November 2002
October 2002
September 2002
August 2002
July 2002
June 2002
May 2002
April 2002
March 2002
February 2002
January 2002
----- 2001 -----
December 2001
November 2001
October 2001
September 2001
August 2001
July 2001
June 2001
May 2001
April 2001
March 2001
February 2001
wine-commits@winehq.org
2 participants
1019 discussions
Start a n
N
ew thread
Józef Kucia : d3d10core/tests: Add test for ID3D11Multithread.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 74ba0fb156f7cf775712cfbcb79bf6af6a935cef URL:
https://source.winehq.org/git/wine.git/?a=commit;h=74ba0fb156f7cf775712cfbc…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 14:03:26 2019 +0200 d3d10core/tests: Add test for ID3D11Multithread. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d10core/tests/d3d10core.c | 51 ++++++++++++++++++++++++++++++++++++---- 1 file changed, 46 insertions(+), 5 deletions(-) diff --git a/dlls/d3d10core/tests/d3d10core.c b/dlls/d3d10core/tests/d3d10core.c index b0ff09d..32f9437 100644 --- a/dlls/d3d10core/tests/d3d10core.c +++ b/dlls/d3d10core/tests/d3d10core.c @@ -1594,11 +1594,16 @@ static void test_feature_level(void) static void test_device_interfaces(void) { + ID3D11DeviceContext *immediate_context; + ID3D11Multithread *d3d11_multithread; + ULONG refcount, expected_refcount; + ID3D10Multithread *multithread; + ID3D11Device *d3d11_device; IDXGIAdapter *dxgi_adapter; IDXGIDevice *dxgi_device; ID3D10Device *device; IUnknown *iface; - ULONG refcount; + BOOL enabled; HRESULT hr; if (!(device = create_device())) @@ -1615,20 +1620,56 @@ static void test_device_interfaces(void) check_interface(device, &IID_ID3D11Device, TRUE, TRUE); /* Not available on all Windows versions. */ hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&dxgi_device); - ok(SUCCEEDED(hr), "Device should implement IDXGIDevice.\n"); + ok(hr == S_OK, "Device should implement IDXGIDevice.\n"); hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter, (void **)&dxgi_adapter); - ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter.\n"); + ok(hr == S_OK, "Device parent should implement IDXGIAdapter.\n"); hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory, (void **)&iface); - ok(SUCCEEDED(hr), "Adapter parent should implement IDXGIFactory.\n"); + ok(hr == S_OK, "Adapter parent should implement IDXGIFactory.\n"); IUnknown_Release(iface); IUnknown_Release(dxgi_adapter); hr = IDXGIDevice_GetParent(dxgi_device, &IID_IDXGIAdapter1, (void **)&dxgi_adapter); - ok(SUCCEEDED(hr), "Device parent should implement IDXGIAdapter1.\n"); + ok(hr == S_OK, "Device parent should implement IDXGIAdapter1.\n"); hr = IDXGIAdapter_GetParent(dxgi_adapter, &IID_IDXGIFactory1, (void **)&iface); ok(hr == E_NOINTERFACE, "Adapter parent should not implement IDXGIFactory1.\n"); IUnknown_Release(dxgi_adapter); IUnknown_Release(dxgi_device); + hr = ID3D10Device_QueryInterface(device, &IID_ID3D11Device, (void **)&d3d11_device); + if (hr != S_OK) + goto done; + + expected_refcount = get_refcount(device) + 1; + + hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Multithread, (void **)&multithread); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + refcount = get_refcount(device); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + + expected_refcount = refcount; + refcount = get_refcount(multithread); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + + ID3D11Device_GetImmediateContext(d3d11_device, &immediate_context); + hr = ID3D11DeviceContext_QueryInterface(immediate_context, + &IID_ID3D11Multithread, (void **)&d3d11_multithread); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + expected_refcount = get_refcount(immediate_context); + refcount = get_refcount(d3d11_multithread); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + + enabled = ID3D10Multithread_GetMultithreadProtected(multithread); + ok(enabled, "Multithread protection is %#x.\n", enabled); + enabled = ID3D11Multithread_GetMultithreadProtected(d3d11_multithread); + ok(enabled, "Multithread protection is %#x.\n", enabled); + + ID3D11Device_Release(d3d11_device); + ID3D11DeviceContext_Release(immediate_context); + ID3D10Multithread_Release(multithread); + ID3D11Multithread_Release(d3d11_multithread); + +done: refcount = ID3D10Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); }
1
0
0
0
Józef Kucia : d3d11/tests: Add test for ID3D11Multithread.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 47abad1ddfcf6f6a47ed8395ad68c309ab161473 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=47abad1ddfcf6f6a47ed8395…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 14:03:25 2019 +0200 d3d11/tests: Add test for ID3D11Multithread. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index b1148cd..5b56a04 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -2152,7 +2152,10 @@ static void test_get_immediate_context(void) { ID3D11DeviceContext *immediate_context, *previous_immediate_context; ULONG expected_refcount, refcount; + ID3D11Multithread *multithread; ID3D11Device *device; + BOOL enabled; + HRESULT hr; if (!(device = create_device(NULL))) { @@ -2181,6 +2184,31 @@ static void test_get_immediate_context(void) refcount = ID3D11DeviceContext_Release(immediate_context); ok(!refcount, "Got unexpected refcount %u.\n", refcount); + ID3D11Device_GetImmediateContext(device, &immediate_context); + expected_refcount = get_refcount(immediate_context) + 1; + hr = ID3D11DeviceContext_QueryInterface(immediate_context, &IID_ID3D11Multithread, (void **)&multithread); + if (hr == E_NOINTERFACE) + { + win_skip("ID3D11Multithread is not supported.\n"); + goto done; + } + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + + refcount = get_refcount(immediate_context); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + + expected_refcount = refcount; + refcount = get_refcount(multithread); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + + enabled = ID3D11Multithread_GetMultithreadProtected(multithread); + todo_wine ok(!enabled, "Multithread protection is %#x.\n", enabled); + + ID3D11Multithread_Release(multithread); + +done: + refcount = ID3D11DeviceContext_Release(immediate_context); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); refcount = ID3D11Device_Release(device); ok(!refcount, "Device has %u references left.\n", refcount); }
1
0
0
0
Józef Kucia : d3d11/tests: Add test for creating deferred contexts.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 214c44e2dee7c13188a16d7bd3308491e8613bd5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=214c44e2dee7c13188a16d7b…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 14:03:24 2019 +0200 d3d11/tests: Add test for creating deferred contexts. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/tests/d3d11.c | 52 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 2850d59..b1148cd 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -2185,6 +2185,57 @@ static void test_get_immediate_context(void) ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_create_deferred_context(void) +{ + ULONG refcount, expected_refcount; + struct device_desc device_desc; + ID3D11DeviceContext *context; + ID3D11Device *device; + HRESULT hr; + + device_desc.feature_level = NULL; + device_desc.flags = D3D11_CREATE_DEVICE_SINGLETHREADED; + if (!(device = create_device(&device_desc))) + { + skip("Failed to create single-threaded device.\n"); + return; + } + + hr = ID3D11Device_CreateDeferredContext(device, 0, &context); + todo_wine ok(hr == DXGI_ERROR_INVALID_CALL, "Failed to create deferred context, hr %#x.\n", hr); + + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + + if (!(device = create_device(NULL))) + { + skip("Failed to create device.\n"); + return; + } + + expected_refcount = get_refcount(device) + 1; + hr = ID3D11Device_CreateDeferredContext(device, 0, &context); + todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr); + if (FAILED(hr)) + goto done; + refcount = get_refcount(device); + ok(refcount == expected_refcount, "Got refcount %u, expected %u.\n", refcount, expected_refcount); + refcount = get_refcount(context); + ok(refcount == 1, "Got unexpected refcount %u.\n", refcount); + + check_interface(context, &IID_IUnknown, TRUE, FALSE); + check_interface(context, &IID_ID3D11DeviceChild, TRUE, FALSE); + check_interface(context, &IID_ID3D11DeviceContext, TRUE, FALSE); + check_interface(context, &IID_ID3D11Multithread, FALSE, FALSE); + + refcount = ID3D11DeviceContext_Release(context); + ok(!refcount, "Got unexpected refcount %u.\n", refcount); + +done: + refcount = ID3D11Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); +} + static void test_create_texture1d(void) { ULONG refcount, expected_refcount; @@ -29205,6 +29256,7 @@ START_TEST(d3d11) queue_test(test_create_device); queue_for_each_feature_level(test_device_interfaces); queue_test(test_get_immediate_context); + queue_test(test_create_deferred_context); queue_test(test_create_texture1d); queue_test(test_texture1d_interfaces); queue_test(test_create_texture2d);
1
0
0
0
Józef Kucia : d3d11: Implement ID3D11Multithread.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: c4f6993d379caec9000f93ea38cca56f7bbd0a8b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4f6993d379caec9000f93ea…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 14:03:23 2019 +0200 d3d11: Implement ID3D11Multithread. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/d3d11_private.h | 1 + dlls/d3d11/device.c | 141 ++++++++++++++++++++++++++++++++++++--------- 2 files changed, 114 insertions(+), 28 deletions(-) diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index 44e774b..2219680 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -499,6 +499,7 @@ struct d3d_query *unsafe_impl_from_ID3D11Asynchronous(ID3D11Asynchronous *iface) struct d3d11_immediate_context { ID3D11DeviceContext1 ID3D11DeviceContext1_iface; + ID3D11Multithread ID3D11Multithread_iface; LONG refcount; struct wined3d_private_store private_store; diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index aaa525d..751afc1 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -46,23 +46,32 @@ static inline struct d3d_device *device_from_immediate_ID3D11DeviceContext1(ID3D } static HRESULT STDMETHODCALLTYPE d3d11_immediate_context_QueryInterface(ID3D11DeviceContext1 *iface, - REFIID riid, void **out) + REFIID iid, void **out) { - TRACE("iface %p, riid %s, out %p.\n", iface, debugstr_guid(riid), out); + struct d3d11_immediate_context *context = impl_from_ID3D11DeviceContext1(iface); - if (IsEqualGUID(riid, &IID_ID3D11DeviceContext1) - || IsEqualGUID(riid, &IID_ID3D11DeviceContext) - || IsEqualGUID(riid, &IID_ID3D11DeviceChild) - || IsEqualGUID(riid, &IID_IUnknown)) + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + if (IsEqualGUID(iid, &IID_ID3D11DeviceContext1) + || IsEqualGUID(iid, &IID_ID3D11DeviceContext) + || IsEqualGUID(iid, &IID_ID3D11DeviceChild) + || IsEqualGUID(iid, &IID_IUnknown)) { - ID3D11DeviceContext1_AddRef(iface); - *out = iface; - return S_OK; + *out = &context->ID3D11DeviceContext1_iface; + } + else if (IsEqualGUID(iid, &IID_ID3D11Multithread)) + { + *out = &context->ID3D11Multithread_iface; + } + else + { + WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(iid)); + *out = NULL; + return E_NOINTERFACE; } - WARN("%s not implemented, returning E_NOINTERFACE.\n", debugstr_guid(riid)); - *out = NULL; - return E_NOINTERFACE; + ID3D11DeviceContext1_AddRef(iface); + return S_OK; } static ULONG STDMETHODCALLTYPE d3d11_immediate_context_AddRef(ID3D11DeviceContext1 *iface) @@ -2780,9 +2789,85 @@ static const struct ID3D11DeviceContext1Vtbl d3d11_immediate_context_vtbl = d3d11_immediate_context_DiscardView1, }; +/* ID3D11Multithread methods */ + +static inline struct d3d11_immediate_context *impl_from_ID3D11Multithread(ID3D11Multithread *iface) +{ + return CONTAINING_RECORD(iface, struct d3d11_immediate_context, ID3D11Multithread_iface); +} + +static HRESULT STDMETHODCALLTYPE d3d11_multithread_QueryInterface(ID3D11Multithread *iface, + REFIID iid, void **out) +{ + struct d3d11_immediate_context *context = impl_from_ID3D11Multithread(iface); + + TRACE("iface %p, iid %s, out %p.\n", iface, debugstr_guid(iid), out); + + return d3d11_immediate_context_QueryInterface(&context->ID3D11DeviceContext1_iface, iid, out); +} + +static ULONG STDMETHODCALLTYPE d3d11_multithread_AddRef(ID3D11Multithread *iface) +{ + struct d3d11_immediate_context *context = impl_from_ID3D11Multithread(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_immediate_context_AddRef(&context->ID3D11DeviceContext1_iface); +} + +static ULONG STDMETHODCALLTYPE d3d11_multithread_Release(ID3D11Multithread *iface) +{ + struct d3d11_immediate_context *context = impl_from_ID3D11Multithread(iface); + + TRACE("iface %p.\n", iface); + + return d3d11_immediate_context_Release(&context->ID3D11DeviceContext1_iface); +} + +static void STDMETHODCALLTYPE d3d11_multithread_Enter(ID3D11Multithread *iface) +{ + TRACE("iface %p.\n", iface); + + wined3d_mutex_lock(); +} + +static void STDMETHODCALLTYPE d3d11_multithread_Leave(ID3D11Multithread *iface) +{ + TRACE("iface %p.\n", iface); + + wined3d_mutex_unlock(); +} + +static BOOL STDMETHODCALLTYPE d3d11_multithread_SetMultithreadProtected( + ID3D11Multithread *iface, BOOL enable) +{ + FIXME("iface %p, enable %#x stub!\n", iface, enable); + + return TRUE; +} + +static BOOL STDMETHODCALLTYPE d3d11_multithread_GetMultithreadProtected(ID3D11Multithread *iface) +{ + FIXME("iface %p stub!\n", iface); + + return TRUE; +} + +static const struct ID3D11MultithreadVtbl d3d11_multithread_vtbl = +{ + d3d11_multithread_QueryInterface, + d3d11_multithread_AddRef, + d3d11_multithread_Release, + d3d11_multithread_Enter, + d3d11_multithread_Leave, + d3d11_multithread_SetMultithreadProtected, + d3d11_multithread_GetMultithreadProtected, +}; + static void d3d11_immediate_context_init(struct d3d11_immediate_context *context, struct d3d_device *device) { context->ID3D11DeviceContext1_iface.lpVtbl = &d3d11_immediate_context_vtbl; + context->ID3D11Multithread_iface.lpVtbl = &d3d11_multithread_vtbl; context->refcount = 1; ID3D11Device2_AddRef(&device->ID3D11Device2_iface); @@ -2797,10 +2882,10 @@ static void d3d11_immediate_context_destroy(struct d3d11_immediate_context *cont /* ID3D11Device methods */ -static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID riid, void **out) +static HRESULT STDMETHODCALLTYPE d3d11_device_QueryInterface(ID3D11Device2 *iface, REFIID iid, void **out) { struct d3d_device *device = impl_from_ID3D11Device2(iface); - return IUnknown_QueryInterface(device->outer_unk, riid, out); + return IUnknown_QueryInterface(device->outer_unk, iid, out); } static ULONG STDMETHODCALLTYPE d3d11_device_AddRef(ID3D11Device2 *iface) @@ -3279,10 +3364,10 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext(ID3D11Device return E_NOTIMPL; } -static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID riid, +static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource(ID3D11Device2 *iface, HANDLE resource, REFIID iid, void **out) { - FIXME("iface %p, resource %p, riid %s, out %p stub!\n", iface, resource, debugstr_guid(riid), out); + FIXME("iface %p, resource %p, iid %s, out %p stub!\n", iface, resource, debugstr_guid(iid), out); return E_NOTIMPL; } @@ -3712,18 +3797,18 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeviceContextState(ID3D11Dev } static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResource1(ID3D11Device2 *iface, HANDLE handle, - REFIID riid, void **resource) + REFIID iid, void **resource) { - FIXME("iface %p, handle %p, riid %s, resource %p stub!\n", iface, handle, debugstr_guid(riid), resource); + FIXME("iface %p, handle %p, iid %s, resource %p stub!\n", iface, handle, debugstr_guid(iid), resource); return E_NOTIMPL; } static HRESULT STDMETHODCALLTYPE d3d11_device_OpenSharedResourceByName(ID3D11Device2 *iface, const WCHAR *name, - DWORD access, REFIID riid, void **resource) + DWORD access, REFIID iid, void **resource) { - FIXME("iface %p, name %s, access %#x, riid %s, resource %p stub!\n", iface, debugstr_w(name), access, - debugstr_guid(riid), resource); + FIXME("iface %p, name %s, access %#x, iid %s, resource %p stub!\n", iface, debugstr_w(name), access, + debugstr_guid(iid), resource); return E_NOTIMPL; } @@ -3905,11 +3990,11 @@ static ULONG STDMETHODCALLTYPE d3d_device_inner_Release(IUnknown *iface) /* IUnknown methods */ -static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device1 *iface, REFIID riid, - void **ppv) +static HRESULT STDMETHODCALLTYPE d3d10_device_QueryInterface(ID3D10Device1 *iface, REFIID iid, + void **out) { struct d3d_device *device = impl_from_ID3D10Device(iface); - return IUnknown_QueryInterface(device->outer_unk, riid, ppv); + return IUnknown_QueryInterface(device->outer_unk, iid, out); } static ULONG STDMETHODCALLTYPE d3d10_device_AddRef(ID3D10Device1 *iface) @@ -5963,9 +6048,9 @@ static void STDMETHODCALLTYPE d3d10_multithread_Leave(ID3D10Multithread *iface) wined3d_mutex_unlock(); } -static BOOL STDMETHODCALLTYPE d3d10_multithread_SetMultithreadProtected(ID3D10Multithread *iface, BOOL protect) +static BOOL STDMETHODCALLTYPE d3d10_multithread_SetMultithreadProtected(ID3D10Multithread *iface, BOOL enable) { - FIXME("iface %p, protect %#x stub!\n", iface, protect); + FIXME("iface %p, enable %#x stub!\n", iface, enable); return TRUE; } @@ -5996,10 +6081,10 @@ static inline struct d3d_device *device_from_dxgi_device_parent(IWineDXGIDeviceP } static HRESULT STDMETHODCALLTYPE dxgi_device_parent_QueryInterface(IWineDXGIDeviceParent *iface, - REFIID riid, void **ppv) + REFIID iid, void **out) { struct d3d_device *device = device_from_dxgi_device_parent(iface); - return IUnknown_QueryInterface(device->outer_unk, riid, ppv); + return IUnknown_QueryInterface(device->outer_unk, iid, out); } static ULONG STDMETHODCALLTYPE dxgi_device_parent_AddRef(IWineDXGIDeviceParent *iface)
1
0
0
0
Paul Gofman : wined3d: Check if destination texture is FBO attachable in glsl_blitter_supported( ).
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: ff47237edeab06212012edc91dc9b753dd474982 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ff47237edeab06212012edc9…
Author: Paul Gofman <gofmanp(a)gmail.com> Date: Mon May 6 13:25:30 2019 +0300 wined3d: Check if destination texture is FBO attachable in glsl_blitter_supported(). If the destination texture is not FBO attachable GLSL blitter does not work for it unless backbuffer is used as offscreen rendering mode. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47121
Signed-off-by: Paul Gofman <gofmanp(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/glsl_shader.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 47eb6f2..6493e7f 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -13193,6 +13193,14 @@ static BOOL glsl_blitter_supported(enum wined3d_blit_op blit_op, const struct wi return FALSE; } + if (wined3d_settings.offscreen_rendering_mode == ORM_FBO + && !((dst_format->flags[WINED3D_GL_RES_TYPE_TEX_2D] & WINED3DFMT_FLAG_FBO_ATTACHABLE) + || (dst_resource->bind_flags & WINED3D_BIND_RENDER_TARGET))) + { + TRACE("Destination texture is not FBO attachable.\n"); + return FALSE; + } + TRACE("Returning supported.\n"); return TRUE; }
1
0
0
0
Józef Kucia : dxgi: Acquire Vulkan image just before present when we have user images.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 086f263a9e8457b9758e50eb26cd758b1f53949b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=086f263a9e8457b9758e50eb…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 11:46:03 2019 +0200 dxgi: Acquire Vulkan image just before present when we have user images. The current DXGI back buffer index is independent of the current Vulkan image index when we have user images. We can use this fact to delay calling vkAcquireNextImageKHR(). This increases GPU utilization from 84% to 100% in the main menu of Metro Exouds on Nvidia. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/swapchain.c | 60 ++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index dbb3f34..e09df48 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -989,6 +989,8 @@ static HRESULT hresult_from_vk_result(VkResult vr) } } +#define INVALID_VK_IMAGE_INDEX (~(uint32_t)0) + struct d3d12_swapchain { IDXGISwapChain3 IDXGISwapChain3_iface; @@ -1538,13 +1540,15 @@ static HRESULT d3d12_swapchain_create_buffers(struct d3d12_swapchain *swapchain, return S_OK; } -static VkResult d3d12_swapchain_acquire_next_image(struct d3d12_swapchain *swapchain) +static VkResult d3d12_swapchain_acquire_next_vulkan_image(struct d3d12_swapchain *swapchain) { const struct dxgi_vk_funcs *vk_funcs = &swapchain->vk_funcs; VkDevice vk_device = swapchain->vk_device; VkFence vk_fence = swapchain->vk_fence; VkResult vr; + swapchain->vk_image_index = INVALID_VK_IMAGE_INDEX; + if ((vr = vk_funcs->p_vkAcquireNextImageKHR(vk_device, swapchain->vk_swapchain, UINT64_MAX, VK_NULL_HANDLE, vk_fence, &swapchain->vk_image_index)) < 0) { @@ -1552,9 +1556,6 @@ static VkResult d3d12_swapchain_acquire_next_image(struct d3d12_swapchain *swapc return vr; } - if (!d3d12_swapchain_has_user_images(swapchain)) - swapchain->current_buffer_index = swapchain->vk_image_index; - if ((vr = vk_funcs->p_vkWaitForFences(vk_device, 1, &vk_fence, VK_TRUE, UINT64_MAX)) != VK_SUCCESS) { ERR("Failed to wait for fence, vr %d.\n", vr); @@ -1566,6 +1567,23 @@ static VkResult d3d12_swapchain_acquire_next_image(struct d3d12_swapchain *swapc return vr; } +static VkResult d3d12_swapchain_acquire_next_back_buffer(struct d3d12_swapchain *swapchain) +{ + VkResult vr; + + /* If we don't have user images, we need to acquire a Vulkan image in order + * to get the correct value for the current back buffer index. */ + if (d3d12_swapchain_has_user_images(swapchain)) + return VK_SUCCESS; + + if ((vr = d3d12_swapchain_acquire_next_vulkan_image(swapchain)) >= 0) + swapchain->current_buffer_index = swapchain->vk_image_index; + else + ERR("Failed to acquire Vulkan image, vr %d.\n", vr); + + return vr; +} + static void d3d12_swapchain_destroy_buffers(struct d3d12_swapchain *swapchain, BOOL destroy_user_buffers) { const struct dxgi_vk_funcs *vk_funcs = &swapchain->vk_funcs; @@ -1717,6 +1735,8 @@ static HRESULT d3d12_swapchain_create_vulkan_swapchain(struct d3d12_swapchain *s swapchain->vk_swapchain_width = width; swapchain->vk_swapchain_height = height; + swapchain->vk_image_index = INVALID_VK_IMAGE_INDEX; + return d3d12_swapchain_create_buffers(swapchain, vk_swapchain_format, vk_format); } @@ -1725,16 +1745,17 @@ static HRESULT d3d12_swapchain_recreate_vulkan_swapchain(struct d3d12_swapchain VkResult vr; HRESULT hr; - if (FAILED(hr = d3d12_swapchain_create_vulkan_swapchain(swapchain))) + if (SUCCEEDED(hr = d3d12_swapchain_create_vulkan_swapchain(swapchain))) + { + vr = d3d12_swapchain_acquire_next_back_buffer(swapchain); + hr = hresult_from_vk_result(vr); + } + else { ERR("Failed to recreate Vulkan swapchain, hr %#x.\n", hr); - return hr; } - if ((vr = d3d12_swapchain_acquire_next_image(swapchain)) < 0) - ERR("Failed to acquire Vulkan image after recreating swapchain, vr %d.\n", vr); - - return hresult_from_vk_result(vr); + return hr; } static inline struct d3d12_swapchain *d3d12_swapchain_from_IDXGISwapChain3(IDXGISwapChain3 *iface) @@ -1921,6 +1942,14 @@ static VkResult d3d12_swapchain_queue_present(struct d3d12_swapchain *swapchain, VkSubmitInfo submit_info; VkResult vr; + if (swapchain->vk_image_index == INVALID_VK_IMAGE_INDEX) + { + if ((vr = d3d12_swapchain_acquire_next_vulkan_image(swapchain)) < 0) + return vr; + } + + assert(swapchain->vk_image_index < swapchain->buffer_count); + present_info.sType = VK_STRUCTURE_TYPE_PRESENT_INFO_KHR; present_info.pNext = NULL; present_info.waitSemaphoreCount = 0; @@ -1967,7 +1996,10 @@ static VkResult d3d12_swapchain_queue_present(struct d3d12_swapchain *swapchain, present_info.pWaitSemaphores = &swapchain->vk_semaphores[swapchain->vk_image_index]; } - return vk_funcs->p_vkQueuePresentKHR(vk_queue, &present_info); + if ((vr = vk_funcs->p_vkQueuePresentKHR(vk_queue, &present_info)) >= 0) + swapchain->vk_image_index = INVALID_VK_IMAGE_INDEX; + + return vr; } static HRESULT d3d12_swapchain_present(struct d3d12_swapchain *swapchain, @@ -2036,8 +2068,7 @@ static HRESULT d3d12_swapchain_present(struct d3d12_swapchain *swapchain, } swapchain->current_buffer_index = (swapchain->current_buffer_index + 1) % swapchain->desc.BufferCount; - - vr = d3d12_swapchain_acquire_next_image(swapchain); + vr = d3d12_swapchain_acquire_next_back_buffer(swapchain); if (vr == VK_ERROR_OUT_OF_DATE_KHR) { if (!d3d12_swapchain_has_user_images(swapchain)) @@ -2745,9 +2776,8 @@ static HRESULT d3d12_swapchain_init(struct d3d12_swapchain *swapchain, IWineDXGI swapchain->vk_fence = vk_fence; swapchain->current_buffer_index = 0; - if ((vr = d3d12_swapchain_acquire_next_image(swapchain)) < 0) + if ((vr = d3d12_swapchain_acquire_next_back_buffer(swapchain)) < 0) { - ERR("Failed to acquire Vulkan image, vr %d.\n", vr); d3d12_swapchain_destroy(swapchain); return hresult_from_vk_result(vr); }
1
0
0
0
Józef Kucia : dxgi: Add some asserts for Vulkan swapchains.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 711e68c9b8819219aeff7e3a9d819728276dd6a5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=711e68c9b8819219aeff7e3a…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 11:46:02 2019 +0200 dxgi: Add some asserts for Vulkan swapchains. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/swapchain.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index b4404e2..dbb3f34 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -1231,6 +1231,7 @@ static HRESULT d3d12_swapchain_create_user_buffers(struct d3d12_swapchain *swapc for (i = 0; i < swapchain->desc.BufferCount; ++i) { + assert(swapchain->vk_images[i] == VK_NULL_HANDLE); if ((vr = vk_funcs->p_vkCreateImage(vk_device, &image_info, NULL, &swapchain->vk_images[i])) < 0) { WARN("Failed to create Vulkan image, vr %d.\n", vr); @@ -1265,6 +1266,7 @@ static HRESULT d3d12_swapchain_create_user_buffers(struct d3d12_swapchain *swapc memory_type_mask, VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT, &allocate_info.memoryTypeIndex))) return hr; + assert(swapchain->vk_memory == VK_NULL_HANDLE); if ((vr = vk_funcs->p_vkAllocateMemory(vk_device, &allocate_info, NULL, &swapchain->vk_memory)) < 0) { WARN("Failed to allocate device memory, vr %d.\n", vr); @@ -1392,6 +1394,7 @@ static HRESULT d3d12_swapchain_prepare_command_buffers(struct d3d12_swapchain *s pool_info.flags = VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT; pool_info.queueFamilyIndex = queue_family_index; + assert(swapchain->vk_cmd_pool == VK_NULL_HANDLE); if ((vr = vk_funcs->p_vkCreateCommandPool(vk_device, &pool_info, NULL, &swapchain->vk_cmd_pool)) < 0) { @@ -1419,6 +1422,7 @@ static HRESULT d3d12_swapchain_prepare_command_buffers(struct d3d12_swapchain *s semaphore_info.pNext = NULL; semaphore_info.flags = 0; + assert(swapchain->vk_semaphores[i] == VK_NULL_HANDLE); if ((vr = vk_funcs->p_vkCreateSemaphore(vk_device, &semaphore_info, NULL, &swapchain->vk_semaphores[i])) < 0) { @@ -2075,6 +2079,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_swapchain_GetBuffer(IDXGISwapChain3 *ifac return DXGI_ERROR_INVALID_CALL; } + assert(swapchain->buffers[buffer_idx]); return ID3D12Resource_QueryInterface(swapchain->buffers[buffer_idx], iid, surface); } @@ -2423,6 +2428,7 @@ static UINT STDMETHODCALLTYPE d3d12_swapchain_GetCurrentBackBufferIndex(IDXGISwa TRACE("iface %p.\n", iface); TRACE("Current back buffer index %u.\n", swapchain->current_buffer_index); + assert(swapchain->current_buffer_index < swapchain->desc.BufferCount); return swapchain->current_buffer_index; }
1
0
0
0
Józef Kucia : dxgi: Make Vulkan swapchain image count independent of DXGI buffer count.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 3084ea826966e7a282ac0343d12792cbdc9c3cc5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3084ea826966e7a282ac0343…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 11:46:01 2019 +0200 dxgi: Make Vulkan swapchain image count independent of DXGI buffer count. Vulkan can create more swapchain images than requested. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/swapchain.c | 111 +++++++++++++++++++++++++++----------------------- 1 file changed, 60 insertions(+), 51 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=3084ea826966e7a282ac…
1
0
0
0
Józef Kucia : dxgi: Factor out d3d12_swapchain_record_swapchain_blit().
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 200258500031aba0673ba50fd7c9407d3bdda1b6 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=200258500031aba0673ba50f…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon May 6 11:46:00 2019 +0200 dxgi: Factor out d3d12_swapchain_record_swapchain_blit(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/dxgi/swapchain.c | 126 +++++++++++++++++++++++++++----------------------- 1 file changed, 67 insertions(+), 59 deletions(-) diff --git a/dlls/dxgi/swapchain.c b/dlls/dxgi/swapchain.c index a859baf..54a5178 100644 --- a/dlls/dxgi/swapchain.c +++ b/dlls/dxgi/swapchain.c @@ -1308,6 +1308,71 @@ static void vk_cmd_image_barrier(const struct dxgi_vk_funcs *vk_funcs, VkCommand src_stage_mask, dst_stage_mask, 0, 0, NULL, 0, NULL, 1, &barrier); } +static VkResult d3d12_swapchain_record_swapchain_blit(struct d3d12_swapchain *swapchain, + VkCommandBuffer vk_cmd_buffer, VkImage vk_dst_image, VkImage vk_src_image) +{ + const struct dxgi_vk_funcs *vk_funcs = &swapchain->vk_funcs; + VkCommandBufferBeginInfo begin_info; + VkImageBlit blit; + VkFilter filter; + VkResult vr; + + if (swapchain->desc.Width != swapchain->vk_swapchain_width + || swapchain->desc.Height != swapchain->vk_swapchain_height) + filter = VK_FILTER_LINEAR; + else + filter = VK_FILTER_NEAREST; + + begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; + begin_info.pNext = NULL; + begin_info.flags = 0; + begin_info.pInheritanceInfo = NULL; + + if ((vr = vk_funcs->p_vkBeginCommandBuffer(vk_cmd_buffer, &begin_info)) < 0) + { + WARN("Failed to begin command buffer, vr %d.\n", vr); + return vr; + } + + vk_cmd_image_barrier(vk_funcs, vk_cmd_buffer, + VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, + 0, VK_ACCESS_TRANSFER_WRITE_BIT, + VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, vk_dst_image); + + blit.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; + blit.srcSubresource.mipLevel = 0; + blit.srcSubresource.baseArrayLayer = 0; + blit.srcSubresource.layerCount = 1; + blit.srcOffsets[0].x = 0; + blit.srcOffsets[0].y = 0; + blit.srcOffsets[0].z = 0; + blit.srcOffsets[1].x = swapchain->desc.Width; + blit.srcOffsets[1].y = swapchain->desc.Height; + blit.srcOffsets[1].z = 1; + blit.dstSubresource = blit.srcSubresource; + blit.dstOffsets[0].x = 0; + blit.dstOffsets[0].y = 0; + blit.dstOffsets[0].z = 0; + blit.dstOffsets[1].x = swapchain->vk_swapchain_width; + blit.dstOffsets[1].y = swapchain->vk_swapchain_height; + blit.dstOffsets[1].z = 1; + + vk_funcs->p_vkCmdBlitImage(vk_cmd_buffer, + vk_src_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + vk_dst_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + 1, &blit, filter); + + vk_cmd_image_barrier(vk_funcs, vk_cmd_buffer, + VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, 0, + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, vk_dst_image); + + if ((vr = vk_funcs->p_vkEndCommandBuffer(vk_cmd_buffer)) < 0) + WARN("Failed to end command buffer, vr %d.\n", vr); + + return vr; +} + static HRESULT d3d12_swapchain_prepare_command_buffers(struct d3d12_swapchain *swapchain, uint32_t queue_family_index, VkImage vk_swapchain_images[DXGI_MAX_SWAP_CHAIN_BUFFERS]) { @@ -1315,10 +1380,7 @@ static HRESULT d3d12_swapchain_prepare_command_buffers(struct d3d12_swapchain *s VkDevice vk_device = swapchain->vk_device; VkCommandBufferAllocateInfo allocate_info; VkSemaphoreCreateInfo semaphore_info; - VkCommandBufferBeginInfo begin_info; VkCommandPoolCreateInfo pool_info; - VkImageBlit blit; - VkFilter filter; unsigned int i; VkResult vr; @@ -1348,67 +1410,13 @@ static HRESULT d3d12_swapchain_prepare_command_buffers(struct d3d12_swapchain *s return hresult_from_vk_result(vr); } - if (swapchain->desc.Width != swapchain->vk_swapchain_width - || swapchain->desc.Height != swapchain->vk_swapchain_height) - filter = VK_FILTER_LINEAR; - else - filter = VK_FILTER_NEAREST; - for (i = 0; i < swapchain->buffer_count; ++i) { VkCommandBuffer vk_cmd_buffer = swapchain->vk_cmd_buffers[i]; - begin_info.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_BEGIN_INFO; - begin_info.pNext = NULL; - begin_info.flags = 0; - begin_info.pInheritanceInfo = NULL; - - if ((vr = vk_funcs->p_vkBeginCommandBuffer(vk_cmd_buffer, &begin_info)) < 0) - { - WARN("Failed to begin command buffer, vr %d.\n", vr); + if ((vr = d3d12_swapchain_record_swapchain_blit(swapchain, vk_cmd_buffer, + vk_swapchain_images[i], swapchain->vk_images[i])) < 0) return hresult_from_vk_result(vr); - } - - vk_cmd_image_barrier(vk_funcs, vk_cmd_buffer, - VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, - 0, VK_ACCESS_TRANSFER_WRITE_BIT, - VK_IMAGE_LAYOUT_UNDEFINED, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - vk_swapchain_images[i]); - - blit.srcSubresource.aspectMask = VK_IMAGE_ASPECT_COLOR_BIT; - blit.srcSubresource.mipLevel = 0; - blit.srcSubresource.baseArrayLayer = 0; - blit.srcSubresource.layerCount = 1; - blit.srcOffsets[0].x = 0; - blit.srcOffsets[0].y = 0; - blit.srcOffsets[0].z = 0; - blit.srcOffsets[1].x = swapchain->desc.Width; - blit.srcOffsets[1].y = swapchain->desc.Height; - blit.srcOffsets[1].z = 1; - blit.dstSubresource = blit.srcSubresource; - blit.dstOffsets[0].x = 0; - blit.dstOffsets[0].y = 0; - blit.dstOffsets[0].z = 0; - blit.dstOffsets[1].x = swapchain->vk_swapchain_width; - blit.dstOffsets[1].y = swapchain->vk_swapchain_height; - blit.dstOffsets[1].z = 1; - - vk_funcs->p_vkCmdBlitImage(vk_cmd_buffer, - swapchain->vk_images[i], VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - vk_swapchain_images[i], VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, - 1, &blit, filter); - - vk_cmd_image_barrier(vk_funcs, vk_cmd_buffer, - VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_BOTTOM_OF_PIPE_BIT, - VK_ACCESS_TRANSFER_WRITE_BIT, 0, - VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, - vk_swapchain_images[i]); - - if ((vr = vk_funcs->p_vkEndCommandBuffer(vk_cmd_buffer)) < 0) - { - WARN("Failed to end command buffer, vr %d.\n", vr); - return hresult_from_vk_result(vr); - } } for (i = 0; i < swapchain->buffer_count; ++i)
1
0
0
0
Józef Kucia : d3d11: Set more format support flags.
by Alexandre Julliard
06 May '19
06 May '19
Module: wine Branch: master Commit: 995139bce8487af3969dd9f6a25aca9f2a7116e1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=995139bce8487af3969dd9f6…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Sat May 4 13:00:35 2019 +0200 d3d11: Set more format support flags. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=47096
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d11/device.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4f19c03..aaa525d 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -3344,6 +3344,20 @@ static HRESULT STDMETHODCALLTYPE d3d11_device_CheckFormatSupport(ID3D11Device2 * } wined3d_mutex_unlock(); + if (*format_support & (D3D11_FORMAT_SUPPORT_TEXTURE1D + | D3D11_FORMAT_SUPPORT_TEXTURE2D | D3D11_FORMAT_SUPPORT_TEXTURE3D)) + { + *format_support |= D3D11_FORMAT_SUPPORT_SHADER_LOAD; + *format_support |= D3D11_FORMAT_SUPPORT_SHADER_SAMPLE; + *format_support |= D3D11_FORMAT_SUPPORT_SHADER_GATHER; + + if (*format_support & D3D11_FORMAT_SUPPORT_DEPTH_STENCIL) + { + *format_support |= D3D11_FORMAT_SUPPORT_SHADER_SAMPLE_COMPARISON; + *format_support |= D3D11_FORMAT_SUPPORT_SHADER_GATHER_COMPARISON; + } + } + return S_OK; }
1
0
0
0
← Newer
1
...
82
83
84
85
86
87
88
...
102
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
Results per page:
10
25
50
100
200