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
December 2017
----- 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
450 discussions
Start a n
N
ew thread
Matteo Bruni : d3d11/tests: Add a couple of testcases for UINT, sRGB UAVs.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 6a00754c6f189a3e2aa39b317496ca9b2d9df9ea URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6a00754c6f189a3e2aa39b317…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Fri Dec 8 17:54:21 2017 +0100 d3d11/tests: Add a couple of testcases for UINT, sRGB UAVs. Signed-off-by: Matteo Bruni <mbruni(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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c index 20697b1..a80df2a 100644 --- a/dlls/d3d11/tests/d3d11.c +++ b/dlls/d3d11/tests/d3d11.c @@ -14233,6 +14233,8 @@ static void test_create_unordered_access_view(void) #define FMT_UNKNOWN DXGI_FORMAT_UNKNOWN #define RGBA8_UNORM DXGI_FORMAT_R8G8B8A8_UNORM +#define RGBA8_SRGB DXGI_FORMAT_R8G8B8A8_UNORM_SRGB +#define RGBA8_UINT DXGI_FORMAT_R8G8B8A8_UINT #define RGBA8_TL DXGI_FORMAT_R8G8B8A8_TYPELESS #define DIM_UNKNOWN D3D11_UAV_DIMENSION_UNKNOWN #define TEX_1D D3D11_UAV_DIMENSION_TEXTURE1D @@ -14260,6 +14262,8 @@ static void test_create_unordered_access_view(void) {{10, 1, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_2D, 9}, {RGBA8_UNORM, TEX_2D, 9}}, {{ 1, 1, RGBA8_TL}, {RGBA8_UNORM, TEX_2D, 0}, {RGBA8_UNORM, TEX_2D, 0}}, {{10, 1, RGBA8_TL}, {RGBA8_UNORM, TEX_2D, 0}, {RGBA8_UNORM, TEX_2D, 0}}, + {{ 1, 1, RGBA8_UINT}, {0}, {RGBA8_UINT, TEX_2D, 0, 0, 1}}, + {{ 1, 1, RGBA8_TL}, {RGBA8_UINT, TEX_2D, 0, 0, ~0u}, {RGBA8_UINT, TEX_2D, 0, 0, 1}}, {{ 1, 4, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_2D_ARRAY, 0, 0, 4}}, {{10, 4, RGBA8_UNORM}, {0}, {RGBA8_UNORM, TEX_2D_ARRAY, 0, 0, 4}}, {{10, 4, RGBA8_UNORM}, {FMT_UNKNOWN, TEX_2D_ARRAY, 0, 0, ~0u}, {RGBA8_UNORM, TEX_2D_ARRAY, 0, 0, 4}}, @@ -14314,6 +14318,10 @@ static void test_create_unordered_access_view(void) {{TEX_2D, 1, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_2D_ARRAY, 1, 0, 1}}, {{TEX_2D, 1, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_2D_ARRAY, 0, 0, 2}}, {{TEX_2D, 1, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_2D_ARRAY, 0, 1, 1}}, + {{TEX_2D, 1, 1, RGBA8_UNORM}, {RGBA8_UINT, TEX_2D, 0, 0, 1}}, + {{TEX_2D, 1, 1, RGBA8_UINT}, {RGBA8_UNORM, TEX_2D, 0, 0, 1}}, + {{TEX_2D, 1, 1, RGBA8_UNORM}, {RGBA8_SRGB, TEX_2D, 0, 0, 1}}, + {{TEX_2D, 1, 1, RGBA8_SRGB}, {RGBA8_UNORM, TEX_2D, 0, 0, 1}}, {{TEX_3D, 1, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_1D, 0}}, {{TEX_3D, 1, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_1D_ARRAY, 0, 0, 1}}, {{TEX_3D, 1, 1, RGBA8_UNORM}, {RGBA8_UNORM, TEX_2D, 0}}, @@ -14337,6 +14345,8 @@ static void test_create_unordered_access_view(void) }; #undef FMT_UNKNOWN #undef RGBA8_UNORM +#undef RGBA8_SRGB +#undef RGBA8_UINT #undef RGBA8_TL #undef DIM_UNKNOWN #undef TEX_1D
1
0
0
0
Nikolay Sivov : comctl32/listview: Directly reset focused item on item count change.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 9f019b7c76dd34bf6d47f5150c5a0317ed8f7738 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9f019b7c76dd34bf6d47f5150…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 11 13:07:40 2017 +0300 comctl32/listview: Directly reset focused item on item count change. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listview.c | 1 + dlls/comctl32/tests/listview.c | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dlls/comctl32/listview.c b/dlls/comctl32/listview.c index 4cb1f0d..4d700b9 100644 --- a/dlls/comctl32/listview.c +++ b/dlls/comctl32/listview.c @@ -8834,6 +8834,7 @@ static BOOL LISTVIEW_SetItemCount(LISTVIEW_INFO *infoPtr, INT nItems, DWORD dwFl if (infoPtr->nFocusedItem >= nItems) { LISTVIEW_SetItemFocus(infoPtr, -1); + infoPtr->nFocusedItem = -1; SetRectEmpty(&infoPtr->rcFocus); } } diff --git a/dlls/comctl32/tests/listview.c b/dlls/comctl32/tests/listview.c index 4e2efe4..f291698 100644 --- a/dlls/comctl32/tests/listview.c +++ b/dlls/comctl32/tests/listview.c @@ -6107,10 +6107,9 @@ todo_wine ok(ret, "Failed to set item count.\n"); ret = SendMessageA(hwnd, LVM_GETNEXTITEM, -1, LVNI_FOCUSED); -todo_wine ok(ret == -1, "Unexpected focused item, ret %d\n", ret); - ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 2", TRUE); + ok_sequence(sequences, PARENT_SEQ_INDEX, empty_seq, "parent seq, owner data/focus 2", FALSE); /* 2 items, focus on index 0, reduce to 1 item. */ flush_sequences(sequences, NUM_MSG_SEQUENCES);
1
0
0
0
Nikolay Sivov : wshom: Implement Popup() method.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 8c68872416a07cdc6b4b837c42f74a27f55aa079 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8c68872416a07cdc6b4b837c4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Mon Dec 11 10:31:51 2017 +0300 wshom: Implement Popup() method. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wshom.ocx/shell.c | 78 +++++++++++++++++++++++++++++++++++++++++--- dlls/wshom.ocx/tests/wshom.c | 49 ++++++++++++++++++++++++++++ 2 files changed, 123 insertions(+), 4 deletions(-) diff --git a/dlls/wshom.ocx/shell.c b/dlls/wshom.ocx/shell.c index b00bc10..a023786 100644 --- a/dlls/wshom.ocx/shell.c +++ b/dlls/wshom.ocx/shell.c @@ -1275,11 +1275,81 @@ static HRESULT WINAPI WshShell3_Run(IWshShell3 *iface, BSTR cmd, VARIANT *style, } } -static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR Text, VARIANT* SecondsToWait, VARIANT *Title, VARIANT *Type, int *button) +struct popup_thread_param { - FIXME("(%s %s %s %s %p): stub\n", debugstr_w(Text), debugstr_variant(SecondsToWait), - debugstr_variant(Title), debugstr_variant(Type), button); - return E_NOTIMPL; + WCHAR *text; + VARIANT title; + VARIANT type; + INT button; +}; + +static DWORD WINAPI popup_thread_proc(void *arg) +{ + static const WCHAR defaulttitleW[] = {'W','i','n','d','o','w','s',' ','S','c','r','i','p','t',' ','H','o','s','t',0}; + struct popup_thread_param *param = (struct popup_thread_param *)arg; + + param->button = MessageBoxW(NULL, param->text, is_optional_argument(¶m->title) ? + defaulttitleW : V_BSTR(¶m->title), V_I4(¶m->type)); + return 0; +} + +static HRESULT WINAPI WshShell3_Popup(IWshShell3 *iface, BSTR text, VARIANT *seconds_to_wait, VARIANT *title, + VARIANT *type, int *button) +{ + struct popup_thread_param param; + DWORD tid, status; + VARIANT timeout; + HANDLE hthread; + HRESULT hr; + + TRACE("(%s %s %s %s %p)\n", debugstr_w(text), debugstr_variant(seconds_to_wait), debugstr_variant(title), + debugstr_variant(type), button); + + if (!seconds_to_wait || !title || !type || !button) + return E_POINTER; + + VariantInit(&timeout); + if (!is_optional_argument(seconds_to_wait)) + { + hr = VariantChangeType(&timeout, seconds_to_wait, 0, VT_I4); + if (FAILED(hr)) + return hr; + } + + VariantInit(¶m.type); + if (!is_optional_argument(type)) + { + hr = VariantChangeType(¶m.type, type, 0, VT_I4); + if (FAILED(hr)) + return hr; + } + + if (is_optional_argument(title)) + param.title = *title; + else + { + VariantInit(¶m.title); + hr = VariantChangeType(¶m.title, title, 0, VT_BSTR); + if (FAILED(hr)) + return hr; + } + + param.text = text; + param.button = -1; + hthread = CreateThread(NULL, 0, popup_thread_proc, ¶m, 0, &tid); + status = MsgWaitForMultipleObjects(1, &hthread, FALSE, V_I4(&timeout) ? V_I4(&timeout) * 1000: INFINITE, 0); + if (status == WAIT_TIMEOUT) + { + PostThreadMessageW(tid, WM_QUIT, 0, 0); + MsgWaitForMultipleObjects(1, &hthread, FALSE, INFINITE, 0); + param.button = -1; + } + *button = param.button; + + VariantClear(¶m.title); + CloseHandle(hthread); + + return S_OK; } static HRESULT WINAPI WshShell3_CreateShortcut(IWshShell3 *iface, BSTR PathLink, IDispatch** Shortcut) diff --git a/dlls/wshom.ocx/tests/wshom.c b/dlls/wshom.ocx/tests/wshom.c index 7e82f30..18ff4d6 100644 --- a/dlls/wshom.ocx/tests/wshom.c +++ b/dlls/wshom.ocx/tests/wshom.c @@ -566,6 +566,54 @@ static void test_registry(void) IWshShell3_Release(sh3); } +static void test_popup(void) +{ + static const WCHAR textW[] = {'T','e','x','t',0}; + VARIANT timeout, type, title, optional; + IWshShell *sh; + int button; + HRESULT hr; + BSTR text; + + hr = CoCreateInstance(&CLSID_WshShell, NULL, CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER, + &IID_IWshShell, (void **)&sh); + ok(hr == S_OK, "Failed to create WshShell object, hr %#x.\n", hr); + + button = 123; + text = SysAllocString(textW); + + hr = IWshShell_Popup(sh, NULL, NULL, NULL, NULL, &button); + ok(hr == E_POINTER, "Unexpected retval %#x.\n", hr); + ok(button == 123, "Unexpected button id %d.\n", button); + + hr = IWshShell_Popup(sh, text, NULL, NULL, NULL, &button); + ok(hr == E_POINTER, "Unexpected retval %#x.\n", hr); + ok(button == 123, "Unexpected button id %d.\n", button); + + V_VT(&optional) = VT_ERROR; + V_ERROR(&optional) = DISP_E_PARAMNOTFOUND; + + V_VT(&timeout) = VT_I2; + V_I2(&timeout) = 1; + + V_VT(&type) = VT_I2; + V_I2(&type) = 1; + + V_VT(&title) = VT_BSTR; + V_BSTR(&title) = NULL; + + hr = IWshShell_Popup(sh, text, &timeout, &optional, &type, &button); + ok(hr == S_OK, "Unexpected retval %#x.\n", hr); + ok(button == -1, "Unexpected button id %d.\n", button); + + hr = IWshShell_Popup(sh, text, &timeout, &title, &optional, &button); + ok(hr == S_OK, "Unexpected retval %#x.\n", hr); + ok(button == -1, "Unexpected button id %d.\n", button); + + SysFreeString(text); + IWshShell_Release(sh); +} + START_TEST(wshom) { IUnknown *unk; @@ -583,6 +631,7 @@ START_TEST(wshom) test_wshshell(); test_registry(); + test_popup(); CoUninitialize(); }
1
0
0
0
Józef Kucia : d3d10core/tests: Add test for initial depth stencil state.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 8a8b50901b4d1c2f1bd1d36764173c7179f31e19 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8a8b50901b4d1c2f1bd1d3676…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:30 2017 +0100 d3d10core/tests: Add test for initial depth stencil state. 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/device.c | 74 ++++++++++++++++++++++++++++++------------- 1 file changed, 52 insertions(+), 22 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 6aaeb33..7bbd7a7 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -9074,10 +9074,58 @@ static void test_clear_depth_stencil_view(void) ok(!refcount, "Device has %u references left.\n", refcount); } +static void test_initial_depth_stencil_state(void) +{ + static const struct vec4 green = {0.0f, 1.0f, 0.0f, 1.0f}; + static const struct vec4 red = {1.0f, 0.0f, 0.0f, 1.0f}; + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; + struct d3d10core_test_context test_context; + D3D10_TEXTURE2D_DESC texture_desc; + ID3D10DepthStencilView *dsv; + ID3D10Texture2D *texture; + ID3D10Device *device; + unsigned int count; + D3D10_VIEWPORT vp; + HRESULT hr; + + if (!init_test_context(&test_context)) + return; + device = test_context.device; + + ID3D10Texture2D_GetDesc(test_context.backbuffer, &texture_desc); + texture_desc.Format = DXGI_FORMAT_D32_FLOAT; + texture_desc.BindFlags = D3D10_BIND_DEPTH_STENCIL; + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, NULL, &dsv); + ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr); + + ID3D10Device_OMSetRenderTargets(device, 1, &test_context.backbuffer_rtv, dsv); + + count = 1; + ID3D10Device_RSGetViewports(device, &count, &vp); + + /* check if depth function is D3D10_COMPARISON_LESS */ + ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, white); + ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 0.5f, 0); + vp.MinDepth = vp.MaxDepth = 0.4f; + ID3D10Device_RSSetViewports(device, 1, &vp); + draw_color_quad(&test_context, &green); + draw_color_quad(&test_context, &red); + vp.MinDepth = vp.MaxDepth = 0.6f; + ID3D10Device_RSSetViewports(device, 1, &vp); + draw_color_quad(&test_context, &red); + check_texture_color(test_context.backbuffer, 0xff00ff00, 1); + check_texture_float(texture, 0.4f, 1); + + ID3D10DepthStencilView_Release(dsv); + ID3D10Texture2D_Release(texture); + release_test_context(&test_context); +} + static void test_draw_depth_only(void) { - ID3D10DepthStencilState *depth_stencil_state; - D3D10_DEPTH_STENCIL_DESC depth_stencil_desc; struct d3d10core_test_context test_context; ID3D10PixelShader *ps_color, *ps_depth; D3D10_TEXTURE2D_DESC texture_desc; @@ -9132,32 +9180,15 @@ static void test_draw_depth_only(void) cb = create_buffer(device, D3D10_BIND_CONSTANT_BUFFER, sizeof(depth), NULL); - texture_desc.Width = 640; - texture_desc.Height = 480; - texture_desc.MipLevels = 1; - texture_desc.ArraySize = 1; + ID3D10Texture2D_GetDesc(test_context.backbuffer, &texture_desc); texture_desc.Format = DXGI_FORMAT_D32_FLOAT; - texture_desc.SampleDesc.Count = 1; - texture_desc.SampleDesc.Quality = 0; - texture_desc.Usage = D3D10_USAGE_DEFAULT; texture_desc.BindFlags = D3D10_BIND_DEPTH_STENCIL; - texture_desc.CPUAccessFlags = 0; - texture_desc.MiscFlags = 0; - hr = ID3D10Device_CreateTexture2D(device, &texture_desc, NULL, &texture); ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); hr = ID3D10Device_CreateDepthStencilView(device, (ID3D10Resource *)texture, NULL, &dsv); ok(SUCCEEDED(hr), "Failed to create depth stencil view, hr %#x.\n", hr); - depth_stencil_desc.DepthEnable = TRUE; - depth_stencil_desc.DepthWriteMask = D3D10_DEPTH_WRITE_MASK_ALL; - depth_stencil_desc.DepthFunc = D3D10_COMPARISON_LESS; - depth_stencil_desc.StencilEnable = FALSE; - - hr = ID3D10Device_CreateDepthStencilState(device, &depth_stencil_desc, &depth_stencil_state); - ok(SUCCEEDED(hr), "Failed to create depth stencil state, hr %#x.\n", hr); - hr = ID3D10Device_CreatePixelShader(device, ps_color_code, sizeof(ps_color_code), &ps_color); ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); hr = ID3D10Device_CreatePixelShader(device, ps_depth_code, sizeof(ps_depth_code), &ps_depth); @@ -9166,7 +9197,6 @@ static void test_draw_depth_only(void) ID3D10Device_PSSetConstantBuffers(device, 0, 1, &cb); ID3D10Device_PSSetShader(device, ps_color); ID3D10Device_OMSetRenderTargets(device, 0, NULL, dsv); - ID3D10Device_OMSetDepthStencilState(device, depth_stencil_state, 0); ID3D10Device_ClearDepthStencilView(device, dsv, D3D10_CLEAR_DEPTH, 1.0f, 0); check_texture_float(texture, 1.0f, 1); @@ -9231,7 +9261,6 @@ static void test_draw_depth_only(void) ID3D10PixelShader_Release(ps_color); ID3D10PixelShader_Release(ps_depth); ID3D10DepthStencilView_Release(dsv); - ID3D10DepthStencilState_Release(depth_stencil_state); ID3D10Texture2D_Release(texture); release_test_context(&test_context); } @@ -13655,6 +13684,7 @@ START_TEST(device) test_swapchain_flip(); test_clear_render_target_view(); test_clear_depth_stencil_view(); + test_initial_depth_stencil_state(); test_draw_depth_only(); test_shader_stage_input_output_matching(); test_shader_interstage_interface();
1
0
0
0
Józef Kucia : d3d10core/tests: Add test for relative addressing of vertex shader inputs.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: e7400d20aac30edcb0aa527f1a8a1cc7a0b044bd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e7400d20aac30edcb0aa527f1…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:29 2017 +0100 d3d10core/tests: Add test for relative addressing of vertex shader inputs. 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/device.c | 119 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 8eb11da..6aaeb33 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -8419,6 +8419,124 @@ float4 main(const ps_in v) : SV_TARGET release_test_context(&test_context); } +static void test_vs_input_relative_addressing(void) +{ + struct d3d10core_test_context test_context; + unsigned int offset, stride; + unsigned int index[4] = {0}; + ID3D10PixelShader *ps; + ID3D10Buffer *vb, *cb; + ID3D10Device *device; + unsigned int i; + HRESULT hr; + + static const DWORD vs_code[] = + { +#if 0 + struct vertex + { + float4 position : POSITION; + float4 colors[4] : COLOR; + }; + + uint index; + + void main(vertex vin, out float4 position : SV_Position, + out float4 color : COLOR) + { + position = vin.position; + color = vin.colors[index]; + } +#endif + 0x43425844, 0x8623dd89, 0xe37fecf5, 0xea3fdfe1, 0xdf36e4e4, 0x00000001, 0x000001f4, 0x00000003, + 0x0000002c, 0x000000c4, 0x00000118, 0x4e475349, 0x00000090, 0x00000005, 0x00000008, 0x00000080, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000089, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x00000089, 0x00000001, 0x00000000, 0x00000003, 0x00000002, + 0x00000f0f, 0x00000089, 0x00000002, 0x00000000, 0x00000003, 0x00000003, 0x00000f0f, 0x00000089, + 0x00000003, 0x00000000, 0x00000003, 0x00000004, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0x4c4f4300, + 0xab00524f, 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000001, + 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, 0x00000003, 0x00000001, + 0x0000000f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x4f4c4f43, 0xabab0052, 0x52444853, 0x000000d4, + 0x00010040, 0x00000035, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x0300005f, 0x001010f2, + 0x00000000, 0x0300005f, 0x001010f2, 0x00000001, 0x0300005f, 0x001010f2, 0x00000002, 0x0300005f, + 0x001010f2, 0x00000003, 0x0300005f, 0x001010f2, 0x00000004, 0x04000067, 0x001020f2, 0x00000000, + 0x00000001, 0x03000065, 0x001020f2, 0x00000001, 0x02000068, 0x00000001, 0x0400005b, 0x001010f2, + 0x00000001, 0x00000004, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x06000036, + 0x00100012, 0x00000000, 0x0020800a, 0x00000000, 0x00000000, 0x07000036, 0x001020f2, 0x00000001, + 0x00d01e46, 0x00000001, 0x0010000a, 0x00000000, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + struct vs_out + { + float4 position : SV_POSITION; + float4 color : COLOR; + }; + + float4 main(struct vs_out i) : SV_TARGET + { + return i.color; + } +#endif + 0x43425844, 0xe2087fa6, 0xa35fbd95, 0x8e585b3f, 0x67890f54, 0x00000001, 0x000000f4, 0x00000003, + 0x0000002c, 0x00000080, 0x000000b4, 0x4e475349, 0x0000004c, 0x00000002, 0x00000008, 0x00000038, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x00000044, 0x00000000, 0x00000000, + 0x00000003, 0x00000001, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x4f4c4f43, 0xabab0052, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x45475241, 0xabab0054, 0x52444853, 0x00000038, 0x00000040, + 0x0000000e, 0x03001062, 0x001010f2, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x05000036, + 0x001020f2, 0x00000000, 0x00101e46, 0x00000001, 0x0100003e, + }; + static const D3D10_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0}, + {"COLOR", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 0, D3D10_INPUT_PER_INSTANCE_DATA, 1}, + {"COLOR", 1, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 4, D3D10_INPUT_PER_INSTANCE_DATA, 1}, + {"COLOR", 2, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 8, D3D10_INPUT_PER_INSTANCE_DATA, 1}, + {"COLOR", 3, DXGI_FORMAT_R8G8B8A8_UNORM, 1, 12, D3D10_INPUT_PER_INSTANCE_DATA, 1}, + }; + static const unsigned int colors[] = {0xff0000ff, 0xff00ff00, 0xffff0000, 0xff0f0f0f}; + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; + + if (!init_test_context(&test_context)) + return; + device = test_context.device; + + hr = ID3D10Device_CreateInputLayout(device, layout_desc, ARRAY_SIZE(layout_desc), + vs_code, sizeof(vs_code), &test_context.input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + cb = create_buffer(device, D3D10_BIND_CONSTANT_BUFFER, sizeof(index), NULL); + ID3D10Device_VSSetConstantBuffers(device, 0, 1, &cb); + + vb = create_buffer(device, D3D10_BIND_VERTEX_BUFFER, sizeof(colors), colors); + stride = sizeof(colors); + offset = 0; + ID3D10Device_IASetVertexBuffers(device, 1, 1, &vb, &stride, &offset); + + hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &test_context.vs); + ok(SUCCEEDED(hr), "Failed to create vertex shader, hr %#x.\n", hr); + + hr = ID3D10Device_CreatePixelShader(device, ps_code, sizeof(ps_code), &ps); + ok(SUCCEEDED(hr), "Failed to create pixel shader, hr %#x.\n", hr); + ID3D10Device_PSSetShader(device, ps); + + for (i = 0; i < ARRAY_SIZE(colors); ++i) + { + *index = i; + ID3D10Device_UpdateSubresource(device, (ID3D10Resource *)cb, 0, NULL, index, 0, 0); + ID3D10Device_ClearRenderTargetView(device, test_context.backbuffer_rtv, white); + draw_quad(&test_context); + check_texture_color(test_context.backbuffer, colors[i], 1); + } + + ID3D10Buffer_Release(cb); + ID3D10Buffer_Release(vb); + ID3D10PixelShader_Release(ps); + release_test_context(&test_context); +} + static void test_swapchain_formats(void) { DXGI_SWAP_CHAIN_DESC swapchain_desc; @@ -13531,6 +13649,7 @@ START_TEST(device) test_copy_subresource_region(); test_check_multisample_quality_levels(); test_cb_relative_addressing(); + test_vs_input_relative_addressing(); test_swapchain_formats(); test_swapchain_views(); test_swapchain_flip();
1
0
0
0
Józef Kucia : d3d10core/tests: Add test for SV_ClipDistance.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 972178b36a1820945fcec1fd6f6a8a3222ef21f6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=972178b36a1820945fcec1fd6…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:28 2017 +0100 d3d10core/tests: Add test for SV_ClipDistance. 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/device.c | 392 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 364 insertions(+), 28 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=972178b36a1820945fcec…
1
0
0
0
Józef Kucia : wined3d: Recognize SM5 eval_sample_index instruction.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 4a55ddce47f7742071f207f2a5c7dbbab5795c61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=4a55ddce47f7742071f207f2a…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:27 2017 +0100 wined3d: Recognize SM5 eval_sample_index instruction. 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/wined3d/arb_program_shader.c | 1 + dlls/wined3d/glsl_shader.c | 1 + dlls/wined3d/shader.c | 1 + dlls/wined3d/shader_sm4.c | 2 ++ dlls/wined3d/wined3d_private.h | 1 + 5 files changed, 6 insertions(+) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 6941a2b..11141b6 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5089,6 +5089,7 @@ static const SHADER_HANDLER shader_arb_instruction_handler_table[WINED3DSIH_TABL /* WINED3DSIH_DSY */ shader_hw_dsy, /* WINED3DSIH_DSY_COARSE */ NULL, /* WINED3DSIH_DSY_FINE */ NULL, + /* WINED3DSIH_EVAL_SAMPLE_INDEX */ NULL, /* WINED3DSIH_ELSE */ shader_hw_else, /* WINED3DSIH_EMIT */ NULL, /* WINED3DSIH_EMIT_STREAM */ NULL, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 32a75bf..e18a99f 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -11080,6 +11080,7 @@ static const SHADER_HANDLER shader_glsl_instruction_handler_table[WINED3DSIH_TAB /* WINED3DSIH_DSY */ shader_glsl_map2gl, /* WINED3DSIH_DSY_COARSE */ shader_glsl_map2gl, /* WINED3DSIH_DSY_FINE */ shader_glsl_map2gl, + /* WINED3DSIH_EVAL_SAMPLE_INDEX */ NULL, /* WINED3DSIH_ELSE */ shader_glsl_else, /* WINED3DSIH_EMIT */ shader_glsl_emit, /* WINED3DSIH_EMIT_STREAM */ shader_glsl_emit, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 04ced90..e59b9e5 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -125,6 +125,7 @@ static const char * const shader_opcode_names[] = /* WINED3DSIH_DSY */ "dsy", /* WINED3DSIH_DSY_COARSE */ "deriv_rty_coarse", /* WINED3DSIH_DSY_FINE */ "deriv_rty_fine", + /* WINED3DSIH_EVAL_SAMPLE_INDEX */ "eval_sample_index", /* WINED3DSIH_ELSE */ "else", /* WINED3DSIH_EMIT */ "emit", /* WINED3DSIH_EMIT_STREAM */ "emit_stream", diff --git a/dlls/wined3d/shader_sm4.c b/dlls/wined3d/shader_sm4.c index 2665a67..7c3e8b8 100644 --- a/dlls/wined3d/shader_sm4.c +++ b/dlls/wined3d/shader_sm4.c @@ -297,6 +297,7 @@ enum wined3d_sm4_opcode WINED3D_SM5_OP_IMM_ATOMIC_UMAX = 0xbc, WINED3D_SM5_OP_IMM_ATOMIC_UMIN = 0xbd, WINED3D_SM5_OP_SYNC = 0xbe, + WINED3D_SM5_OP_EVAL_SAMPLE_INDEX = 0xcc, WINED3D_SM5_OP_DCL_GS_INSTANCES = 0xce, }; @@ -1107,6 +1108,7 @@ static const struct wined3d_sm4_opcode_info opcode_table[] = {WINED3D_SM5_OP_IMM_ATOMIC_UMIN, WINED3DSIH_IMM_ATOMIC_UMIN, "uU", "iu"}, {WINED3D_SM5_OP_SYNC, WINED3DSIH_SYNC, "", "", shader_sm5_read_sync}, + {WINED3D_SM5_OP_EVAL_SAMPLE_INDEX, WINED3DSIH_EVAL_SAMPLE_INDEX, "f", "fi"}, {WINED3D_SM5_OP_DCL_GS_INSTANCES, WINED3DSIH_DCL_GS_INSTANCES, "", "", shader_sm4_read_declaration_count}, }; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index ab24f12..20f53aa 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -761,6 +761,7 @@ enum WINED3D_SHADER_INSTRUCTION_HANDLER WINED3DSIH_DSY, WINED3DSIH_DSY_COARSE, WINED3DSIH_DSY_FINE, + WINED3DSIH_EVAL_SAMPLE_INDEX, WINED3DSIH_ELSE, WINED3DSIH_EMIT, WINED3DSIH_EMIT_STREAM,
1
0
0
0
Józef Kucia : d3d11: Implement d3d10_device_CheckFormatSupport().
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: c371b46c4a78ca2d7a8e106f29ab411f5f4dd1bb URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c371b46c4a78ca2d7a8e106f2…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:26 2017 +0100 d3d11: Implement d3d10_device_CheckFormatSupport(). The d3d11_device_CheckFormatSupport() function should filter the format support based on the device feature level. 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/device.c | 15 ++++++++------- dlls/d3d11/device.c | 6 ++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 5221c0e..980d405 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -11006,6 +11006,7 @@ static void check_format_support(const unsigned int *format_support, continue; } + todo_wine ok(supported, "Format %#x - %s supported, format support %#x.\n", format, feature_name, format_support[format]); } @@ -11015,6 +11016,7 @@ static void test_required_format_support(void) { unsigned int format_support[DXGI_FORMAT_B4G4R4A4_UNORM + 1]; ID3D10Device *device; + unsigned int support; DXGI_FORMAT format; ULONG refcount; HRESULT hr; @@ -11031,20 +11033,19 @@ static void test_required_format_support(void) return; } + support = 0xdeadbeef; + hr = ID3D10Device_CheckFormatSupport(device, ~0u, &support); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + ok(!support, "Got unexpected format support %#x.\n", support); + memset(format_support, 0, sizeof(format_support)); for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format) { hr = ID3D10Device_CheckFormatSupport(device, format, &format_support[format]); - todo_wine ok(hr == S_OK || (hr == E_FAIL && !format_support[format]), + ok(hr == S_OK || (hr == E_FAIL && !format_support[format]), "Got unexpected result for format %#x: hr %#x, format_support %#x.\n", format, hr, format_support[format]); } - if (hr == E_NOTIMPL) - { - skip("CheckFormatSupport not implemented.\n"); - ID3D10Device_Release(device); - return; - } check_format_support(format_support, index_buffers, ARRAY_SIZE(index_buffers), D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER, "index buffer"); diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 820463c..b2a40b3 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -5417,10 +5417,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface, DXGI_FORMAT format, UINT *format_support) { - FIXME("iface %p, format %s, format_support %p stub!\n", + struct d3d_device *device = impl_from_ID3D10Device(iface); + + TRACE("iface %p, format %s, format_support %p.\n", iface, debug_dxgi_format(format), format_support); - return E_NOTIMPL; + return d3d11_device_CheckFormatSupport(&device->ID3D11Device_iface, format, format_support); } static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface,
1
0
0
0
Józef Kucia : d3d9/tests: Add test for checking D3DUSAGE_AUTOGENMIPMAP support.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 0ccc7c09bbe740ff94c7164a6c3ab1cab85fd72d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=0ccc7c09bbe740ff94c7164a6…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:25 2017 +0100 d3d9/tests: Add test for checking D3DUSAGE_AUTOGENMIPMAP support. 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/d3d9/tests/device.c | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 866f435..1a226ec 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -11497,6 +11497,27 @@ static void test_swapchain_parameters(void) static void test_check_device_format(void) { + static const D3DFORMAT adapter_formats[] = + { + D3DFMT_A8R8G8B8, + D3DFMT_X8R8G8B8, + }; + static const D3DFORMAT mipmap_autogen_formats[] = + { + D3DFMT_R8G8B8, + D3DFMT_A8R8G8B8, + D3DFMT_X8R8G8B8, + D3DFMT_R5G6B5, + D3DFMT_X1R5G5B5, + D3DFMT_A8P8, + D3DFMT_P8, + D3DFMT_A1R5G5B5, + D3DFMT_A4R4G4B4, + }; + + D3DFORMAT adapter_format, format; + BOOL render_target_supported; + unsigned int i, j; IDirect3D9 *d3d; HRESULT hr; @@ -11538,6 +11559,32 @@ static void test_check_device_format(void) D3DUSAGE_SOFTWAREPROCESSING, D3DRTYPE_INDEXBUFFER, D3DFMT_INDEX16); todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + for (i = 0; i < ARRAY_SIZE(adapter_formats); ++i) + { + adapter_format = adapter_formats[i]; + + for (j = 0; j < ARRAY_SIZE(mipmap_autogen_formats); ++j) + { + format = mipmap_autogen_formats[j]; + + hr = IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, adapter_format, + D3DUSAGE_RENDERTARGET, D3DRTYPE_TEXTURE, format); + ok(hr == D3D_OK || hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + render_target_supported = hr == D3D_OK; + + hr = IDirect3D9_CheckDeviceFormat(d3d, 0, D3DDEVTYPE_HAL, adapter_format, + D3DUSAGE_RENDERTARGET | D3DUSAGE_AUTOGENMIPMAP, D3DRTYPE_TEXTURE, format); + if (render_target_supported) + { + ok(hr == D3D_OK || hr == D3DOK_NOAUTOGEN, "Got unexpected hr %#x.\n", hr); + } + else + { + ok(hr == D3DERR_NOTAVAILABLE, "Got unexpected hr %#x.\n", hr); + } + } + } + IDirect3D9_Release(d3d); }
1
0
0
0
Józef Kucia : wined3d: Fix device format support checks for multiple usages.
by Alexandre Julliard
11 Dec '17
11 Dec '17
Module: wine Branch: master Commit: 6e5df50ac8e18e11de0486361938a6b586ed0195 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6e5df50ac8e18e11de0486361…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Mon Dec 11 10:25:24 2017 +0100 wined3d: Fix device format support checks for multiple usages. We can return WINED3DOK_NOAUTOGEN only when all other resource usages are supported. Fixes 25a8773d21d0 ("wined3d: Advertise AUTOGENMIPMAP only for renderable and filterable formats."). The problem was present before 25a8773d21d0, but the mentioned commit made it much worse. Previously, it was an issue only for OpenGL implementations which do not support the GL_SGIS_generate_mipmap extension. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/directx.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index c145944..1586bdc 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -5273,10 +5273,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad { const struct wined3d_adapter *adapter = &wined3d->adapters[adapter_idx]; const struct wined3d_gl_info *gl_info = &adapter->gl_info; - const struct wined3d_format *adapter_format = wined3d_get_format(gl_info, adapter_format_id, - WINED3DUSAGE_RENDERTARGET); - const struct wined3d_format *format = wined3d_get_format(gl_info, check_format_id, usage); + const struct wined3d_format *adapter_format, *format; enum wined3d_gl_resource_type gl_type, gl_type_end; + BOOL mipmap_autogen_supported; DWORD format_flags = 0; DWORD allowed_usage; @@ -5289,6 +5288,9 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad if (adapter_idx >= wined3d->adapter_count) return WINED3DERR_INVALIDCALL; + adapter_format = wined3d_get_format(gl_info, adapter_format_id, WINED3DUSAGE_RENDERTARGET); + format = wined3d_get_format(gl_info, check_format_id, usage); + switch (resource_type) { case WINED3D_RTYPE_NONE: @@ -5387,14 +5389,7 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad return WINED3DERR_NOTAVAILABLE; } - if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && (!gl_info->supported[SGIS_GENERATE_MIPMAP] - || (format->flags[gl_type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)) - != (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING))) - { - TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n"); - return WINED3DOK_NOAUTOGEN; - } - + mipmap_autogen_supported = gl_info->supported[SGIS_GENERATE_MIPMAP]; for (; gl_type <= gl_type_end; ++gl_type) { if ((format->flags[gl_type] & format_flags) != format_flags) @@ -5423,6 +5418,18 @@ HRESULT CDECL wined3d_check_device_format(const struct wined3d *wined3d, UINT ad debug_d3dformat(check_format_id)); return WINED3DERR_NOTAVAILABLE; } + + if ((format->flags[gl_type] & (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)) + != (WINED3DFMT_FLAG_RENDERTARGET | WINED3DFMT_FLAG_FILTERING)) + { + mipmap_autogen_supported = FALSE; + } + } + + if ((usage & WINED3DUSAGE_AUTOGENMIPMAP) && !mipmap_autogen_supported) + { + TRACE("No WINED3DUSAGE_AUTOGENMIPMAP support, returning WINED3DOK_NOAUTOGEN.\n"); + return WINED3DOK_NOAUTOGEN; } return WINED3D_OK;
1
0
0
0
← Newer
1
...
18
19
20
21
22
23
24
...
45
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
Results per page:
10
25
50
100
200