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
January 2015
----- 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
302 discussions
Start a n
N
ew thread
Bruno Jesus : ws2_32: getaddrinfo must SetLastError on success or failure.
by Alexandre Julliard
20 Jan '15
20 Jan '15
Module: wine Branch: master Commit: 038399fcdd2f5601cdc59113d810409e08374b73 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=038399fcdd2f5601cdc59113d…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Mon Jan 19 21:23:36 2015 -0200 ws2_32: getaddrinfo must SetLastError on success or failure. --- dlls/ws2_32/socket.c | 7 ++++++- dlls/ws2_32/tests/sock.c | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 0bc9d16..faf2ec1 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -5628,7 +5628,11 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr const char *node; *res = NULL; - if (!nodename && !servname) return WSAHOST_NOT_FOUND; + if (!nodename && !servname) + { + SetLastError(WSAHOST_NOT_FOUND); + return WSAHOST_NOT_FOUND; + } if (!nodename) node = NULL; @@ -5749,6 +5753,7 @@ int WINAPI WS_getaddrinfo(LPCSTR nodename, LPCSTR servname, const struct WS_addr } else result = convert_eai_u2w(result); + SetLastError(result); return result; outofmem: diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 78ae609..7288b5c 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -5880,14 +5880,18 @@ static void test_GetAddrInfoW(void) memset(&hint, 0, sizeof(ADDRINFOW)); result = (ADDRINFOW *)0xdeadbeef; + WSASetLastError(0xdeadbeef); ret = pGetAddrInfoW(NULL, NULL, NULL, &result); ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); + ok(WSAGetLastError() == WSAHOST_NOT_FOUND, "expected 11001, got %d\n", WSAGetLastError()); ok(result == NULL, "got %p\n", result); result = NULL; + WSASetLastError(0xdeadbeef); ret = pGetAddrInfoW(empty, NULL, NULL, &result); ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); ok(result != NULL, "GetAddrInfoW failed\n"); + ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); pFreeAddrInfoW(result); result = NULL; @@ -5906,6 +5910,7 @@ static void test_GetAddrInfoW(void) result = NULL; ret = pGetAddrInfoW(empty, zero, NULL, &result); ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); + ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); ok(result != NULL, "GetAddrInfoW failed\n"); result2 = NULL; @@ -5942,11 +5947,14 @@ static void test_GetAddrInfoW(void) pFreeAddrInfoW(result); result = NULL; + SetLastError(0xdeadbeef); ret = pGetAddrInfoW(localhost, port, &hint, &result); ok(!ret, "GetAddrInfoW failed with %d\n", WSAGetLastError()); + ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); pFreeAddrInfoW(result); result = (ADDRINFOW *)0xdeadbeef; + WSASetLastError(0xdeadbeef); ret = pGetAddrInfoW(NULL, NULL, NULL, &result); if(ret == 0) { @@ -5954,9 +5962,11 @@ static void test_GetAddrInfoW(void) return; } ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); + ok(WSAGetLastError() == WSAHOST_NOT_FOUND, "expected 11001, got %d\n", WSAGetLastError()); ok(result == NULL, "got %p\n", result); result = (ADDRINFOW *)0xdeadbeef; + WSASetLastError(0xdeadbeef); ret = pGetAddrInfoW(nxdomain, NULL, NULL, &result); if(ret == 0) { @@ -5964,6 +5974,7 @@ static void test_GetAddrInfoW(void) return; } ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); + ok(WSAGetLastError() == WSAHOST_NOT_FOUND, "expected 11001, got %d\n", WSAGetLastError()); ok(result == NULL, "got %p\n", result); for (i = 0;i < (sizeof(hinttests) / sizeof(hinttests[0]));i++) @@ -6031,14 +6042,18 @@ static void test_getaddrinfo(void) memset(&hint, 0, sizeof(ADDRINFOA)); result = (ADDRINFOA *)0xdeadbeef; + WSASetLastError(0xdeadbeef); ret = pgetaddrinfo(NULL, NULL, NULL, &result); ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); + ok(WSAGetLastError() == WSAHOST_NOT_FOUND, "expected 11001, got %d\n", WSAGetLastError()); ok(result == NULL, "got %p\n", result); result = NULL; + WSASetLastError(0xdeadbeef); ret = pgetaddrinfo("", NULL, NULL, &result); ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); ok(result != NULL, "getaddrinfo failed\n"); + ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); pfreeaddrinfo(result); result = NULL; @@ -6055,8 +6070,10 @@ static void test_getaddrinfo(void) pfreeaddrinfo(result2); result = NULL; + WSASetLastError(0xdeadbeef); ret = pgetaddrinfo("", "0", NULL, &result); ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); + ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); ok(result != NULL, "getaddrinfo failed\n"); result2 = NULL; @@ -6093,11 +6110,14 @@ static void test_getaddrinfo(void) pfreeaddrinfo(result); result = NULL; + WSASetLastError(0xdeadbeef); ret = pgetaddrinfo("localhost", "80", &hint, &result); ok(!ret, "getaddrinfo failed with %d\n", WSAGetLastError()); + ok(WSAGetLastError() == 0, "expected 0, got %d\n", WSAGetLastError()); pfreeaddrinfo(result); result = (ADDRINFOA *)0xdeadbeef; + WSASetLastError(0xdeadbeef); ret = pgetaddrinfo("
nxdomain.codeweavers.com
", NULL, NULL, &result); if(ret == 0) { @@ -6105,6 +6125,7 @@ static void test_getaddrinfo(void) return; } ok(ret == WSAHOST_NOT_FOUND, "got %d expected WSAHOST_NOT_FOUND\n", ret); + ok(WSAGetLastError() == WSAHOST_NOT_FOUND, "expected 11001, got %d\n", WSAGetLastError()); ok(result == NULL, "got %p\n", result); for (i = 0;i < (sizeof(hinttests) / sizeof(hinttests[0]));i++)
1
0
0
0
Michael Stefaniuc : oleaut32: Just stop instead of erroring out on 8 or 9 in octal numbers.
by Alexandre Julliard
20 Jan '15
20 Jan '15
Module: wine Branch: master Commit: 512a814efc3c6f84086ea4eb6b405f374f6753d9 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=512a814efc3c6f84086ea4eb6…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 20 00:21:50 2015 +0100 oleaut32: Just stop instead of erroring out on 8 or 9 in octal numbers. --- dlls/oleaut32/tests/vartest.c | 2 -- dlls/oleaut32/variant.c | 5 ++--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index 118aa75..7ed4fd4 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1383,11 +1383,9 @@ static void test_VarParseNumFromStr(void) /* VB oct char bigger than 7 */ CONVERT("&o128", NUMPRS_HEX_OCT); - todo_wine { EXPECT(2,NUMPRS_HEX_OCT,0x40,4,3,0); EXPECTRGB(0,1); EXPECTRGB(1,2); - } EXPECTRGB(3,FAILDIG); /** NUMPRS_PARENS **/ diff --git a/dlls/oleaut32/variant.c b/dlls/oleaut32/variant.c index 5a28acc..feba6c5 100644 --- a/dlls/oleaut32/variant.c +++ b/dlls/oleaut32/variant.c @@ -1736,9 +1736,8 @@ HRESULT WINAPI VarParseNumFromStr(OLECHAR *lpszStr, LCID lcid, ULONG dwFlags, } else { - if ((dwState & B_PROCESSING_OCT) && ((*lpszStr == '8') || (*lpszStr == '9'))) { - return DISP_E_TYPEMISMATCH; - } + if ((dwState & B_PROCESSING_OCT) && ((*lpszStr == '8') || (*lpszStr == '9'))) + break; if (pNumprs->dwOutFlags & NUMPRS_DECIMAL) pNumprs->nPwr10--; /* Count decimal points in nPwr10 */
1
0
0
0
Michael Stefaniuc : oleaut32/tests: Uncomment and fix a test (PVS-Studio).
by Alexandre Julliard
20 Jan '15
20 Jan '15
Module: wine Branch: master Commit: 9bfd58a5c97d471d6453c64bb492974313280d5d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=9bfd58a5c97d471d6453c64bb…
Author: Michael Stefaniuc <mstefani(a)redhat.de> Date: Tue Jan 20 00:15:56 2015 +0100 oleaut32/tests: Uncomment and fix a test (PVS-Studio). --- dlls/oleaut32/tests/vartest.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/dlls/oleaut32/tests/vartest.c b/dlls/oleaut32/tests/vartest.c index d15adcb..118aa75 100644 --- a/dlls/oleaut32/tests/vartest.c +++ b/dlls/oleaut32/tests/vartest.c @@ -1383,11 +1383,13 @@ static void test_VarParseNumFromStr(void) /* VB oct char bigger than 7 */ CONVERT("&o128", NUMPRS_HEX_OCT); -/* - Native versions 2.x of oleaut32 allow this to succeed: later versions and Wine don't - EXPECTFAIL; - EXPECTRGB(0,FAILDIG); -*/ + todo_wine { + EXPECT(2,NUMPRS_HEX_OCT,0x40,4,3,0); + EXPECTRGB(0,1); + EXPECTRGB(1,2); + } + EXPECTRGB(3,FAILDIG); + /** NUMPRS_PARENS **/ /* Empty parens = error */
1
0
0
0
Ken Thomases : winemac: Fix conversion of empty RECT to an empty CGRect.
by Alexandre Julliard
20 Jan '15
20 Jan '15
Module: wine Branch: master Commit: 50cd5b6a578a1427a501ef082017aebb66f132e1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=50cd5b6a578a1427a501ef082…
Author: Ken Thomases <ken(a)codeweavers.com> Date: Mon Jan 19 13:11:15 2015 -0600 winemac: Fix conversion of empty RECT to an empty CGRect. For some empty RECTs, such as { INT_MAX, INT_MAX, INT_MIN, INT_MIN }, right minus left or bottom minus top underflow and wrap around to positive values. --- dlls/winemac.drv/macdrv.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/dlls/winemac.drv/macdrv.h b/dlls/winemac.drv/macdrv.h index 56ca24f..cf0fc64 100644 --- a/dlls/winemac.drv/macdrv.h +++ b/dlls/winemac.drv/macdrv.h @@ -47,7 +47,9 @@ extern const char* debugstr_cf(CFTypeRef t) DECLSPEC_HIDDEN; static inline CGRect cgrect_from_rect(RECT rect) { - return CGRectMake(rect.left, rect.top, max(0, rect.right - rect.left), max(0, rect.bottom - rect.top)); + if (rect.left >= rect.right || rect.top >= rect.bottom) + return CGRectMake(rect.left, rect.top, 0, 0); + return CGRectMake(rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); } static inline RECT rect_from_cgrect(CGRect cgrect)
1
0
0
0
Changhui Liu : gdiplus: Fix get_graphics_bounds when window origin point changed.
by Alexandre Julliard
19 Jan '15
19 Jan '15
Module: wine Branch: master Commit: 5fa7402a36ee0e1238434598ff589e3de42f80cd URL:
http://source.winehq.org/git/wine.git/?a=commit;h=5fa7402a36ee0e1238434598f…
Author: Changhui Liu <liuchanghui(a)linuxdeepin.com> Date: Mon Dec 22 16:43:47 2014 +0800 gdiplus: Fix get_graphics_bounds when window origin point changed. --- dlls/gdiplus/graphics.c | 3 +-- dlls/gdiplus/tests/graphics.c | 56 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/dlls/gdiplus/graphics.c b/dlls/gdiplus/graphics.c index 840d866..68a4ee5 100644 --- a/dlls/gdiplus/graphics.c +++ b/dlls/gdiplus/graphics.c @@ -2029,8 +2029,7 @@ static GpStatus get_graphics_bounds(GpGraphics* graphics, GpRectF* rect) rect->Height = GetDeviceCaps(graphics->hdc, VERTRES); } - if (graphics->hdc && - (GetMapMode(graphics->hdc) != MM_TEXT || GetGraphicsMode(graphics->hdc) != GM_COMPATIBLE)) + if (graphics->hdc) { POINT points[2]; diff --git a/dlls/gdiplus/tests/graphics.c b/dlls/gdiplus/tests/graphics.c index 8ce372b..fd4cf80 100644 --- a/dlls/gdiplus/tests/graphics.c +++ b/dlls/gdiplus/tests/graphics.c @@ -5548,6 +5548,61 @@ static void test_GdipFillRectangles(void) ReleaseDC(hwnd, hdc); } +static void test_GdipGetVisibleClipBounds_memoryDC(void) +{ + HDC hdc,dc; + HBITMAP bmp; + HGDIOBJ old; + RECT rect; + POINT pt; + int width = 0; + int height = 0; + GpGraphics* graphics = NULL; + GpRect boundRect; + GpStatus status; + + ok(GetClientRect(hwnd, &rect), "GetClientRect should have succeeded\n"); + width = rect.right - rect.left; + height = rect.bottom - rect.top; + + dc = GetDC(hwnd); + hdc = CreateCompatibleDC ( dc ); + bmp = CreateCompatibleBitmap ( dc, width, height ); + old = SelectObject (hdc, bmp); + + /*change the window origin is the key test point*/ + SetWindowOrgEx (hdc, rect.left+10, rect.top+10, &pt); + + status = GdipCreateFromHDC(hdc, &graphics); + expect(Ok, status); + + status = GdipGetVisibleClipBoundsI(graphics, &boundRect); + expect(Ok, status); + + ok(boundRect.X==rect.left+10 && + boundRect.Y==rect.top+10 && + boundRect.Width==width && + boundRect.Height==height, "Expected GdipGetVisibleClipBoundsI ok\n"); + + status = GdipSetClipRectI(graphics, 0, 0, width, height, CombineModeReplace); + expect(Ok, status); + + status = GdipGetVisibleClipBoundsI(graphics, &boundRect); + expect(Ok, status); + + ok(boundRect.X==rect.left+10 && + boundRect.Y==rect.top+10 && + boundRect.Width==width-10 && + boundRect.Height==height-10, "Expected GdipGetVisibleClipBoundsI ok\n"); + + GdipDeleteGraphics(graphics); + + SelectObject (hdc, old); + DeleteObject (bmp); + DeleteDC (hdc); + ReleaseDC(hwnd, dc); +} + START_TEST(graphics) { struct GdiplusStartupInput gdiplusStartupInput; @@ -5619,6 +5674,7 @@ START_TEST(graphics) test_alpha_hdc(); test_bitmapfromgraphics(); test_GdipFillRectangles(); + test_GdipGetVisibleClipBounds_memoryDC(); GdiplusShutdown(gdiplusToken); DestroyWindow( hwnd );
1
0
0
0
Bruno Jesus : user32: Allocate memory based on HICON instead of DWORD to fix 64 bit problems.
by Alexandre Julliard
19 Jan '15
19 Jan '15
Module: wine Branch: master Commit: da8bb1c4a5565b332159c8b9ee3d3b4378b80e57 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da8bb1c4a5565b332159c8b9e…
Author: Bruno Jesus <00cpxxx(a)gmail.com> Date: Sat Jan 17 20:51:07 2015 -0200 user32: Allocate memory based on HICON instead of DWORD to fix 64 bit problems. --- dlls/user32/cursoricon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/user32/cursoricon.c b/dlls/user32/cursoricon.c index 3c31894..8504bdc 100644 --- a/dlls/user32/cursoricon.c +++ b/dlls/user32/cursoricon.c @@ -1165,7 +1165,7 @@ static HCURSOR CURSORICON_CreateIconFromANI( const BYTE *bits, DWORD bits_size, cursor = alloc_icon_handle( TRUE, header.num_steps ); if (!cursor) return 0; - frames = HeapAlloc( GetProcessHeap(), 0, sizeof(DWORD)*header.num_frames ); + frames = HeapAlloc( GetProcessHeap(), 0, sizeof(*frames) * header.num_frames ); if (!frames) { free_icon_handle( cursor );
1
0
0
0
Henri Verbeet : wined3d: Properly cleanup samplers on wined3d_device_reset () / wined3d_device_uninit_3d().
by Alexandre Julliard
19 Jan '15
19 Jan '15
Module: wine Branch: master Commit: 525696fe6c4c54888255783cd1be4439ae700fc8 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=525696fe6c4c54888255783cd…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Jan 19 13:44:12 2015 +0100 wined3d: Properly cleanup samplers on wined3d_device_reset() / wined3d_device_uninit_3d(). --- dlls/wined3d/device.c | 9 ++++----- include/wine/rbtree.h | 8 ++++++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 29ce04f..f640c9e 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1032,9 +1032,8 @@ err_out: static void device_free_sampler(struct wine_rb_entry *entry, void *context) { struct wined3d_sampler *sampler = WINE_RB_ENTRY_VALUE(entry, struct wined3d_sampler, entry); - struct wined3d_device *device = context; - wine_rb_remove(&device->samplers, &sampler->desc); + wined3d_sampler_decref(sampler); } HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) @@ -1071,7 +1070,7 @@ HRESULT CDECL wined3d_device_uninit_3d(struct wined3d_device *device) resource->resource_ops->resource_unload(resource); } - wine_rb_for_each_entry(&device->samplers, device_free_sampler, device); + wine_rb_clear(&device->samplers, device_free_sampler, NULL); /* Destroy the depth blt resources, they will be invalid after the reset. Also free shader * private data, it might contain opengl pointers @@ -4632,6 +4631,8 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, device->exStyle = exStyle; } + wine_rb_clear(&device->samplers, device_free_sampler, NULL); + if (reset_state) { TRACE("Resetting stateblock.\n"); @@ -4677,8 +4678,6 @@ HRESULT CDECL wined3d_device_reset(struct wined3d_device *device, swapchain_update_render_to_fbo(swapchain); swapchain_update_draw_bindings(swapchain); - wine_rb_for_each_entry(&device->samplers, device_free_sampler, device); - if (reset_state && device->d3d_initialized) hr = create_primary_opengl_context(device, swapchain); diff --git a/include/wine/rbtree.h b/include/wine/rbtree.h index 2276e30..13452d9 100644 --- a/include/wine/rbtree.h +++ b/include/wine/rbtree.h @@ -220,12 +220,16 @@ static inline void wine_rb_for_each_entry(struct wine_rb_tree *tree, wine_rb_tra wine_rb_postorder(tree, callback, context); } -static inline void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) +static inline void wine_rb_clear(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) { /* Note that we use postorder here because the callback will likely free the entry. */ if (callback) wine_rb_postorder(tree, callback, context); - tree->root = NULL; +} + +static inline void wine_rb_destroy(struct wine_rb_tree *tree, wine_rb_traverse_func_t *callback, void *context) +{ + wine_rb_clear(tree, callback, context); tree->functions->free(tree->stack.entries); }
1
0
0
0
Henri Verbeet : wined3d: Use the same flags for wined3d_texture_set_color_key() and the " color_key_flags" field it sets.
by Alexandre Julliard
19 Jan '15
19 Jan '15
Module: wine Branch: master Commit: ca06f960edc0e1216eaa655c9a2eaf061af11afe URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ca06f960edc0e1216eaa655c9…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Jan 19 13:44:11 2015 +0100 wined3d: Use the same flags for wined3d_texture_set_color_key() and the "color_key_flags" field it sets. This fixes a regression introduced by commit a8ab56941577a01e17b947cddd374ba52ffd8245. --- dlls/wined3d/device.c | 2 +- dlls/wined3d/state.c | 4 ++-- dlls/wined3d/surface.c | 14 +++++++------- dlls/wined3d/texture.c | 42 +++++++++++++++++++++--------------------- dlls/wined3d/utils.c | 4 ++-- include/wine/wined3d.h | 35 ++++++----------------------------- 6 files changed, 39 insertions(+), 62 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=ca06f960edc0e1216eaa6…
1
0
0
0
Henri Verbeet : d3d10core/tests: Add a basic texturing test.
by Alexandre Julliard
19 Jan '15
19 Jan '15
Module: wine Branch: master Commit: 6b4623008f885e25e77b1b367e0949b1b5b13ca1 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=6b4623008f885e25e77b1b367…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Jan 19 13:44:10 2015 +0100 d3d10core/tests: Add a basic texturing test. --- dlls/d3d10core/tests/device.c | 215 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 215 insertions(+) diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c index 76830a4..8b51cda 100644 --- a/dlls/d3d10core/tests/device.c +++ b/dlls/d3d10core/tests/device.c @@ -2305,6 +2305,220 @@ done: DestroyWindow(window); } +static void test_texture(void) +{ + ID3D10RenderTargetView *backbuffer_rtv; + D3D10_SUBRESOURCE_DATA resource_data; + D3D10_TEXTURE2D_DESC texture_desc; + ID3D10SamplerState *sampler_state; + ID3D10ShaderResourceView *ps_srv; + D3D10_SAMPLER_DESC sampler_desc; + ID3D10InputLayout *input_layout; + D3D10_BUFFER_DESC buffer_desc; + ID3D10Texture2D *backbuffer; + unsigned int stride, offset; + IDXGISwapChain *swapchain; + ID3D10Texture2D *texture; + ID3D10VertexShader *vs; + ID3D10PixelShader *ps; + ID3D10Device *device; + D3D10_VIEWPORT vp; + unsigned int i, j; + ID3D10Buffer *vb; + ULONG refcount; + DWORD color; + HWND window; + HRESULT hr; + + static const D3D10_INPUT_ELEMENT_DESC layout_desc[] = + { + {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D10_INPUT_PER_VERTEX_DATA, 0}, + }; + static const DWORD vs_code[] = + { +#if 0 + float4 main(float4 position : POSITION) : SV_POSITION + { + return position; + } +#endif + 0x43425844, 0xa7a2f22d, 0x83ff2560, 0xe61638bd, 0x87e3ce90, 0x00000001, 0x000000d8, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x49534f50, 0x4e4f4954, 0xababab00, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x52444853, 0x0000003c, 0x00010040, + 0x0000000f, 0x0300005f, 0x001010f2, 0x00000000, 0x04000067, 0x001020f2, 0x00000000, 0x00000001, + 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x0100003e, + }; + static const DWORD ps_code[] = + { +#if 0 + Texture2D t; + SamplerState s; + + float4 main(float4 position : SV_POSITION) : SV_Target + { + float2 p; + + p.x = position.x / 640.0f; + p.y = position.y / 480.0f; + return t.Sample(s, p); + } +#endif + 0x43425844, 0x1ce9b612, 0xc8176faa, 0xd37844af, 0xdb515605, 0x00000001, 0x00000134, 0x00000003, + 0x0000002c, 0x00000060, 0x00000094, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, + 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000030f, 0x505f5653, 0x5449534f, 0x004e4f49, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, + 0x00000000, 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x52444853, 0x00000098, 0x00000040, + 0x00000026, 0x0300005a, 0x00106000, 0x00000000, 0x04001858, 0x00107000, 0x00000000, 0x00005555, + 0x04002064, 0x00101032, 0x00000000, 0x00000001, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, + 0x00000001, 0x0a000038, 0x00100032, 0x00000000, 0x00101046, 0x00000000, 0x00004002, 0x3acccccd, + 0x3b088889, 0x00000000, 0x00000000, 0x09000045, 0x001020f2, 0x00000000, 0x00100046, 0x00000000, + 0x00107e46, 0x00000000, 0x00106000, 0x00000000, 0x0100003e, + }; + static const struct + { + float x, y; + } + quad[] = + { + {-1.0f, -1.0f}, + {-1.0f, 1.0f}, + { 1.0f, -1.0f}, + { 1.0f, 1.0f}, + }; + static const float red[] = {1.0f, 0.0f, 0.0f, 0.5f}; + static const DWORD bitmap_data[] = + { + 0xff0000ff, 0xff00ffff, 0xff00ff00, 0xffffff00, + 0xffff0000, 0xffff00ff, 0xff000000, 0xff7f7f7f, + 0xffffffff, 0xffffffff, 0xffffffff, 0xff000000, + 0xffffffff, 0xff000000, 0xff000000, 0xff000000, + }; + + if (!(device = create_device())) + { + skip("Failed to create device, skipping tests.\n"); + return; + } + window = CreateWindowA("static", "d3d10core_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + swapchain = create_swapchain(device, window, TRUE); + hr = IDXGISwapChain_GetBuffer(swapchain, 0, &IID_ID3D10Texture2D, (void **)&backbuffer); + ok(SUCCEEDED(hr), "Failed to get buffer, hr %#x.\n", hr); + + hr = ID3D10Device_CreateInputLayout(device, layout_desc, sizeof(layout_desc) / sizeof(*layout_desc), + vs_code, sizeof(vs_code), &input_layout); + ok(SUCCEEDED(hr), "Failed to create input layout, hr %#x.\n", hr); + + buffer_desc.ByteWidth = sizeof(quad); + buffer_desc.Usage = D3D10_USAGE_DEFAULT; + buffer_desc.BindFlags = D3D10_BIND_VERTEX_BUFFER; + buffer_desc.CPUAccessFlags = 0; + buffer_desc.MiscFlags = 0; + + resource_data.pSysMem = quad; + resource_data.SysMemPitch = 0; + resource_data.SysMemSlicePitch = 0; + + hr = ID3D10Device_CreateBuffer(device, &buffer_desc, &resource_data, &vb); + ok(SUCCEEDED(hr), "Failed to create vertex buffer, hr %#x.\n", hr); + + texture_desc.Width = 4; + texture_desc.Height = 4; + texture_desc.MipLevels = 1; + texture_desc.ArraySize = 1; + texture_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + texture_desc.SampleDesc.Count = 1; + texture_desc.SampleDesc.Quality = 0; + texture_desc.Usage = D3D10_USAGE_DEFAULT; + texture_desc.BindFlags = D3D10_BIND_SHADER_RESOURCE; + texture_desc.CPUAccessFlags = 0; + texture_desc.MiscFlags = 0; + + resource_data.pSysMem = bitmap_data; + resource_data.SysMemPitch = 4 * sizeof(*bitmap_data); + + hr = ID3D10Device_CreateTexture2D(device, &texture_desc, &resource_data, &texture); + ok(SUCCEEDED(hr), "Failed to create a 2d texture, hr %#x\n", hr); + + hr = ID3D10Device_CreateShaderResourceView(device, (ID3D10Resource *)texture, NULL, &ps_srv); + ok(SUCCEEDED(hr), "Failed to create shader resource view, hr %#x\n", hr); + + sampler_desc.Filter = D3D10_FILTER_MIN_MAG_MIP_POINT; + sampler_desc.AddressU = D3D10_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressV = D3D10_TEXTURE_ADDRESS_CLAMP; + sampler_desc.AddressW = D3D10_TEXTURE_ADDRESS_CLAMP; + sampler_desc.MipLODBias = 0.0f; + sampler_desc.MaxAnisotropy = 0; + sampler_desc.ComparisonFunc = D3D10_COMPARISON_NEVER; + sampler_desc.BorderColor[0] = 0.0f; + sampler_desc.BorderColor[1] = 0.0f; + sampler_desc.BorderColor[2] = 0.0f; + sampler_desc.BorderColor[3] = 0.0f; + sampler_desc.MinLOD = 0.0f; + sampler_desc.MaxLOD = 0.0f; + + hr = ID3D10Device_CreateSamplerState(device, &sampler_desc, &sampler_state); + ok(SUCCEEDED(hr), "Failed to create sampler state, hr %#x.\n", hr); + + hr = ID3D10Device_CreateVertexShader(device, vs_code, sizeof(vs_code), &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); + + hr = ID3D10Device_CreateRenderTargetView(device, (ID3D10Resource *)backbuffer, NULL, &backbuffer_rtv); + ok(SUCCEEDED(hr), "Failed to create rendertarget view, hr %#x.\n", hr); + + ID3D10Device_OMSetRenderTargets(device, 1, &backbuffer_rtv, NULL); + ID3D10Device_IASetInputLayout(device, input_layout); + ID3D10Device_IASetPrimitiveTopology(device, D3D10_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); + stride = sizeof(*quad); + offset = 0; + ID3D10Device_IASetVertexBuffers(device, 0, 1, &vb, &stride, &offset); + ID3D10Device_VSSetShader(device, vs); + ID3D10Device_PSSetShaderResources(device, 0, 1, &ps_srv); + ID3D10Device_PSSetSamplers(device, 0, 1, &sampler_state); + ID3D10Device_PSSetShader(device, ps); + + vp.TopLeftX = 0; + vp.TopLeftY = 0; + vp.Width = 640; + vp.Height = 480; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + ID3D10Device_RSSetViewports(device, 1, &vp); + + ID3D10Device_ClearRenderTargetView(device, backbuffer_rtv, red); + + ID3D10Device_Draw(device, 4, 0); + + for (i = 0; i < 4; ++i) + { + for (j = 0; j < 4; ++j) + { + color = get_texture_color(backbuffer, 80 + j * 160, 60 + i * 120); + ok(compare_color(color, bitmap_data[j + i * 4], 1), + "Got unexpected color 0x%08x at (%u, %u), expected 0x%08x.\n", + color, j, i, bitmap_data[j + i * 4]); + } + } + + ID3D10PixelShader_Release(ps); + ID3D10VertexShader_Release(vs); + ID3D10SamplerState_Release(sampler_state); + ID3D10ShaderResourceView_Release(ps_srv); + ID3D10Texture2D_Release(texture); + ID3D10Buffer_Release(vb); + ID3D10InputLayout_Release(input_layout); + ID3D10RenderTargetView_Release(backbuffer_rtv); + ID3D10Texture2D_Release(backbuffer); + IDXGISwapChain_Release(swapchain); + refcount = ID3D10Device_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + DestroyWindow(window); +} + START_TEST(device) { test_create_texture2d(); @@ -2322,4 +2536,5 @@ START_TEST(device) test_scissor(); test_clear_state(); test_blend(); + test_texture(); }
1
0
0
0
Henri Verbeet : wined3d: Handle the SM4 SV_POSITION pixel shader input semantic in the GLSL shader backend.
by Alexandre Julliard
19 Jan '15
19 Jan '15
Module: wine Branch: master Commit: 2912e2938e475a125db5aa33598607696b3e61ef URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2912e2938e475a125db5aa335…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Jan 19 13:44:09 2015 +0100 wined3d: Handle the SM4 SV_POSITION pixel shader input semantic in the GLSL shader backend. This is (mostly) equivalent to the vPos register in SM3. --- dlls/wined3d/glsl_shader.c | 29 ++++++++++++++++------------- dlls/wined3d/shader.c | 3 +++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index efae51e..8f5e916 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -1191,14 +1191,8 @@ static void shader_generate_glsl_declarations(const struct wined3d_context *cont UINT in_count = min(vec4_varyings(version->major, gl_info), shader->limits->packed_input); if (use_vs(state)) - shader_addline(buffer, "varying vec4 %s_in[%u];\n", prefix, in_count); - else - /* TODO: Write a replacement shader for the fixed function - * vertex pipeline, so this isn't needed. For fixed function - * vertex processing + 3.0 pixel shader we need a separate - * function in the pixel shader that reads the fixed function - * color into the packed input registers. */ - shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); + shader_addline(buffer, "varying vec4 %s_link[%u];\n", prefix, in_count); + shader_addline(buffer, "vec4 %s_in[%u];\n", prefix, in_count); } for (i = 0, map = reg_maps->bumpmat; map; map >>= 1, ++i) @@ -4154,7 +4148,16 @@ static void shader_glsl_input_pack(const struct wined3d_shader *shader, struct w semantic_idx = input_signature[i].semantic_idx; shader_glsl_write_mask_to_str(input_signature[i].mask, reg_mask); - if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_TEXCOORD)) + if (vertexprocessing == vertexshader) + { + if (!strcmp(semantic_name, "SV_POSITION")) + shader_addline(buffer, "ps_in[%u]%s = vpos%s;\n", + shader->u.ps.input_reg_map[i], reg_mask, reg_mask); + else + shader_addline(buffer, "ps_in[%u]%s = ps_link[%u]%s;\n", + shader->u.ps.input_reg_map[i], reg_mask, shader->u.ps.input_reg_map[i], reg_mask); + } + else if (shader_match_semantic(semantic_name, WINED3D_DECL_USAGE_TEXCOORD)) { if (semantic_idx < 8 && vertexprocessing == pretransformed) shader_addline(buffer, "ps_in[%u]%s = gl_TexCoord[%u]%s;\n", @@ -4276,7 +4279,7 @@ static void handle_ps3_input(struct wined3d_shader_buffer *buffer, else if (in_idx == in_count + 1) sprintf(destination, "gl_FrontSecondaryColor"); else - sprintf(destination, "ps_in[%u]", in_idx); + sprintf(destination, "ps_link[%u]", in_idx); semantic_name_in = input_signature[i].semantic_name; semantic_idx_in = input_signature[i].semantic_idx; @@ -4322,7 +4325,7 @@ static void handle_ps3_input(struct wined3d_shader_buffer *buffer, else if (i == in_count + 1) sprintf(destination, "gl_FrontSecondaryColor"); else - sprintf(destination, "ps_in[%u]", i); + sprintf(destination, "ps_link[%u]", i); if (size == 1) shader_addline(buffer, "%s.%s = 0.0;\n", destination, reg_mask); else shader_addline(buffer, "%s.%s = vec%u(0.0);\n", destination, reg_mask, size); @@ -4406,7 +4409,7 @@ static GLhandleARB generate_param_reorder_function(struct wined3d_shader_buffer { UINT in_count = min(vec4_varyings(ps_major, gl_info), ps->limits->packed_input); /* This one is tricky: a 3.0 pixel shader reads from a 3.0 vertex shader */ - shader_addline(buffer, "varying vec4 ps_in[%u];\n", in_count); + shader_addline(buffer, "varying vec4 ps_link[%u];\n", in_count); shader_addline(buffer, "void order_ps_input(in vec4 vs_out[%u])\n{\n", vs->limits->packed_output); /* First, sort out position and point size. Those are not passed to the pixel shader */ @@ -4517,7 +4520,7 @@ static GLuint shader_glsl_generate_pshader(const struct wined3d_context *context shader_generate_glsl_declarations(context, buffer, shader, reg_maps, &priv_ctx); /* Pack 3.0 inputs */ - if (reg_maps->shader_version.major >= 3 && args->vp_mode != vertexshader) + if (reg_maps->shader_version.major >= 3) shader_glsl_input_pack(shader, buffer, shader->input_signature, reg_maps, args->vp_mode); /* Base Shader Body */ diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 7218290..e1164db 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2506,6 +2506,9 @@ static HRESULT pixelshader_init(struct wined3d_shader *shader, struct wined3d_de memcpy(ptr, e->semantic_name, len + 1); shader->input_signature[e->register_idx].semantic_name = ptr; ptr += len + 1; + + if (!strcmp(e->semantic_name, "SV_POSITION")) + shader->reg_maps.vpos = 1; } }
1
0
0
0
← Newer
1
...
8
9
10
11
12
13
14
...
31
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
Results per page:
10
25
50
100
200