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 2011
----- 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
810 discussions
Start a n
N
ew thread
Hans Leidekker : ws2_32: Return the right value for SO_CONNECT_TIME if the socket is not connected.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: c42989ed9a101a59dc186863b7acd0f307649a4a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=c42989ed9a101a59dc186863b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 19 15:42:08 2011 +0100 ws2_32: Return the right value for SO_CONNECT_TIME if the socket is not connected. --- dlls/ws2_32/socket.c | 11 +++++++++-- dlls/ws2_32/tests/sock.c | 16 ++++++++++++++-- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index b3a79f3..0e9524e 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -2548,14 +2548,21 @@ INT WINAPI WS_getsockopt(SOCKET s, INT level, case WS_SO_CONNECT_TIME: { static int pretendtime = 0; + struct WS_sockaddr addr; + int len = sizeof(addr); - if (!pretendtime) FIXME("WS_SO_CONNECT_TIME - faking results\n"); if (!optlen || *optlen < sizeof(DWORD) || !optval) { SetLastError(WSAEFAULT); return SOCKET_ERROR; } - *(DWORD*)optval = pretendtime++; + if (WS_getpeername(s, &addr, &len) == SOCKET_ERROR) + *(DWORD *)optval = ~0u; + else + { + if (!pretendtime) FIXME("WS_SO_CONNECT_TIME - faking results\n"); + *(DWORD *)optval = pretendtime++; + } *optlen = sizeof(DWORD); return ret; } diff --git a/dlls/ws2_32/tests/sock.c b/dlls/ws2_32/tests/sock.c index 4e5bb52..2cb56a6 100644 --- a/dlls/ws2_32/tests/sock.c +++ b/dlls/ws2_32/tests/sock.c @@ -4496,14 +4496,14 @@ static void test_AcceptEx(void) SOCKET connector = INVALID_SOCKET; SOCKET connector2 = INVALID_SOCKET; struct sockaddr_in bindAddress, peerAddress, *readBindAddress, *readRemoteAddress; - int socklen; + int socklen, optlen; GUID acceptExGuid = WSAID_ACCEPTEX, getAcceptExGuid = WSAID_GETACCEPTEXSOCKADDRS; LPFN_ACCEPTEX pAcceptEx = NULL; LPFN_GETACCEPTEXSOCKADDRS pGetAcceptExSockaddrs = NULL; fd_set fds_accept, fds_send; struct timeval timeout = {0,10}; /* wait for 10 milliseconds */ int got, conn1, i; - DWORD bytesReturned; + DWORD bytesReturned, connect_time; char buffer[1024]; OVERLAPPED overlapped; int iret, localSize = sizeof(struct sockaddr_in), remoteSize = localSize; @@ -4695,9 +4695,21 @@ static void test_AcceptEx(void) &bytesReturned, &overlapped); ok(bret == FALSE && WSAGetLastError() == ERROR_IO_PENDING, "AcceptEx returned %d + errno %d\n", bret, WSAGetLastError()); + connect_time = 0xdeadbeef; + optlen = sizeof(connect_time); + iret = getsockopt(connector, SOL_SOCKET, SO_CONNECT_TIME, (char *)&connect_time, &optlen); + ok(!iret, "getsockopt failed %d\n", WSAGetLastError()); + ok(connect_time == ~0u, "unexpected connect time %u\n", connect_time); + iret = connect(connector, (struct sockaddr*)&bindAddress, sizeof(bindAddress)); ok(iret == 0, "connecting to accepting socket failed, error %d\n", WSAGetLastError()); + connect_time = 0xdeadbeef; + optlen = sizeof(connect_time); + iret = getsockopt(connector, SOL_SOCKET, SO_CONNECT_TIME, (char *)&connect_time, &optlen); + ok(!iret, "getsockopt failed %d\n", WSAGetLastError()); + ok(connect_time < 0xdeadbeef, "unexpected connect time %u\n", connect_time); + dwret = WaitForSingleObject(overlapped.hEvent, 0); ok(dwret == WAIT_TIMEOUT, "Waiting for accept event timeout failed with %d + errno %d\n", dwret, GetLastError());
1
0
0
0
Hans Leidekker : iphlpapi: Add a stub implementation of GetExtendedTcpTable .
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 895e7a5f5be6d0cbdab14039aa755f82ddefceb6 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=895e7a5f5be6d0cbdab14039a…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 19 15:41:48 2011 +0100 iphlpapi: Add a stub implementation of GetExtendedTcpTable. --- dlls/iphlpapi/iphlpapi.spec | 1 + dlls/iphlpapi/iphlpapi_main.c | 16 ++++++++++++++++ include/iphlpapi.h | 3 +++ include/iprtrmib.h | 13 +++++++++++++ 4 files changed, 33 insertions(+), 0 deletions(-) diff --git a/dlls/iphlpapi/iphlpapi.spec b/dlls/iphlpapi/iphlpapi.spec index 1c33625..cb00df4 100644 --- a/dlls/iphlpapi/iphlpapi.spec +++ b/dlls/iphlpapi/iphlpapi.spec @@ -26,6 +26,7 @@ @ stub GetBestInterfaceFromStack @ stdcall GetBestRoute( long long long ) @ stub GetBestRouteFromStack +@ stdcall GetExtendedTcpTable( ptr ptr long long long long ) @ stdcall GetFriendlyIfIndex( long ) @ stdcall GetIcmpStatistics( ptr ) @ stub GetIcmpStatsFromStack diff --git a/dlls/iphlpapi/iphlpapi_main.c b/dlls/iphlpapi/iphlpapi_main.c index be37bb0..d43f644 100644 --- a/dlls/iphlpapi/iphlpapi_main.c +++ b/dlls/iphlpapi/iphlpapi_main.c @@ -1877,6 +1877,22 @@ DWORD WINAPI GetTcpTable(PMIB_TCPTABLE pTcpTable, PDWORD pdwSize, BOOL bOrder) return ret; } +/****************************************************************** + * GetExtendedTcpTable (IPHLPAPI.@) + */ +DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder, + ULONG ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved) +{ + TRACE("pTcpTable %p, pdwSize %p, bOrder %d, ulAf %u, TableClass %u, Reserved %u\n", + pTcpTable, pdwSize, bOrder, ulAf, TableClass, Reserved); + + if (ulAf == AF_INET6 || TableClass != TCP_TABLE_BASIC_ALL) + { + FIXME("ulAf = %u, TableClass = %u not supportted\n", ulAf, TableClass); + return ERROR_NOT_SUPPORTED; + } + return GetTcpTable(pTcpTable, pdwSize, bOrder); +} /****************************************************************** * GetUdpTable (IPHLPAPI.@) diff --git a/include/iphlpapi.h b/include/iphlpapi.h index 0a8def5..4390903 100644 --- a/include/iphlpapi.h +++ b/include/iphlpapi.h @@ -26,6 +26,9 @@ extern "C" { #include <ipexport.h> #include <iptypes.h> +DWORD WINAPI GetExtendedTcpTable(PVOID pTcpTable, PDWORD pdwSize, BOOL bOrder, + ULONG ulAf, TCP_TABLE_CLASS TableClass, ULONG Reserved); + DWORD WINAPI GetNumberOfInterfaces(PDWORD pdwNumIf); DWORD WINAPI GetIfEntry(PMIB_IFROW pIfRow); diff --git a/include/iprtrmib.h b/include/iprtrmib.h index 477f1dd..3d4e65e 100644 --- a/include/iprtrmib.h +++ b/include/iprtrmib.h @@ -25,4 +25,17 @@ #include <tcpmib.h> #include <udpmib.h> +typedef enum _TCP_TABLE_CLASS +{ + TCP_TABLE_BASIC_LISTENER, + TCP_TABLE_BASIC_CONNECTIONS, + TCP_TABLE_BASIC_ALL, + TCP_TABLE_OWNER_PID_LISTENER, + TCP_TABLE_OWNER_PID_CONNECTIONS, + TCP_TABLE_OWNER_PID_ALL, + TCP_TABLE_OWNER_MODULE_LISTENER, + TCP_TABLE_OWNER_MODULE_CONNECTIONS, + TCP_TABLE_OWNER_MODULE_ALL +} TCP_TABLE_CLASS, *PTCP_TABLE_CLASS; + #endif /* WINE_IPRTRMIB_H__ */
1
0
0
0
Hans Leidekker : winhttp/tests: Avoid crashes on some win2k systems.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 3a204f50ae3d0f49d145597f94cc318f0f57c94d URL:
http://source.winehq.org/git/wine.git/?a=commit;h=3a204f50ae3d0f49d145597f9…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Mon Dec 19 15:41:21 2011 +0100 winhttp/tests: Avoid crashes on some win2k systems. --- dlls/winhttp/tests/winhttp.c | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dlls/winhttp/tests/winhttp.c b/dlls/winhttp/tests/winhttp.c index 0155539..cf4ad92 100644 --- a/dlls/winhttp/tests/winhttp.c +++ b/dlls/winhttp/tests/winhttp.c @@ -2524,12 +2524,14 @@ static void test_WinHttpDetectAutoProxyConfigUrl(void) WCHAR *url; DWORD error; +if (0) /* crashes on some win2k systems */ +{ SetLastError(0xdeadbeef); ret = WinHttpDetectAutoProxyConfigUrl( 0, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - +} url = NULL; SetLastError(0xdeadbeef); ret = WinHttpDetectAutoProxyConfigUrl( 0, &url ); @@ -2537,12 +2539,14 @@ static void test_WinHttpDetectAutoProxyConfigUrl(void) ok( !ret, "expected failure\n" ); ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); +if (0) /* crashes on some win2k systems */ +{ SetLastError(0xdeadbeef); ret = WinHttpDetectAutoProxyConfigUrl( WINHTTP_AUTO_DETECT_TYPE_DNS_A, NULL ); error = GetLastError(); ok( !ret, "expected failure\n" ); ok( error == ERROR_INVALID_PARAMETER, "got %u\n", error ); - +} url = NULL; SetLastError(0xdeadbeef); ret = WinHttpDetectAutoProxyConfigUrl( WINHTTP_AUTO_DETECT_TYPE_DNS_A, &url );
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DBLENDOP typedef.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 969f3be73f1e2594d4bb1d0726b8c6825408aba7 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=969f3be73f1e2594d4bb1d072…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 19 15:16:53 2011 +0100 wined3d: Get rid of the WINED3DBLENDOP typedef. --- dlls/wined3d/state.c | 12 ++++++------ dlls/wined3d/stateblock.c | 4 ++-- include/wine/wined3d.h | 15 +++++++-------- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index 7d8c6a4..390519f 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -242,19 +242,19 @@ static void state_blendop_w(struct wined3d_context *context, const struct wined3 WARN("Unsupported in local OpenGL implementation: glBlendEquation\n"); } -static GLenum gl_blend_op(WINED3DBLENDOP op) +static GLenum gl_blend_op(enum wined3d_blend_op op) { switch (op) { - case WINED3DBLENDOP_ADD: + case WINED3D_BLEND_OP_ADD: return GL_FUNC_ADD_EXT; - case WINED3DBLENDOP_SUBTRACT: + case WINED3D_BLEND_OP_SUBTRACT: return GL_FUNC_SUBTRACT_EXT; - case WINED3DBLENDOP_REVSUBTRACT: + case WINED3D_BLEND_OP_REVSUBTRACT: return GL_FUNC_REVERSE_SUBTRACT_EXT; - case WINED3DBLENDOP_MIN: + case WINED3D_BLEND_OP_MIN: return GL_MIN_EXT; - case WINED3DBLENDOP_MAX: + case WINED3D_BLEND_OP_MAX: return GL_MAX_EXT; default: FIXME("Unhandled blend op %#x.\n", op); diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 54dd551..e4acd54 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1207,7 +1207,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) state->render_states[WINED3DRS_COLORWRITEENABLE] = 0x0000000f; tmpfloat.f = 0.0f; state->render_states[WINED3DRS_TWEENFACTOR] = tmpfloat.d; - state->render_states[WINED3DRS_BLENDOP] = WINED3DBLENDOP_ADD; + state->render_states[WINED3DRS_BLENDOP] = WINED3D_BLEND_OP_ADD; state->render_states[WINED3DRS_POSITIONDEGREE] = WINED3DDEGREE_CUBIC; state->render_states[WINED3DRS_NORMALDEGREE] = WINED3DDEGREE_LINEAR; /* states new in d3d9 */ @@ -1247,7 +1247,7 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) state->render_states[WINED3DRS_SEPARATEALPHABLENDENABLE] = FALSE; state->render_states[WINED3DRS_SRCBLENDALPHA] = WINED3D_BLEND_ONE; state->render_states[WINED3DRS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO; - state->render_states[WINED3DRS_BLENDOPALPHA] = WINED3DBLENDOP_ADD; + state->render_states[WINED3DRS_BLENDOPALPHA] = WINED3D_BLEND_OP_ADD; /* Texture Stage States - Put directly into state block, we will call function below */ for (i = 0; i < MAX_TEXTURES; ++i) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9a8c131..a3e9971 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -404,15 +404,14 @@ enum wined3d_blend WINED3D_BLEND_INVBLENDFACTOR = 15, }; -typedef enum _WINED3DBLENDOP -{ - WINED3DBLENDOP_ADD = 1, - WINED3DBLENDOP_SUBTRACT = 2, - WINED3DBLENDOP_REVSUBTRACT = 3, - WINED3DBLENDOP_MIN = 4, - WINED3DBLENDOP_MAX = 5, - WINED3DBLENDOP_FORCE_DWORD = 0x7fffffff -} WINED3DBLENDOP; +enum wined3d_blend_op +{ + WINED3D_BLEND_OP_ADD = 1, + WINED3D_BLEND_OP_SUBTRACT = 2, + WINED3D_BLEND_OP_REVSUBTRACT = 3, + WINED3D_BLEND_OP_MIN = 4, + WINED3D_BLEND_OP_MAX = 5, +}; typedef enum _WINED3DVERTEXBLENDFLAGS {
1
0
0
0
Henri Verbeet : wined3d: Get rid of the WINED3DBLEND typedef.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: b39125d2f09b1916bd759817ce771dca4a9d84db URL:
http://source.winehq.org/git/wine.git/?a=commit;h=b39125d2f09b1916bd759817c…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 19 15:16:52 2011 +0100 wined3d: Get rid of the WINED3DBLEND typedef. --- dlls/wined3d/state.c | 46 ++++++++++++++++++++++---------------------- dlls/wined3d/stateblock.c | 8 +++--- include/wine/wined3d.h | 35 ++++++++++++++++----------------- 3 files changed, 44 insertions(+), 45 deletions(-) diff --git a/dlls/wined3d/state.c b/dlls/wined3d/state.c index d7b86dc..7d8c6a4 100644 --- a/dlls/wined3d/state.c +++ b/dlls/wined3d/state.c @@ -292,41 +292,41 @@ static void state_blendop(struct wined3d_context *context, const struct wined3d_ } } -static GLenum gl_blend_factor(WINED3DBLEND factor, const struct wined3d_format *dst_format) +static GLenum gl_blend_factor(enum wined3d_blend factor, const struct wined3d_format *dst_format) { switch (factor) { - case WINED3DBLEND_ZERO: + case WINED3D_BLEND_ZERO: return GL_ZERO; - case WINED3DBLEND_ONE: + case WINED3D_BLEND_ONE: return GL_ONE; - case WINED3DBLEND_SRCCOLOR: + case WINED3D_BLEND_SRCCOLOR: return GL_SRC_COLOR; - case WINED3DBLEND_INVSRCCOLOR: + case WINED3D_BLEND_INVSRCCOLOR: return GL_ONE_MINUS_SRC_COLOR; - case WINED3DBLEND_SRCALPHA: + case WINED3D_BLEND_SRCALPHA: return GL_SRC_ALPHA; - case WINED3DBLEND_INVSRCALPHA: + case WINED3D_BLEND_INVSRCALPHA: return GL_ONE_MINUS_SRC_ALPHA; - case WINED3DBLEND_DESTCOLOR: + case WINED3D_BLEND_DESTCOLOR: return GL_DST_COLOR; - case WINED3DBLEND_INVDESTCOLOR: + case WINED3D_BLEND_INVDESTCOLOR: return GL_ONE_MINUS_DST_COLOR; /* To compensate for the lack of format switching with backbuffer * offscreen rendering, and with onscreen rendering, we modify the * alpha test parameters for (INV)DESTALPHA if the render target * doesn't support alpha blending. A nonexistent alpha channel - * returns 1.0, so WINED3DBLEND_DESTALPHA becomes GL_ONE, and - * WINED3DBLEND_INVDESTALPHA becomes GL_ZERO. */ - case WINED3DBLEND_DESTALPHA: + * returns 1.0, so WINED3D_BLEND_DESTALPHA becomes GL_ONE, and + * WINED3D_BLEND_INVDESTALPHA becomes GL_ZERO. */ + case WINED3D_BLEND_DESTALPHA: return dst_format->alpha_mask ? GL_DST_ALPHA : GL_ONE; - case WINED3DBLEND_INVDESTALPHA: + case WINED3D_BLEND_INVDESTALPHA: return dst_format->alpha_mask ? GL_ONE_MINUS_DST_ALPHA : GL_ZERO; - case WINED3DBLEND_SRCALPHASAT: + case WINED3D_BLEND_SRCALPHASAT: return GL_SRC_ALPHA_SATURATE; - case WINED3DBLEND_BLENDFACTOR: + case WINED3D_BLEND_BLENDFACTOR: return GL_CONSTANT_COLOR_EXT; - case WINED3DBLEND_INVBLENDFACTOR: + case WINED3D_BLEND_INVBLENDFACTOR: return GL_ONE_MINUS_CONSTANT_COLOR_EXT; default: FIXME("Unhandled blend factor %#x.\n", factor); @@ -339,7 +339,7 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st const struct wined3d_surface *target = state->fb->render_targets[0]; const struct wined3d_gl_info *gl_info = context->gl_info; GLenum srcBlend, dstBlend; - WINED3DBLEND d3d_blend; + enum wined3d_blend d3d_blend; /* According to the red book, GL_LINE_SMOOTH needs GL_BLEND with specific * blending parameters to work. */ @@ -367,16 +367,16 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st return; }; - /* WINED3DBLEND_BOTHSRCALPHA and WINED3DBLEND_BOTHINVSRCALPHA are legacy + /* WINED3D_BLEND_BOTHSRCALPHA and WINED3D_BLEND_BOTHINVSRCALPHA are legacy * source blending values which are still valid up to d3d9. They should * not occur as dest blend values. */ d3d_blend = state->render_states[WINED3DRS_SRCBLEND]; - if (d3d_blend == WINED3DBLEND_BOTHSRCALPHA) + if (d3d_blend == WINED3D_BLEND_BOTHSRCALPHA) { srcBlend = GL_SRC_ALPHA; dstBlend = GL_ONE_MINUS_SRC_ALPHA; } - else if (d3d_blend == WINED3DBLEND_BOTHINVSRCALPHA) + else if (d3d_blend == WINED3D_BLEND_BOTHINVSRCALPHA) { srcBlend = GL_ONE_MINUS_SRC_ALPHA; dstBlend = GL_SRC_ALPHA; @@ -419,16 +419,16 @@ static void state_blend(struct wined3d_context *context, const struct wined3d_st return; } - /* WINED3DBLEND_BOTHSRCALPHA and WINED3DBLEND_BOTHINVSRCALPHA are legacy + /* WINED3D_BLEND_BOTHSRCALPHA and WINED3D_BLEND_BOTHINVSRCALPHA are legacy * source blending values which are still valid up to d3d9. They should * not occur as dest blend values. */ d3d_blend = state->render_states[WINED3DRS_SRCBLENDALPHA]; - if (d3d_blend == WINED3DBLEND_BOTHSRCALPHA) + if (d3d_blend == WINED3D_BLEND_BOTHSRCALPHA) { srcBlendAlpha = GL_SRC_ALPHA; dstBlendAlpha = GL_ONE_MINUS_SRC_ALPHA; } - else if (d3d_blend == WINED3DBLEND_BOTHINVSRCALPHA) + else if (d3d_blend == WINED3D_BLEND_BOTHINVSRCALPHA) { srcBlendAlpha = GL_ONE_MINUS_SRC_ALPHA; dstBlendAlpha = GL_SRC_ALPHA; diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index 401aa69..54dd551 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1131,8 +1131,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) state->render_states[WINED3DRS_ZWRITEENABLE] = TRUE; state->render_states[WINED3DRS_ALPHATESTENABLE] = FALSE; state->render_states[WINED3DRS_LASTPIXEL] = TRUE; - state->render_states[WINED3DRS_SRCBLEND] = WINED3DBLEND_ONE; - state->render_states[WINED3DRS_DESTBLEND] = WINED3DBLEND_ZERO; + state->render_states[WINED3DRS_SRCBLEND] = WINED3D_BLEND_ONE; + state->render_states[WINED3DRS_DESTBLEND] = WINED3D_BLEND_ZERO; state->render_states[WINED3DRS_CULLMODE] = WINED3DCULL_CCW; state->render_states[WINED3DRS_ZFUNC] = WINED3DCMP_LESSEQUAL; state->render_states[WINED3DRS_ALPHAFUNC] = WINED3DCMP_ALWAYS; @@ -1245,8 +1245,8 @@ void stateblock_init_default_state(struct wined3d_stateblock *stateblock) state->render_states[WINED3DRS_WRAP14] = 0; state->render_states[WINED3DRS_WRAP15] = 0; state->render_states[WINED3DRS_SEPARATEALPHABLENDENABLE] = FALSE; - state->render_states[WINED3DRS_SRCBLENDALPHA] = WINED3DBLEND_ONE; - state->render_states[WINED3DRS_DESTBLENDALPHA] = WINED3DBLEND_ZERO; + state->render_states[WINED3DRS_SRCBLENDALPHA] = WINED3D_BLEND_ONE; + state->render_states[WINED3DRS_DESTBLENDALPHA] = WINED3D_BLEND_ZERO; state->render_states[WINED3DRS_BLENDOPALPHA] = WINED3DBLENDOP_ADD; /* Texture Stage States - Put directly into state block, we will call function below */ diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9f43271..9a8c131 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -385,25 +385,24 @@ typedef enum _WINED3DRENDERSTATETYPE } WINED3DRENDERSTATETYPE; #define WINEHIGHEST_RENDER_STATE WINED3DRS_BLENDOPALPHA -typedef enum _WINED3DBLEND -{ - WINED3DBLEND_ZERO = 1, - WINED3DBLEND_ONE = 2, - WINED3DBLEND_SRCCOLOR = 3, - WINED3DBLEND_INVSRCCOLOR = 4, - WINED3DBLEND_SRCALPHA = 5, - WINED3DBLEND_INVSRCALPHA = 6, - WINED3DBLEND_DESTALPHA = 7, - WINED3DBLEND_INVDESTALPHA = 8, - WINED3DBLEND_DESTCOLOR = 9, - WINED3DBLEND_INVDESTCOLOR = 10, - WINED3DBLEND_SRCALPHASAT = 11, - WINED3DBLEND_BOTHSRCALPHA = 12, - WINED3DBLEND_BOTHINVSRCALPHA = 13, - WINED3DBLEND_BLENDFACTOR = 14, - WINED3DBLEND_INVBLENDFACTOR = 15, - WINED3DBLEND_FORCE_DWORD = 0x7fffffff -} WINED3DBLEND; +enum wined3d_blend +{ + WINED3D_BLEND_ZERO = 1, + WINED3D_BLEND_ONE = 2, + WINED3D_BLEND_SRCCOLOR = 3, + WINED3D_BLEND_INVSRCCOLOR = 4, + WINED3D_BLEND_SRCALPHA = 5, + WINED3D_BLEND_INVSRCALPHA = 6, + WINED3D_BLEND_DESTALPHA = 7, + WINED3D_BLEND_INVDESTALPHA = 8, + WINED3D_BLEND_DESTCOLOR = 9, + WINED3D_BLEND_INVDESTCOLOR = 10, + WINED3D_BLEND_SRCALPHASAT = 11, + WINED3D_BLEND_BOTHSRCALPHA = 12, + WINED3D_BLEND_BOTHINVSRCALPHA = 13, + WINED3D_BLEND_BLENDFACTOR = 14, + WINED3D_BLEND_INVBLENDFACTOR = 15, +}; typedef enum _WINED3DBLENDOP {
1
0
0
0
Henri Verbeet : ddraw/tests: Introduce proper vector types.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: fb28e7f5965fb8396d34bf35c1fda5d7cb5e198e URL:
http://source.winehq.org/git/wine.git/?a=commit;h=fb28e7f5965fb8396d34bf35c…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 19 15:16:51 2011 +0100 ddraw/tests: Introduce proper vector types. --- dlls/ddraw/tests/d3d.c | 49 +++++++++++++++++++++++------------------------ 1 files changed, 24 insertions(+), 25 deletions(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index dc88a84..a151a08 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -71,16 +71,15 @@ typedef struct static HRESULT (WINAPI *pDirectDrawCreateEx)(LPGUID,LPVOID*,REFIID,LPUNKNOWN); -typedef struct _VERTEX +struct vec3 { - float x, y, z; /* position */ -} VERTEX, *LPVERTEX; + float x, y, z; +}; -typedef struct _TVERTEX +struct vec4 { - float x, y, z; /* position */ - float rhw; -} TVERTEX, *LPTVERTEX; + float x, y, z, w; +}; static BOOL compare_float(float f, float g, unsigned int ulps) { @@ -98,19 +97,19 @@ static BOOL compare_float(float f, float g, unsigned int ulps) return TRUE; } -static BOOL compare_vec3(VERTEX *vec, float x, float y, float z, unsigned int ulps) +static BOOL compare_vec3(struct vec3 *vec, float x, float y, float z, unsigned int ulps) { return compare_float(vec->x, x, ulps) && compare_float(vec->y, y, ulps) && compare_float(vec->z, z, ulps); } -static BOOL compare_vec4(TVERTEX *vec, float x, float y, float z, float w, unsigned int ulps) +static BOOL compare_vec4(struct vec4 *vec, float x, float y, float z, float w, unsigned int ulps) { return compare_float(vec->x, x, ulps) && compare_float(vec->y, y, ulps) && compare_float(vec->z, z, ulps) - && compare_float(vec->rhw, w, ulps); + && compare_float(vec->w, w, ulps); } static void init_function_pointers(void) @@ -457,10 +456,10 @@ static void LightTest(void) static void ProcessVerticesTest(void) { D3DVERTEXBUFFERDESC desc; + struct vec4 *out; + struct vec3 *out2; + struct vec3 *in; HRESULT rc; - VERTEX *in; - TVERTEX *out; - VERTEX *out2; D3DVIEWPORT7 vp; D3DMATRIX view = { 2.0, 0.0, 0.0, 0.0, 0.0, -1.0, 0.0, 0.0, @@ -566,16 +565,16 @@ static void ProcessVerticesTest(void) /* Check the results */ ok(compare_vec4(&out[0], +1.280e+2f, +1.280e+2f, +0.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", - out[0].x, out[0].y, out[0].z, out[0].rhw); + out[0].x, out[0].y, out[0].z, out[0].w); ok(compare_vec4(&out[1], +1.920e+2f, +6.400e+1f, +1.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n", - out[1].x, out[1].y, out[1].z, out[1].rhw); + out[1].x, out[1].y, out[1].z, out[1].w); ok(compare_vec4(&out[2], +6.400e+1f, +1.920e+2f, +5.000e-1f, +1.000e+0f, 4096), "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", - out[2].x, out[2].y, out[2].z, out[2].rhw); + out[2].x, out[2].y, out[2].z, out[2].w); ok(compare_vec4(&out[3], +1.600e+2f, +1.600e+2f, +2.500e-1f, +1.000e+0f, 4096), "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", - out[3].x, out[3].y, out[3].z, out[3].rhw); + out[3].x, out[3].y, out[3].z, out[3].w); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc); @@ -618,16 +617,16 @@ static void ProcessVerticesTest(void) /* Check the results */ ok(compare_vec4(&out[0], +1.330e+2f, +7.000e+1f, -2.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", - out[0].x, out[0].y, out[0].z, out[0].rhw); + out[0].x, out[0].y, out[0].z, out[0].w); ok(compare_vec4(&out[1], +2.560e+2f, +5.000e+0f, +4.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n", - out[1].x, out[1].y, out[1].z, out[1].rhw); + out[1].x, out[1].y, out[1].z, out[1].w); ok(compare_vec4(&out[2], +1.000e+1f, +1.350e+2f, +1.000e+0f, +1.000e+0f, 4096), "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", - out[2].x, out[2].y, out[2].z, out[2].rhw); + out[2].x, out[2].y, out[2].z, out[2].w); ok(compare_vec4(&out[3], +1.945e+2f, +1.025e+2f, -5.000e-1f, +1.000e+0f, 4096), "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", - out[3].x, out[3].y, out[3].z, out[3].rhw); + out[3].x, out[3].y, out[3].z, out[3].w); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc); @@ -654,16 +653,16 @@ static void ProcessVerticesTest(void) /* Check the results */ ok(compare_vec4(&out[0], +2.560e+2f, +7.000e+1f, -2.000e+0f, +3.333e-1f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", - out[0].x, out[0].y, out[0].z, out[0].rhw); + out[0].x, out[0].y, out[0].z, out[0].w); ok(compare_vec4(&out[1], +2.560e+2f, +7.813e+1f, -2.750e+0f, +1.250e-1f, 4096), "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n", - out[1].x, out[1].y, out[1].z, out[1].rhw); + out[1].x, out[1].y, out[1].z, out[1].w); ok(compare_vec4(&out[2], +2.560e+2f, +4.400e+1f, +4.000e-1f, +4.000e-1f, 4096), "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", - out[2].x, out[2].y, out[2].z, out[2].rhw); + out[2].x, out[2].y, out[2].z, out[2].w); ok(compare_vec4(&out[3], +2.560e+2f, +8.182e+1f, -3.091e+0f, +3.636e-1f, 4096), "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", - out[3].x, out[3].y, out[3].z, out[3].rhw); + out[3].x, out[3].y, out[3].z, out[3].w); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
1
0
0
0
Henri Verbeet : ddraw/tests: Remove a redundant IDirect3DDevice7_SetViewport() call.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: bd09f63bff4a3dbe0fab376184156c2cff49cd2f URL:
http://source.winehq.org/git/wine.git/?a=commit;h=bd09f63bff4a3dbe0fab37618…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 19 15:16:50 2011 +0100 ddraw/tests: Remove a redundant IDirect3DDevice7_SetViewport() call. --- dlls/ddraw/tests/d3d.c | 10 ---------- 1 files changed, 0 insertions(+), 10 deletions(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index 962bfad..dc88a84 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -651,16 +651,6 @@ static void ProcessVerticesTest(void) ok(rc==D3D_OK , "IDirect3DVertexBuffer::Lock returned: %x\n", rc); if(!out) goto out; - /* Keep the viewport simpler, otherwise we get bad numbers to compare */ - vp.dwX = 0; - vp.dwY = 0; - vp.dwWidth = 100; - vp.dwHeight = 100; - vp.dvMinZ = 1.0; - vp.dvMaxZ = 0.0; - rc = IDirect3DDevice7_SetViewport(lpD3DDevice, &vp); - ok(rc==D3D_OK, "IDirect3DDevice7_SetViewport failed\n"); - /* Check the results */ ok(compare_vec4(&out[0], +2.560e+2f, +7.000e+1f, -2.000e+0f, +3.333e-1f, 4096), "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n",
1
0
0
0
Henri Verbeet : ddraw/tests: Introduce some functions for comparing floating-point vectors.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 2db8688185ca594d8864548b521493b7b953f316 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2db8688185ca594d8864548b5…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Mon Dec 19 15:16:49 2011 +0100 ddraw/tests: Introduce some functions for comparing floating-point vectors. --- dlls/ddraw/tests/d3d.c | 157 ++++++++++++++++++++++++----------------------- 1 files changed, 80 insertions(+), 77 deletions(-) diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c index f44e31e..962bfad 100644 --- a/dlls/ddraw/tests/d3d.c +++ b/dlls/ddraw/tests/d3d.c @@ -23,6 +23,7 @@ #define COBJMACROS #include "wine/test.h" +#include <limits.h> #include "initguid.h" #include "ddraw.h" #include "d3d.h" @@ -68,10 +69,6 @@ typedef struct char callback_name_strings[MAX_ENUMERATION_COUNT][100]; } D3D7ELifetimeTest; -/* To compare bad floating point numbers. Not the ideal way to do it, - * but it should be enough for here */ -#define comparefloat(a, b) ( (((a) - (b)) < 0.0001) && (((a) - (b)) > -0.0001) ) - static HRESULT (WINAPI *pDirectDrawCreateEx)(LPGUID,LPVOID*,REFIID,LPUNKNOWN); typedef struct _VERTEX @@ -85,6 +82,36 @@ typedef struct _TVERTEX float rhw; } TVERTEX, *LPTVERTEX; +static BOOL compare_float(float f, float g, unsigned int ulps) +{ + int x = *(int *)&f; + int y = *(int *)&g; + + if (x < 0) + x = INT_MIN - x; + if (y < 0) + y = INT_MIN - y; + + if (abs(x - y) > ulps) + return FALSE; + + return TRUE; +} + +static BOOL compare_vec3(VERTEX *vec, float x, float y, float z, unsigned int ulps) +{ + return compare_float(vec->x, x, ulps) + && compare_float(vec->y, y, ulps) + && compare_float(vec->z, z, ulps); +} + +static BOOL compare_vec4(TVERTEX *vec, float x, float y, float z, float w, unsigned int ulps) +{ + return compare_float(vec->x, x, ulps) + && compare_float(vec->y, y, ulps) + && compare_float(vec->z, z, ulps) + && compare_float(vec->rhw, w, ulps); +} static void init_function_pointers(void) { @@ -516,6 +543,16 @@ static void ProcessVerticesTest(void) rc = IDirect3DVertexBuffer7_Unlock(lpVBufSrc); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc); + memset(&vp, 0, sizeof(vp)); + vp.dwX = 64; + vp.dwY = 64; + vp.dwWidth = 128; + vp.dwHeight = 128; + vp.dvMinZ = 0.0f; + vp.dvMaxZ = 1.0f; + rc = IDirect3DDevice7_SetViewport(lpD3DDevice, &vp); + ok(SUCCEEDED(rc), "Failed to set viewport, hr %#x.\n", rc); + rc = IDirect3DVertexBuffer7_ProcessVertices(lpVBufDest1, D3DVOP_TRANSFORM, 0, 4, lpVBufSrc, 0, lpD3DDevice, 0); ok(rc==D3D_OK , "IDirect3DVertexBuffer::ProcessVertices returned: %x\n", rc); @@ -527,29 +564,18 @@ static void ProcessVerticesTest(void) if(!out) goto out; /* Check the results */ - ok( comparefloat(out[0].x, 128.0 ) && - comparefloat(out[0].y, 128.0 ) && - comparefloat(out[0].z, 0.0 ) && - comparefloat(out[0].rhw, 1.0 ), - "Output 0 vertex is (%f , %f , %f , %f)\n", out[0].x, out[0].y, out[0].z, out[0].rhw); - - ok( comparefloat(out[1].x, 256.0 ) && - comparefloat(out[1].y, 0.0 ) && - comparefloat(out[1].z, 1.0 ) && - comparefloat(out[1].rhw, 1.0 ), - "Output 1 vertex is (%f , %f , %f , %f)\n", out[1].x, out[1].y, out[1].z, out[1].rhw); - - ok( comparefloat(out[2].x, 0.0 ) && - comparefloat(out[2].y, 256.0 ) && - comparefloat(out[2].z, 0.5 ) && - comparefloat(out[2].rhw, 1.0 ), - "Output 2 vertex is (%f , %f , %f , %f)\n", out[2].x, out[2].y, out[2].z, out[2].rhw); - - ok( comparefloat(out[3].x, 192.0 ) && - comparefloat(out[3].y, 192.0 ) && - comparefloat(out[3].z, 0.25 ) && - comparefloat(out[3].rhw, 1.0 ), - "Output 3 vertex is (%f , %f , %f , %f)\n", out[3].x, out[3].y, out[3].z, out[3].rhw); + ok(compare_vec4(&out[0], +1.280e+2f, +1.280e+2f, +0.000e+0f, +1.000e+0f, 4096), + "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", + out[0].x, out[0].y, out[0].z, out[0].rhw); + ok(compare_vec4(&out[1], +1.920e+2f, +6.400e+1f, +1.000e+0f, +1.000e+0f, 4096), + "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n", + out[1].x, out[1].y, out[1].z, out[1].rhw); + ok(compare_vec4(&out[2], +6.400e+1f, +1.920e+2f, +5.000e-1f, +1.000e+0f, 4096), + "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", + out[2].x, out[2].y, out[2].z, out[2].rhw); + ok(compare_vec4(&out[3], +1.600e+2f, +1.600e+2f, +2.500e-1f, +1.000e+0f, 4096), + "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", + out[3].x, out[3].y, out[3].z, out[3].rhw); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc); @@ -562,10 +588,9 @@ static void ProcessVerticesTest(void) * so let's check for it: If the output vertex buffer has to RHW value, * The RHW value of the last vertex is written into the next vertex */ - ok( comparefloat(out2[4].x, 1.0 ) && - comparefloat(out2[4].y, 0.0 ) && - comparefloat(out2[4].z, 0.0 ), - "Output 4 vertex is (%f , %f , %f)\n", out2[4].x, out2[4].y, out2[4].z); + ok(compare_vec3(&out2[4], +1.000e+0f, +0.000e+0f, +0.000e+0f, 4096), + "Got unexpected vertex 4 {%.8e, %.8e, %.8e}.\n", + out2[4].x, out2[4].y, out2[4].z); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest2); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc); @@ -591,29 +616,18 @@ static void ProcessVerticesTest(void) if(!out) goto out; /* Check the results */ - ok( comparefloat(out[0].x, 133.0 ) && - comparefloat(out[0].y, 70.0 ) && - comparefloat(out[0].z, -2.0 ) && - comparefloat(out[0].rhw, 1.0 ), - "Output 0 vertex is (%f , %f , %f , %f)\n", out[0].x, out[0].y, out[0].z, out[0].rhw); - - ok( comparefloat(out[1].x, 256.0 ) && - comparefloat(out[1].y, 5.0 ) && - comparefloat(out[1].z, 4.0 ) && - comparefloat(out[1].rhw, 1.0 ), - "Output 1 vertex is (%f , %f , %f , %f)\n", out[1].x, out[1].y, out[1].z, out[1].rhw); - - ok( comparefloat(out[2].x, 10.0 ) && - comparefloat(out[2].y, 135.0 ) && - comparefloat(out[2].z, 1.0 ) && - comparefloat(out[2].rhw, 1.0 ), - "Output 2 vertex is (%f , %f , %f , %f)\n", out[1].x, out[1].y, out[1].z, out[1].rhw); - - ok( comparefloat(out[3].x, 194.5 ) && - comparefloat(out[3].y, 102.5 ) && - comparefloat(out[3].z, -0.5 ) && - comparefloat(out[3].rhw, 1.0 ), - "Output 3 vertex is (%f , %f , %f , %f)\n", out[3].x, out[3].y, out[3].z, out[3].rhw); + ok(compare_vec4(&out[0], +1.330e+2f, +7.000e+1f, -2.000e+0f, +1.000e+0f, 4096), + "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", + out[0].x, out[0].y, out[0].z, out[0].rhw); + ok(compare_vec4(&out[1], +2.560e+2f, +5.000e+0f, +4.000e+0f, +1.000e+0f, 4096), + "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n", + out[1].x, out[1].y, out[1].z, out[1].rhw); + ok(compare_vec4(&out[2], +1.000e+1f, +1.350e+2f, +1.000e+0f, +1.000e+0f, 4096), + "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", + out[2].x, out[2].y, out[2].z, out[2].rhw); + ok(compare_vec4(&out[3], +1.945e+2f, +1.025e+2f, -5.000e-1f, +1.000e+0f, 4096), + "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", + out[3].x, out[3].y, out[3].z, out[3].rhw); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc); @@ -648,29 +662,18 @@ static void ProcessVerticesTest(void) ok(rc==D3D_OK, "IDirect3DDevice7_SetViewport failed\n"); /* Check the results */ - ok( comparefloat(out[0].x, 256.0 ) && /* X coordinate is cut at the surface edges */ - comparefloat(out[0].y, 70.0 ) && - comparefloat(out[0].z, -2.0 ) && - comparefloat(out[0].rhw, (1.0 / 3.0)), - "Output 0 vertex is (%f , %f , %f , %f)\n", out[0].x, out[0].y, out[0].z, out[0].rhw); - - ok( comparefloat(out[1].x, 256.0 ) && - comparefloat(out[1].y, 78.125000 ) && - comparefloat(out[1].z, -2.750000 ) && - comparefloat(out[1].rhw, 0.125000 ), - "Output 1 vertex is (%f , %f , %f , %f)\n", out[1].x, out[1].y, out[1].z, out[1].rhw); - - ok( comparefloat(out[2].x, 256.0 ) && - comparefloat(out[2].y, 44.000000 ) && - comparefloat(out[2].z, 0.400000 ) && - comparefloat(out[2].rhw, 0.400000 ), - "Output 2 vertex is (%f , %f , %f , %f)\n", out[2].x, out[2].y, out[2].z, out[2].rhw); - - ok( comparefloat(out[3].x, 256.0 ) && - comparefloat(out[3].y, 81.818184 ) && - comparefloat(out[3].z, -3.090909 ) && - comparefloat(out[3].rhw, 0.363636 ), - "Output 3 vertex is (%f , %f , %f , %f)\n", out[3].x, out[3].y, out[3].z, out[3].rhw); + ok(compare_vec4(&out[0], +2.560e+2f, +7.000e+1f, -2.000e+0f, +3.333e-1f, 4096), + "Got unexpected vertex 0 {%.8e, %.8e, %.8e, %.8e}.\n", + out[0].x, out[0].y, out[0].z, out[0].rhw); + ok(compare_vec4(&out[1], +2.560e+2f, +7.813e+1f, -2.750e+0f, +1.250e-1f, 4096), + "Got unexpected vertex 1 {%.8e, %.8e, %.8e, %.8e}.\n", + out[1].x, out[1].y, out[1].z, out[1].rhw); + ok(compare_vec4(&out[2], +2.560e+2f, +4.400e+1f, +4.000e-1f, +4.000e-1f, 4096), + "Got unexpected vertex 2 {%.8e, %.8e, %.8e, %.8e}.\n", + out[2].x, out[2].y, out[2].z, out[2].rhw); + ok(compare_vec4(&out[3], +2.560e+2f, +8.182e+1f, -3.091e+0f, +3.636e-1f, 4096), + "Got unexpected vertex 3 {%.8e, %.8e, %.8e, %.8e}.\n", + out[3].x, out[3].y, out[3].z, out[3].rhw); rc = IDirect3DVertexBuffer7_Unlock(lpVBufDest1); ok(rc==D3D_OK , "IDirect3DVertexBuffer::Unlock returned: %x\n", rc);
1
0
0
0
Jacek Caban : jscript: Use compiler for hanling empty statements.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: 7c3160ae0240534dcedc45349d6193ca3d63acd3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=7c3160ae0240534dcedc45349…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 19 15:00:06 2011 +0100 jscript: Use compiler for hanling empty statements. --- dlls/jscript/compile.c | 2 ++ dlls/jscript/engine.c | 9 --------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 3 insertions(+), 11 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index 9fdce33..09384bc 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -928,6 +928,8 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_t *stat) switch(stat->type) { case STAT_BLOCK: return compile_block_statement(ctx, ((block_statement_t*)stat)->stat_list); + case STAT_EMPTY: + return push_instr(ctx, OP_undefined) == -1 ? E_OUTOFMEMORY : S_OK; /* FIXME */ case STAT_EXPR: return compile_expression_statement(ctx, (expression_statement_t*)stat); case STAT_IF: diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 6ca10b3..2dc1b29 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -703,15 +703,6 @@ HRESULT var_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t return S_OK; } -/* ECMA-262 3rd Edition 12.3 */ -HRESULT empty_statement_eval(script_ctx_t *ctx, statement_t *stat, return_type_t *rt, VARIANT *ret) -{ - TRACE("\n"); - - V_VT(ret) = VT_EMPTY; - return S_OK; -} - /* ECMA-262 3rd Edition 12.6.2 */ HRESULT while_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index ebca7db..0fae5fb 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -399,7 +399,6 @@ typedef struct { HRESULT compiled_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT var_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; -HRESULT empty_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT while_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT for_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT forin_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index 925b12d..085b819 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -839,7 +839,7 @@ static const statement_eval_t stat_eval_table[] = { compiled_statement_eval, break_statement_eval, continue_statement_eval, - empty_statement_eval, + compiled_statement_eval, compiled_statement_eval, for_statement_eval, forin_statement_eval,
1
0
0
0
Jacek Caban : jscript: Use compiler for handling if statement.
by Alexandre Julliard
19 Dec '11
19 Dec '11
Module: wine Branch: master Commit: cf2fc11e318cfd165a5224a4b393dc57d72096aa URL:
http://source.winehq.org/git/wine.git/?a=commit;h=cf2fc11e318cfd165a5224a4b…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Mon Dec 19 14:59:51 2011 +0100 jscript: Use compiler for handling if statement. --- dlls/jscript/compile.c | 43 +++++++++++++++++++++++++++++++++++++++++++ dlls/jscript/engine.c | 29 ----------------------------- dlls/jscript/engine.h | 1 - dlls/jscript/parser.y | 2 +- 4 files changed, 44 insertions(+), 31 deletions(-) diff --git a/dlls/jscript/compile.c b/dlls/jscript/compile.c index b46ea59..9fdce33 100644 --- a/dlls/jscript/compile.c +++ b/dlls/jscript/compile.c @@ -882,6 +882,47 @@ static HRESULT compile_expression_statement(compiler_ctx_t *ctx, expression_stat return S_OK; } +/* ECMA-262 3rd Edition 12.5 */ +static HRESULT compile_if_statement(compiler_ctx_t *ctx, if_statement_t *stat) +{ + unsigned jmp_else, jmp_end; + HRESULT hres; + + hres = compile_expression(ctx, stat->expr); + if(FAILED(hres)) + return hres; + + jmp_else = push_instr(ctx, OP_jmp_z); + if(jmp_else == -1) + return E_OUTOFMEMORY; + + hres = compile_statement(ctx, stat->if_stat); + if(FAILED(hres)) + return hres; + + jmp_end = push_instr(ctx, OP_jmp); + if(jmp_end == -1) + return E_OUTOFMEMORY; + + instr_ptr(ctx, jmp_else)->arg1.uint = ctx->code_off; + + if(push_instr(ctx, OP_pop) == -1) + return E_OUTOFMEMORY; + + if(stat->else_stat) { + hres = compile_statement(ctx, stat->else_stat); + if(FAILED(hres)) + return hres; + }else { + /* FIXME: We could sometimes avoid it */ + if(push_instr(ctx, OP_undefined) == -1) + return E_OUTOFMEMORY; + } + + instr_ptr(ctx, jmp_end)->arg1.uint = ctx->code_off; + return S_OK; +} + static HRESULT compile_statement(compiler_ctx_t *ctx, statement_t *stat) { switch(stat->type) { @@ -889,6 +930,8 @@ static HRESULT compile_statement(compiler_ctx_t *ctx, statement_t *stat) return compile_block_statement(ctx, ((block_statement_t*)stat)->stat_list); case STAT_EXPR: return compile_expression_statement(ctx, (expression_statement_t*)stat); + case STAT_IF: + return compile_if_statement(ctx, (if_statement_t*)stat); default: return compile_interp_fallback(ctx, stat); } diff --git a/dlls/jscript/engine.c b/dlls/jscript/engine.c index 664af86..6ca10b3 100644 --- a/dlls/jscript/engine.c +++ b/dlls/jscript/engine.c @@ -712,35 +712,6 @@ HRESULT empty_statement_eval(script_ctx_t *ctx, statement_t *stat, return_type_t return S_OK; } -/* ECMA-262 3rd Edition 12.5 */ -HRESULT if_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) -{ - if_statement_t *stat = (if_statement_t*)_stat; - VARIANT_BOOL b; - VARIANT v; - HRESULT hres; - - TRACE("\n"); - - hres = expr_eval(ctx, stat->expr, 0, &rt->ei, &v); - if(FAILED(hres)) - return hres; - - hres = to_boolean(&v, &b); - VariantClear(&v); - if(FAILED(hres)) - return hres; - - if(b) - hres = stat_eval(ctx, stat->if_stat, rt, ret); - else if(stat->else_stat) - hres = stat_eval(ctx, stat->else_stat, rt, ret); - else - V_VT(ret) = VT_EMPTY; - - return hres; -} - /* ECMA-262 3rd Edition 12.6.2 */ HRESULT while_statement_eval(script_ctx_t *ctx, statement_t *_stat, return_type_t *rt, VARIANT *ret) { diff --git a/dlls/jscript/engine.h b/dlls/jscript/engine.h index 804713e..ebca7db 100644 --- a/dlls/jscript/engine.h +++ b/dlls/jscript/engine.h @@ -400,7 +400,6 @@ typedef struct { HRESULT compiled_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT var_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT empty_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; -HRESULT if_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT while_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT for_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; HRESULT forin_statement_eval(script_ctx_t*,statement_t*,return_type_t*,VARIANT*) DECLSPEC_HIDDEN; diff --git a/dlls/jscript/parser.y b/dlls/jscript/parser.y index adbcb6e..925b12d 100644 --- a/dlls/jscript/parser.y +++ b/dlls/jscript/parser.y @@ -843,7 +843,7 @@ static const statement_eval_t stat_eval_table[] = { compiled_statement_eval, for_statement_eval, forin_statement_eval, - if_statement_eval, + compiled_statement_eval, labelled_statement_eval, return_statement_eval, switch_statement_eval,
1
0
0
0
← Newer
1
...
27
28
29
30
31
32
33
...
81
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
Results per page:
10
25
50
100
200