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
June
May
April
March
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
February 2019
----- 2025 -----
June 2025
May 2025
April 2025
March 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
1 participants
672 discussions
Start a n
N
ew thread
Gabriel Ivăncescu : comctl32/listbox: Use a helper to retrieve item string by index.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: d1b0626c8152fcd652d3127cf48ab8ff7092386c URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d1b0626c8152fcd652d3127c…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 13 16:36:17 2019 +0200 comctl32/listbox: Use a helper to retrieve item string by index. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listbox.c | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 61bb9da..a6f7bd5 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -158,6 +158,11 @@ static ULONG_PTR get_item_data( const LB_DESCR *descr, UINT index ) return (descr->style & LBS_NODATA) ? 0 : descr->items[index].data; } +static WCHAR *get_item_string( const LB_DESCR *descr, UINT index ) +{ + return HAS_STRINGS(descr) ? descr->items[index].str : NULL; +} + static BOOL is_item_selected( const LB_DESCR *descr, UINT index ) { if (!(descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL))) @@ -526,11 +531,11 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, INT index, UINT action, BOOL ignoreFocus ) { BOOL selected = FALSE, focused; - LB_ITEMDATA *item = NULL; + WCHAR *item_str = NULL; if (index < descr->nb_items) { - item = &descr->items[index]; + item_str = get_item_string(descr, index); selected = is_item_selected(descr, index); } @@ -573,7 +578,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, dis.itemData = get_item_data(descr, index); dis.rcItem = *rect; TRACE("[%p]: drawitem %d (%s) action=%02x state=%02x rect=%s\n", - descr->self, index, item ? debugstr_w(item->str) : "", action, + descr->self, index, debugstr_w(item_str), action, dis.itemState, wine_dbgstr_rect(rect) ); SendMessageW(descr->owner, WM_DRAWITEM, dis.CtlID, (LPARAM)&dis); SelectClipRgn( hdc, hrgn ); @@ -595,22 +600,22 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, } TRACE("[%p]: painting %d (%s) action=%02x rect=%s\n", - descr->self, index, item ? debugstr_w(item->str) : "", action, + descr->self, index, debugstr_w(item_str), action, wine_dbgstr_rect(rect) ); - if (!item) + if (!item_str) ExtTextOutW( hdc, rect->left + 1, rect->top, ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL ); else if (!(descr->style & LBS_USETABSTOPS)) ExtTextOutW( hdc, rect->left + 1, rect->top, - ETO_OPAQUE | ETO_CLIPPED, rect, item->str, - strlenW(item->str), NULL ); + ETO_OPAQUE | ETO_CLIPPED, rect, item_str, + strlenW(item_str), NULL ); else { /* Output empty string to paint background in the full width. */ ExtTextOutW( hdc, rect->left + 1, rect->top, ETO_OPAQUE | ETO_CLIPPED, rect, NULL, 0, NULL ); TabbedTextOutW( hdc, rect->left + 1 , rect->top, - item->str, strlenW(item->str), + item_str, strlenW(item_str), descr->nb_tabs, descr->tabs, 0); } if (selected) @@ -773,14 +778,16 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL if (HAS_STRINGS(descr)) { + WCHAR *str = get_item_string(descr, index); + if (!buffer) - return strlenW(descr->items[index].str); + return strlenW(str); - TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(descr->items[index].str)); + TRACE("index %d (0x%04x) %s\n", index, index, debugstr_w(str)); __TRY /* hide a Delphi bug that passes a read-only buffer */ { - strcpyW( buffer, descr->items[index].str ); + strcpyW(buffer, str); len = strlenW(buffer); } __EXCEPT_PAGE_FAULT @@ -829,7 +836,7 @@ static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact ) { index = (min + max) / 2; if (HAS_STRINGS(descr)) - res = LISTBOX_lstrcmpiW( descr->locale, descr->items[index].str, str ); + res = LISTBOX_lstrcmpiW( descr->locale, get_item_string(descr, index), str ); else { COMPAREITEMSTRUCT cis; @@ -872,7 +879,7 @@ static INT LISTBOX_FindFileStrPos( LB_DESCR *descr, LPCWSTR str ) while (min != max) { INT index = (min + max) / 2; - LPCWSTR p = descr->items[index].str; + LPCWSTR p = get_item_string(descr, index); if (*p == '[') /* drive or directory */ { if (*str != '[') res = -1; @@ -1646,7 +1653,7 @@ static void LISTBOX_DeleteItem( LB_DESCR *descr, INT index ) { /* save the item data before it gets freed by LB_RESETCONTENT */ ULONG_PTR item_data = get_item_data(descr, index); - LPWSTR item_str = descr->items[index].str; + LPWSTR item_str = get_item_string(descr, index); if (!descr->nb_items) SendMessageW( descr->self, LB_RESETCONTENT, 0, 0 ); @@ -1668,8 +1675,7 @@ static void LISTBOX_DeleteItem( LB_DESCR *descr, INT index ) dis.itemData = item_data; SendMessageW( descr->owner, WM_DELETEITEM, id, (LPARAM)&dis ); } - if (HAS_STRINGS(descr)) - HeapFree( GetProcessHeap(), 0, item_str ); + HeapFree( GetProcessHeap(), 0, item_str ); } @@ -2672,7 +2678,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam, return LB_ERR; } if (!HAS_STRINGS(descr)) return sizeof(ULONG_PTR); - return strlenW( descr->items[wParam].str ); + return strlenW(get_item_string(descr, wParam)); case LB_GETCURSEL: if (descr->nb_items == 0)
1
0
0
0
Gabriel Ivăncescu : comctl32/listbox: Use a helper to retrieve item data by index.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: e16d591dc802dc913acc7db288f774b06cb28030 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=e16d591dc802dc913acc7db2…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 13 16:36:16 2019 +0200 comctl32/listbox: Use a helper to retrieve item data by index. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listbox.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 5c58214..61bb9da 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -153,6 +153,11 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size) return TRUE; } +static ULONG_PTR get_item_data( const LB_DESCR *descr, UINT index ) +{ + return (descr->style & LBS_NODATA) ? 0 : descr->items[index].data; +} + static BOOL is_item_selected( const LB_DESCR *descr, UINT index ) { if (!(descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL))) @@ -565,7 +570,7 @@ static void LISTBOX_PaintItem( LB_DESCR *descr, HDC hdc, const RECT *rect, if (focused) dis.itemState |= ODS_FOCUS; if (!IsWindowEnabled(descr->self)) dis.itemState |= ODS_DISABLED; - dis.itemData = item ? item->data : 0; + dis.itemData = get_item_data(descr, index); dis.rcItem = *rect; TRACE("[%p]: drawitem %d (%s) action=%02x state=%02x rect=%s\n", descr->self, index, item ? debugstr_w(item->str) : "", action, @@ -788,8 +793,7 @@ static LRESULT LISTBOX_GetText( LB_DESCR *descr, INT index, LPWSTR buffer, BOOL } else { if (buffer) - *((ULONG_PTR *)buffer) = (descr->style & LBS_NODATA) - ? 0 : descr->items[index].data; + *((ULONG_PTR *)buffer) = get_item_data(descr, index); len = sizeof(ULONG_PTR); } return len; @@ -837,7 +841,7 @@ static INT LISTBOX_FindStringPos( LB_DESCR *descr, LPCWSTR str, BOOL exact ) /* note that some application (MetaStock) expects the second item * to be in the listbox */ cis.itemID1 = index; - cis.itemData1 = descr->items[index].data; + cis.itemData1 = get_item_data(descr, index); cis.itemID2 = -1; cis.itemData2 = (ULONG_PTR)str; cis.dwLocaleId = descr->locale; @@ -1641,7 +1645,7 @@ static LRESULT LISTBOX_InsertString( LB_DESCR *descr, INT index, LPCWSTR str ) static void LISTBOX_DeleteItem( LB_DESCR *descr, INT index ) { /* save the item data before it gets freed by LB_RESETCONTENT */ - ULONG_PTR item_data = descr->items[index].data; + ULONG_PTR item_data = get_item_data(descr, index); LPWSTR item_str = descr->items[index].str; if (!descr->nb_items) @@ -2643,7 +2647,7 @@ static LRESULT CALLBACK LISTBOX_WindowProc( HWND hwnd, UINT msg, WPARAM wParam, SetLastError(ERROR_INVALID_INDEX); return LB_ERR; } - return (descr->style & LBS_NODATA) ? 0 : descr->items[wParam].data; + return get_item_data(descr, wParam); case LB_SETITEMDATA: if (((INT)wParam < 0) || ((INT)wParam >= descr->nb_items))
1
0
0
0
Gabriel Ivăncescu : comctl32/tests: Test changing the selection styles after listbox creation.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: b00482e2a4b3e045a8be35a8e0ae2d6daa9025e4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b00482e2a4b3e045a8be35a8…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 13 16:36:15 2019 +0200 comctl32/tests: Test changing the selection styles after listbox creation. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/tests/listbox.c | 130 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 130 insertions(+) diff --git a/dlls/comctl32/tests/listbox.c b/dlls/comctl32/tests/listbox.c index 68e4073..0cdcdea 100644 --- a/dlls/comctl32/tests/listbox.c +++ b/dlls/comctl32/tests/listbox.c @@ -784,6 +784,135 @@ static void test_listbox_height(void) DestroyWindow( hList ); } +static void test_changing_selection_styles(void) +{ + static const DWORD styles[] = + { + 0, + LBS_NODATA | LBS_OWNERDRAWFIXED + }; + static const DWORD selstyles[] = + { + 0, + LBS_MULTIPLESEL, + LBS_EXTENDEDSEL, + LBS_MULTIPLESEL | LBS_EXTENDEDSEL + }; + static const LONG selexpect_single[] = { 0, 0, 1 }; + static const LONG selexpect_single2[] = { 1, 0, 0 }; + static const LONG selexpect_multi[] = { 1, 0, 1 }; + static const LONG selexpect_multi2[] = { 1, 1, 0 }; + + HWND parent, listbox; + DWORD style; + LONG ret; + UINT i, j, k; + + parent = create_parent(); + ok(parent != NULL, "Failed to create parent window.\n"); + for (i = 0; i < ARRAY_SIZE(styles); i++) + { + /* Test if changing selection styles affects selection storage */ + for (j = 0; j < ARRAY_SIZE(selstyles); j++) + { + LONG setcursel_expect, selitemrange_expect, getselcount_expect; + const LONG *selexpect; + + listbox = CreateWindowA(WC_LISTBOXA, "TestList", styles[i] | selstyles[j] | WS_CHILD | WS_VISIBLE, + 0, 0, 100, 100, parent, (HMENU)ID_LISTBOX, NULL, 0); + ok(listbox != NULL, "%u: Failed to create ListBox window.\n", j); + + if (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) + { + setcursel_expect = LB_ERR; + selitemrange_expect = LB_OKAY; + getselcount_expect = 2; + selexpect = selexpect_multi; + } + else + { + setcursel_expect = 2; + selitemrange_expect = LB_ERR; + getselcount_expect = LB_ERR; + selexpect = selexpect_single; + } + + for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) + { + ret = SendMessageA(listbox, LB_INSERTSTRING, -1, (LPARAM)"x"); + ok(ret == k, "%u: Unexpected return value %d, expected %d.\n", j, ret, k); + } + ret = SendMessageA(listbox, LB_GETCOUNT, 0, 0); + ok(ret == ARRAY_SIZE(selexpect_multi), "%u: Unexpected count %d.\n", j, ret); + + /* Select items with different methods */ + ret = SendMessageA(listbox, LB_SETCURSEL, 2, 0); + ok(ret == setcursel_expect, "%u: Unexpected return value %d.\n", j, ret); + ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(0, 0)); + ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(2, 2)); + ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + + /* Verify that the proper items are selected */ + for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) + { + ret = SendMessageA(listbox, LB_GETSEL, k, 0); + ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n", + j, ret, selexpect[k]); + } + + /* Now change the selection style */ + style = GetWindowLongA(listbox, GWL_STYLE); + ok((style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) == selstyles[j], + "%u: unexpected window styles %#x.\n", j, style); + if (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) + style &= ~selstyles[j]; + else + style |= LBS_MULTIPLESEL | LBS_EXTENDEDSEL; + SetWindowLongA(listbox, GWL_STYLE, style); + style = GetWindowLongA(listbox, GWL_STYLE); + ok(!(style & selstyles[j]), "%u: unexpected window styles %#x.\n", j, style); + + /* Verify that the same items are selected */ + ret = SendMessageA(listbox, LB_GETSELCOUNT, 0, 0); + ok(ret == getselcount_expect, "%u: expected %d from LB_GETSELCOUNT, got %d\n", + j, getselcount_expect, ret); + + for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) + { + ret = SendMessageA(listbox, LB_GETSEL, k, 0); + ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n", + j, ret, selexpect[k]); + } + + /* Lastly see if we can still change the selection as before with old style */ + if (setcursel_expect != LB_ERR) setcursel_expect = 0; + ret = SendMessageA(listbox, LB_SETCURSEL, 0, 0); + ok(ret == setcursel_expect, "%u: Unexpected return value %d.\n", j, ret); + ret = SendMessageA(listbox, LB_SELITEMRANGE, TRUE, MAKELPARAM(1, 1)); + ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + ret = SendMessageA(listbox, LB_SELITEMRANGE, FALSE, MAKELPARAM(2, 2)); + ok(ret == selitemrange_expect, "%u: Unexpected return value %d.\n", j, ret); + + /* And verify the selections */ + selexpect = (selstyles[j] & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL)) ? selexpect_multi2 : selexpect_single2; + ret = SendMessageA(listbox, LB_GETSELCOUNT, 0, 0); + ok(ret == getselcount_expect, "%u: expected %d from LB_GETSELCOUNT, got %d\n", + j, getselcount_expect, ret); + + for (k = 0; k < ARRAY_SIZE(selexpect_multi); k++) + { + ret = SendMessageA(listbox, LB_GETSEL, k, 0); + ok(ret == selexpect[k], "%u: Unexpected selection state %d, expected %d.\n", + j, ret, selexpect[k]); + } + + DestroyWindow(listbox); + } + } + DestroyWindow(parent); +} + static void test_itemfrompoint(void) { /* WS_POPUP is required in order to have a more accurate size calculation ( @@ -2483,6 +2612,7 @@ START_TEST(listbox) test_LB_SELITEMRANGE(); test_LB_SETCURSEL(); test_listbox_height(); + test_changing_selection_styles(); test_itemfrompoint(); test_listbox_item_data(); test_listbox_LB_DIR();
1
0
0
0
Gabriel Ivăncescu : comctl32/listbox: Use descr-> selected_item for single-selection listboxes when checking selection.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: 1f062e386fa9e27812be56378380e76aefaf28b5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1f062e386fa9e27812be5637…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 13 16:36:14 2019 +0200 comctl32/listbox: Use descr->selected_item for single-selection listboxes when checking selection. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listbox.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index 6ab224e..5c58214 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -155,6 +155,8 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size) static BOOL is_item_selected( const LB_DESCR *descr, UINT index ) { + if (!(descr->style & (LBS_MULTIPLESEL | LBS_EXTENDEDSEL))) + return index == descr->selected_item; return descr->items[index].selected; }
1
0
0
0
Gabriel Ivăncescu : comctl32/listbox: Repaint the old selected item after setting the item selection.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: 012b7669f794f48d941ada46443644ad895d60b7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=012b7669f794f48d941ada46…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 13 16:36:13 2019 +0200 comctl32/listbox: Repaint the old selected item after setting the item selection. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index db7d474..6ab224e 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -1466,8 +1466,8 @@ static LRESULT LISTBOX_SetSelection( LB_DESCR *descr, INT index, if (index == oldsel) return LB_OKAY; if (oldsel != -1) descr->items[oldsel].selected = FALSE; if (index != -1) descr->items[index].selected = TRUE; - if (oldsel != -1) LISTBOX_RepaintItem( descr, oldsel, ODA_SELECT ); descr->selected_item = index; + if (oldsel != -1) LISTBOX_RepaintItem( descr, oldsel, ODA_SELECT ); if (index != -1) LISTBOX_RepaintItem( descr, index, ODA_SELECT ); if (send_notify && descr->nb_items) SEND_NOTIFICATION( descr, (index != -1) ? LBN_SELCHANGE : LBN_SELCANCEL );
1
0
0
0
Gabriel Ivăncescu : comctl32/listbox: Resize the entire item array at once in SetCount.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: eed36af54bfcfec5603c88956cc42059b05ea433 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=eed36af54bfcfec5603c8895…
Author: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Date: Wed Feb 13 16:36:12 2019 +0200 comctl32/listbox: Resize the entire item array at once in SetCount. Signed-off-by: Gabriel Ivăncescu <gabrielopcode(a)gmail.com> Signed-off-by: Huw Davies <huw(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/comctl32/listbox.c | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) diff --git a/dlls/comctl32/listbox.c b/dlls/comctl32/listbox.c index c92c2a2..db7d474 100644 --- a/dlls/comctl32/listbox.c +++ b/dlls/comctl32/listbox.c @@ -144,6 +144,12 @@ static BOOL resize_storage(LB_DESCR *descr, UINT items_size) descr->items_size = items_size; descr->items = items; } + + if ((descr->style & LBS_NODATA) && items_size > descr->nb_items) + { + memset(&descr->items[descr->nb_items], 0, + (items_size - descr->nb_items) * sizeof(LB_ITEMDATA)); + } return TRUE; } @@ -1742,25 +1748,36 @@ static void LISTBOX_ResetContent( LB_DESCR *descr ) /*********************************************************************** * LISTBOX_SetCount */ -static LRESULT LISTBOX_SetCount( LB_DESCR *descr, INT count ) +static LRESULT LISTBOX_SetCount( LB_DESCR *descr, UINT count ) { - LRESULT ret; + UINT orig_num = descr->nb_items; if (!(descr->style & LBS_NODATA)) return LB_ERR; - /* FIXME: this is far from optimal... */ - if (count > descr->nb_items) - { - while (count > descr->nb_items) - if ((ret = LISTBOX_InsertString( descr, -1, 0 )) < 0) - return ret; - } - else if (count < descr->nb_items) + if (!resize_storage(descr, count)) + return LB_ERRSPACE; + descr->nb_items = count; + + if (count) { - while (count < descr->nb_items) - if ((ret = LISTBOX_RemoveItem( descr, (descr->nb_items - 1) )) < 0) - return ret; + LISTBOX_UpdateScroll(descr); + if (count < orig_num) + { + descr->anchor_item = min(descr->anchor_item, count - 1); + if (descr->selected_item >= count) + descr->selected_item = -1; + + /* If we removed the scrollbar, reset the top of the list */ + if (count <= descr->page_size && orig_num > descr->page_size) + LISTBOX_SetTopItem(descr, 0, TRUE); + + descr->focus_item = min(descr->focus_item, count - 1); + } + + /* If it was empty before growing, set focus to the first item */ + else if (orig_num == 0) LISTBOX_SetCaretIndex(descr, 0, FALSE); } + else SendMessageW(descr->self, LB_RESETCONTENT, 0, 0); InvalidateRect( descr->self, NULL, TRUE ); return LB_OKAY;
1
0
0
0
Zebediah Figura : wined3d: Correct indices for contained states in wined3d_stateblock_apply().
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: wine Branch: master Commit: 1ae12240d4f1110f948b045bdbfe273e5cd7aa29 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=1ae12240d4f1110f948b045b…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Tue Feb 12 20:00:08 2019 -0600 wined3d: Correct indices for contained states in wined3d_stateblock_apply(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46602
Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/stateblock.c | 49 +++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 65f953f..cd57e6c 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1040,21 +1040,24 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) /* Vertex Shader Constants. */ for (i = 0; i < stateblock->num_contained_vs_consts_f; ++i) { - state->vs_consts_f[i] = stateblock->stateblock_state.vs_consts_f[i]; - wined3d_device_set_vs_consts_f(device, stateblock->contained_vs_consts_f[i], - 1, &stateblock->stateblock_state.vs_consts_f[stateblock->contained_vs_consts_f[i]]); + unsigned int idx = stateblock->contained_vs_consts_f[i]; + + state->vs_consts_f[idx] = stateblock->stateblock_state.vs_consts_f[idx]; + wined3d_device_set_vs_consts_f(device, idx, 1, &stateblock->stateblock_state.vs_consts_f[idx]); } for (i = 0; i < stateblock->num_contained_vs_consts_i; ++i) { - state->vs_consts_i[i] = stateblock->stateblock_state.vs_consts_i[i]; - wined3d_device_set_vs_consts_i(device, stateblock->contained_vs_consts_i[i], - 1, &stateblock->stateblock_state.vs_consts_i[stateblock->contained_vs_consts_i[i]]); + unsigned int idx = stateblock->contained_vs_consts_i[i]; + + state->vs_consts_i[idx] = stateblock->stateblock_state.vs_consts_i[idx]; + wined3d_device_set_vs_consts_i(device, idx, 1, &stateblock->stateblock_state.vs_consts_i[idx]); } for (i = 0; i < stateblock->num_contained_vs_consts_b; ++i) { - state->vs_consts_b[i] = stateblock->stateblock_state.vs_consts_b[i]; - wined3d_device_set_vs_consts_b(device, stateblock->contained_vs_consts_b[i], - 1, &stateblock->stateblock_state.vs_consts_b[stateblock->contained_vs_consts_b[i]]); + unsigned int idx = stateblock->contained_vs_consts_b[i]; + + state->vs_consts_b[idx] = stateblock->stateblock_state.vs_consts_b[idx]; + wined3d_device_set_vs_consts_b(device, idx, 1, &stateblock->stateblock_state.vs_consts_b[idx]); } for (i = 0; i < ARRAY_SIZE(stateblock->stateblock_state.light_state.light_map); ++i) @@ -1087,29 +1090,33 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock) /* Pixel Shader Constants. */ for (i = 0; i < stateblock->num_contained_ps_consts_f; ++i) { - state->ps_consts_f[i] = stateblock->stateblock_state.ps_consts_f[i]; - wined3d_device_set_ps_consts_f(device, stateblock->contained_ps_consts_f[i], - 1, &stateblock->stateblock_state.ps_consts_f[stateblock->contained_ps_consts_f[i]]); + unsigned int idx = stateblock->contained_ps_consts_f[i]; + + state->ps_consts_f[idx] = stateblock->stateblock_state.ps_consts_f[idx]; + wined3d_device_set_ps_consts_f(device, idx, 1, &stateblock->stateblock_state.ps_consts_f[idx]); } for (i = 0; i < stateblock->num_contained_ps_consts_i; ++i) { - state->ps_consts_i[i] = stateblock->stateblock_state.ps_consts_i[i]; - wined3d_device_set_ps_consts_i(device, stateblock->contained_ps_consts_i[i], - 1, &stateblock->stateblock_state.ps_consts_i[stateblock->contained_ps_consts_i[i]]); + unsigned int idx = stateblock->contained_ps_consts_i[i]; + + state->ps_consts_i[idx] = stateblock->stateblock_state.ps_consts_i[idx]; + wined3d_device_set_ps_consts_i(device, idx, 1, &stateblock->stateblock_state.ps_consts_i[idx]); } for (i = 0; i < stateblock->num_contained_ps_consts_b; ++i) { - state->ps_consts_b[i] = stateblock->stateblock_state.ps_consts_b[i]; - wined3d_device_set_ps_consts_b(device, stateblock->contained_ps_consts_b[i], - 1, &stateblock->stateblock_state.ps_consts_b[stateblock->contained_ps_consts_b[i]]); + unsigned int idx = stateblock->contained_ps_consts_b[i]; + + state->ps_consts_b[idx] = stateblock->stateblock_state.ps_consts_b[idx]; + wined3d_device_set_ps_consts_b(device, idx, 1, &stateblock->stateblock_state.ps_consts_b[idx]); } /* Render states. */ for (i = 0; i < stateblock->num_contained_render_states; ++i) { - state->rs[i] = stateblock->stateblock_state.rs[i]; - wined3d_device_set_render_state(device, stateblock->contained_render_states[i], - stateblock->stateblock_state.rs[stateblock->contained_render_states[i]]); + enum wined3d_render_state rs = stateblock->contained_render_states[i]; + + state->rs[rs] = stateblock->stateblock_state.rs[rs]; + wined3d_device_set_render_state(device, rs, stateblock->stateblock_state.rs[rs]); } /* Texture states. */
1
0
0
0
Józef Kucia : vkd3d: Avoid passing invalid viewport to Vulkan.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: vkd3d Branch: master Commit: 70822141b73eaf699d2696f4c7cc9a5b72a22be6 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=70822141b73eaf699d2696f…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Feb 14 12:22:34 2019 +0100 vkd3d: Avoid passing invalid viewport to Vulkan. Needs more tests. 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> --- libs/vkd3d/command.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 4a9f7c4..7457ae3 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -2953,6 +2953,12 @@ static void STDMETHODCALLTYPE d3d12_command_list_RSSetViewports(ID3D12GraphicsCo vk_viewports[i].height = -viewports[i].Height; vk_viewports[i].minDepth = viewports[i].MinDepth; vk_viewports[i].maxDepth = viewports[i].MaxDepth; + + if (!vk_viewports[i].width || !vk_viewports[i].height) + { + FIXME("Invalid viewport %u, ignoring RSSetViewports().\n", i); + return; + } } vk_procs = &list->device->vk_procs;
1
0
0
0
Józef Kucia : vkd3d-shader: Add support for OpenGL tessellation shaders.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: vkd3d Branch: master Commit: c333fddaf922a51d3fd56c09b7acfe73ce7cf9cd URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=c333fddaf922a51d3fd56c0…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Feb 14 12:22:33 2019 +0100 vkd3d-shader: Add support for OpenGL tessellation shaders. In DXBC tessellator parameters are specified in hull shaders. In OpenGL, even in SPIR-V, tessellator parameters must be specified in the tessellation evaluation shader. 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> --- include/vkd3d_shader.h | 27 +++++++++++++++++++++ libs/vkd3d-shader/spirv.c | 41 +++++++++++++++++++++++++------- libs/vkd3d-shader/vkd3d_shader_private.h | 17 ------------- 3 files changed, 60 insertions(+), 25 deletions(-) diff --git a/include/vkd3d_shader.h b/include/vkd3d_shader.h index 679abfe..fef058c 100644 --- a/include/vkd3d_shader.h +++ b/include/vkd3d_shader.h @@ -33,6 +33,7 @@ enum vkd3d_shader_structure_type VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_ARGUMENTS, VKD3D_SHADER_STRUCTURE_TYPE_SCAN_INFO, VKD3D_SHADER_STRUCTURE_TYPE_TRANSFORM_FEEDBACK_INFO, + VKD3D_SHADER_STRUCTURE_TYPE_DOMAIN_SHADER_COMPILE_ARGUMENTS, VKD3D_FORCE_32_BIT_ENUM(VKD3D_SHADER_STRUCTURE_TYPE), }; @@ -195,6 +196,32 @@ struct vkd3d_shader_compile_arguments unsigned int output_swizzle_count; }; +enum vkd3d_tessellator_output_primitive +{ + VKD3D_TESSELLATOR_OUTPUT_POINT = 1, + VKD3D_TESSELLATOR_OUTPUT_LINE = 2, + VKD3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, + VKD3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, +}; + +enum vkd3d_tessellator_partitioning +{ + VKD3D_TESSELLATOR_PARTITIONING_INTEGER = 1, + VKD3D_TESSELLATOR_PARTITIONING_POW2 = 2, + VKD3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, + VKD3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, +}; + +/* Extends vkd3d_shader_compile_arguments. */ +struct vkd3d_shader_domain_shader_compile_arguments +{ + enum vkd3d_shader_structure_type type; + const void *next; + + enum vkd3d_tessellator_output_primitive output_primitive; + enum vkd3d_tessellator_output_primitive partitioning; +}; + int vkd3d_shader_compile_dxbc(const struct vkd3d_shader_code *dxbc, struct vkd3d_shader_code *spirv, unsigned int compiler_options, const struct vkd3d_shader_interface_info *shader_interface_info, diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 97963e9..6ba169f 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -4856,6 +4856,9 @@ static void vkd3d_dxbc_compiler_emit_dcl_tessellator_domain(struct vkd3d_dxbc_co enum vkd3d_tessellator_domain domain = instruction->declaration.tessellator_domain; SpvExecutionMode mode; + if (compiler->shader_type == VKD3D_SHADER_TYPE_HULL && vkd3d_dxbc_compiler_is_opengl_target(compiler)) + return; + switch (domain) { case VKD3D_TESSELLATOR_DOMAIN_LINE: @@ -4875,12 +4878,14 @@ static void vkd3d_dxbc_compiler_emit_dcl_tessellator_domain(struct vkd3d_dxbc_co vkd3d_dxbc_compiler_emit_execution_mode(compiler, mode, NULL, 0); } -static void vkd3d_dxbc_compiler_emit_dcl_tessellator_output_primitive(struct vkd3d_dxbc_compiler *compiler, - const struct vkd3d_shader_instruction *instruction) +static void vkd3d_dxbc_compiler_emit_tessellator_output_primitive(struct vkd3d_dxbc_compiler *compiler, + enum vkd3d_tessellator_output_primitive primitive) { - enum vkd3d_tessellator_output_primitive primitive = instruction->declaration.tessellator_output_primitive; SpvExecutionMode mode; + if (compiler->shader_type == VKD3D_SHADER_TYPE_HULL && vkd3d_dxbc_compiler_is_opengl_target(compiler)) + return; + switch (primitive) { case VKD3D_TESSELLATOR_OUTPUT_POINT: @@ -4902,12 +4907,14 @@ static void vkd3d_dxbc_compiler_emit_dcl_tessellator_output_primitive(struct vkd vkd3d_dxbc_compiler_emit_execution_mode(compiler, mode, NULL, 0); } -static void vkd3d_dxbc_compiler_emit_dcl_tessellator_partitioning(struct vkd3d_dxbc_compiler *compiler, - const struct vkd3d_shader_instruction *instruction) +static void vkd3d_dxbc_compiler_emit_tessellator_partitioning(struct vkd3d_dxbc_compiler *compiler, + enum vkd3d_tessellator_partitioning partitioning) { - enum vkd3d_tessellator_partitioning partitioning = instruction->declaration.tessellator_partitioning; SpvExecutionMode mode; + if (compiler->shader_type == VKD3D_SHADER_TYPE_HULL && vkd3d_dxbc_compiler_is_opengl_target(compiler)) + return; + switch (partitioning) { case VKD3D_TESSELLATOR_PARTITIONING_INTEGER: @@ -7426,10 +7433,12 @@ int vkd3d_dxbc_compiler_handle_instruction(struct vkd3d_dxbc_compiler *compiler, vkd3d_dxbc_compiler_emit_dcl_tessellator_domain(compiler, instruction); break; case VKD3DSIH_DCL_TESSELLATOR_OUTPUT_PRIMITIVE: - vkd3d_dxbc_compiler_emit_dcl_tessellator_output_primitive(compiler, instruction); + vkd3d_dxbc_compiler_emit_tessellator_output_primitive(compiler, + instruction->declaration.tessellator_output_primitive); break; case VKD3DSIH_DCL_TESSELLATOR_PARTITIONING: - vkd3d_dxbc_compiler_emit_dcl_tessellator_partitioning(compiler, instruction); + vkd3d_dxbc_compiler_emit_tessellator_partitioning(compiler, + instruction->declaration.tessellator_partitioning); break; case VKD3DSIH_DCL_THREAD_GROUP: vkd3d_dxbc_compiler_emit_dcl_thread_group(compiler, instruction); @@ -7775,6 +7784,8 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ int vkd3d_dxbc_compiler_generate_spirv(struct vkd3d_dxbc_compiler *compiler, struct vkd3d_shader_code *spirv) { + const struct vkd3d_shader_compile_arguments *compile_args = compiler->compile_args; + const struct vkd3d_shader_domain_shader_compile_arguments *ds_args; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; vkd3d_spirv_build_op_function_end(builder); @@ -7782,6 +7793,20 @@ int vkd3d_dxbc_compiler_generate_spirv(struct vkd3d_dxbc_compiler *compiler, if (compiler->shader_type == VKD3D_SHADER_TYPE_HULL) vkd3d_dxbc_compiler_emit_hull_shader_main(compiler); + if (compiler->shader_type == VKD3D_SHADER_TYPE_DOMAIN) + { + if (compile_args && (ds_args = vkd3d_find_struct(compile_args->next, DOMAIN_SHADER_COMPILE_ARGUMENTS))) + { + vkd3d_dxbc_compiler_emit_tessellator_output_primitive(compiler, ds_args->output_primitive); + vkd3d_dxbc_compiler_emit_tessellator_partitioning(compiler, ds_args->partitioning); + } + else if (vkd3d_dxbc_compiler_is_opengl_target(compiler)) + { + ERR("vkd3d_shader_domain_shader_compile_arguments are required for " + "OpenGL tessellation evaluation shader.\n"); + } + } + if (compiler->epilogue_function_id) vkd3d_dxbc_compiler_emit_shader_epilogue_function(compiler); diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index ba5875c..40d46b3 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -464,23 +464,6 @@ enum vkd3d_tessellator_domain VKD3D_TESSELLATOR_DOMAIN_QUAD = 3, }; -enum vkd3d_tessellator_output_primitive -{ - VKD3D_TESSELLATOR_OUTPUT_POINT = 1, - VKD3D_TESSELLATOR_OUTPUT_LINE = 2, - VKD3D_TESSELLATOR_OUTPUT_TRIANGLE_CW = 3, - VKD3D_TESSELLATOR_OUTPUT_TRIANGLE_CCW = 4, -}; - -enum vkd3d_tessellator_partitioning -{ - VKD3D_TESSELLATOR_PARTITIONING_INTEGER = 1, - VKD3D_TESSELLATOR_PARTITIONING_POW2 = 2, - VKD3D_TESSELLATOR_PARTITIONING_FRACTIONAL_ODD = 3, - VKD3D_TESSELLATOR_PARTITIONING_FRACTIONAL_EVEN = 4, -}; - - #define VKD3DSI_NONE 0x0 #define VKD3DSI_TEXLD_PROJECT 0x1 #define VKD3DSI_INDEXED_DYNAMIC 0x4
1
0
0
0
Józef Kucia : vkd3d: Avoid using VK_WHOLE_SIZE for uniform buffer descriptors.
by Alexandre Julliard
14 Feb '19
14 Feb '19
Module: vkd3d Branch: master Commit: 22330b541446b62f10ef7d03dff709318420757a URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=22330b541446b62f10ef7d0…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Thu Feb 14 12:22:32 2019 +0100 vkd3d: Avoid using VK_WHOLE_SIZE for uniform buffer descriptors. It is invalid to use VK_WHOLE_SIZE when a buffer is larger than maxUniformBufferRange. 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> --- libs/vkd3d/command.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c index 22a568f..4a9f7c4 100644 --- a/libs/vkd3d/command.c +++ b/libs/vkd3d/command.c @@ -3404,7 +3404,8 @@ static void d3d12_command_list_set_root_cbv(struct d3d12_command_list *list, resource = vkd3d_gpu_va_allocator_dereference(&list->device->gpu_va_allocator, gpu_address); buffer_info.buffer = resource->u.vk_buffer; buffer_info.offset = gpu_address - resource->gpu_address; - buffer_info.range = VK_WHOLE_SIZE; + buffer_info.range = resource->desc.Width - buffer_info.offset; + buffer_info.range = min(buffer_info.range, vk_info->device_limits.maxUniformBufferRange); if (vk_info->KHR_push_descriptor) {
1
0
0
0
← Newer
1
...
36
37
38
39
40
41
42
...
68
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
Results per page:
10
25
50
100
200