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
June 2020
----- 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
947 discussions
Start a n
N
ew thread
André Hentschel : include: Add else cases for __cdecl.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: 557b81116d8843415eb2cc7d0ca4c34946593dc4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=557b81116d8843415eb2cc7d…
Author: André Hentschel <nerv(a)dawncrow.de> Date: Wed Jun 17 15:09:34 2020 +0200 include: Add else cases for __cdecl. Signed-off-by: André Hentschel <nerv(a)dawncrow.de> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/msvcrt/corecrt.h | 2 ++ include/windef.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/msvcrt/corecrt.h b/include/msvcrt/corecrt.h index c98b72f7d3..ad46c56591 100644 --- a/include/msvcrt/corecrt.h +++ b/include/msvcrt/corecrt.h @@ -100,6 +100,8 @@ # define __cdecl __attribute__((pcs("aapcs-vfp"))) # elif defined(__aarch64__) && defined (__GNUC__) # define __cdecl __attribute__((ms_abi)) +# else +# define __cdecl # endif #endif /* __cdecl */ diff --git a/include/windef.h b/include/windef.h index 7ece7c8628..521c3ab451 100644 --- a/include/windef.h +++ b/include/windef.h @@ -93,7 +93,7 @@ extern "C" { # define __cdecl __attribute__((pcs("aapcs-vfp"))) # elif defined(__aarch64__) && defined (__GNUC__) # define __cdecl __attribute__((ms_abi)) -# elif !defined(_MSC_VER) +# else # define __cdecl # endif #endif /* __cdecl */
1
0
0
0
Paul Gofman : ddraw/tests: Port _SetSurfaceDesc() tests for mipmaps and DDSD_LPSURFACE for ddraw2.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: 2cbab8a0a2121504041b73b717f098acab816f44 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2cbab8a0a2121504041b73b7…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 17 01:54:29 2020 +0300 ddraw/tests: Port _SetSurfaceDesc() tests for mipmaps and DDSD_LPSURFACE for ddraw2. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw2.c | 119 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 116 insertions(+), 3 deletions(-) diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 25cbe8fa92..1d358e192c 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -5573,6 +5573,119 @@ static void test_set_surface_desc(void) IDirectDrawSurface3_Release(surface3); + /* Test mipmap texture. */ + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U2(ddsd).dwMipMapCount = 3; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + + if (FAILED(hr)) + { + skip("Mipmaps are not supported.\n"); + } + else + { + hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface_Release(surface); + + /* Changing surface desc for mipmap fails even without changing any + * parameters. */ + hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_LPSURFACE; + ddsd.lpSurface = data; + hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface3_Release(surface3); + } + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U2(ddsd).dwMipMapCount = 3; + ddsd.lpSurface = data; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + + hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + + if (hr == DD_OK) + { + static DDSCAPS caps = {DDSCAPS_TEXTURE}; + IDirectDrawSurface3 *surface2; + + hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface_Release(surface); + + hr = IDirectDrawSurface3_GetAttachedSurface(surface3, &caps, &surface2); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + reset_ddsd(&ddsd); + hr = IDirectDrawSurface3_GetSurfaceDesc(surface2, &ddsd); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(ddsd.dwWidth == 4, "Got unexpected dwWidth %u.\n", ddsd.dwWidth); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 16; + ddsd.dwHeight = 16; + U1(ddsd).lPitch = 16 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U1(ddsd).lPitch = 8 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + if (0) + { + /* _Lock causes access violation on Windows. */ + reset_ddsd(&ddsd); + hr = IDirectDrawSurface3_Lock(surface2, NULL, &ddsd, DDLOCK_WAIT, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface3_Unlock(surface2, NULL); + } + + if (0) + { + /* Causes access violation on Windows. */ + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 4; + ddsd.dwHeight = 4; + U1(ddsd).lPitch = 4 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface3_SetSurfaceDesc(surface2, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + } + IDirectDrawSurface3_Release(surface2); + IDirectDrawSurface3_Release(surface3); + } + + /* Test surface created with DDSD_LPSURFACE. */ + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LPSURFACE | DDSD_PITCH; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + ddsd.lpSurface = data; + U1(ddsd).lPitch = 8 * 4; + ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + /* SetSurfaceDesc needs systemmemory surfaces. * * As a sidenote, fourcc surfaces aren't allowed in sysmem, thus testing DDSD_LINEARSIZE is moot. */ @@ -5595,7 +5708,7 @@ static void test_set_surface_desc(void) } hr = IDirectDraw2_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, "Failed to create surface, hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Got unexpected hr %#x.\n", hr); if (FAILED(hr)) { skip("Cannot create a %s surface, skipping vidmem SetSurfaceDesc test.\n", @@ -5603,7 +5716,7 @@ static void test_set_surface_desc(void) goto done; } hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirectDrawSurface3, (void **)&surface3); - ok(SUCCEEDED(hr), "Failed to get IDirectDrawSurface3 interface, hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); IDirectDrawSurface_Release(surface); reset_ddsd(&ddsd); @@ -5612,7 +5725,7 @@ static void test_set_surface_desc(void) hr = IDirectDrawSurface3_SetSurfaceDesc(surface3, &ddsd, 0); if (invalid_caps_tests[i].supported) { - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); } else {
1
0
0
0
Paul Gofman : ddraw/tests: Port _SetSurfaceDesc() tests for mipmaps and DDSD_LPSURFACE for ddraw4.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: ca374dd67eaf4765deee9d83f2c6e7c3d144ddf4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ca374dd67eaf4765deee9d83…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 17 01:54:28 2020 +0300 ddraw/tests: Port _SetSurfaceDesc() tests for mipmaps and DDSD_LPSURFACE for ddraw4. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw4.c | 146 +++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 144 insertions(+), 2 deletions(-) diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 5dc2b4e7e5..21195b1a22 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -7260,6 +7260,148 @@ static void test_set_surface_desc(void) IDirectDrawSurface4_Release(surface); + /* Test mipmap texture. */ + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U2(ddsd).dwMipMapCount = 3; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_VIDEOMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + + hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + + if (FAILED(hr)) + { + skip("Mipmaps are not supported.\n"); + } + else + { + /* Changing surface desc for mipmap fails even without changing any + * parameters. */ + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_LPSURFACE; + ddsd.lpSurface = data; + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface4_Release(surface); + } + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U2(ddsd).dwMipMapCount = 3; + ddsd.lpSurface = data; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + + hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + + if (hr == DD_OK) + { + static DDSCAPS2 caps = {DDSCAPS_TEXTURE, 0, 0, {0}}; + IDirectDrawSurface4 *surface2; + + hr = IDirectDrawSurface4_GetAttachedSurface(surface, &caps, &surface2); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + reset_ddsd(&ddsd); + hr = IDirectDrawSurface4_GetSurfaceDesc(surface2, &ddsd); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(ddsd.dwWidth == 4, "Got unexpected dwWidth %u.\n", ddsd.dwWidth); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 16; + ddsd.dwHeight = 16; + U1(ddsd).lPitch = 16 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U1(ddsd).lPitch = 8 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + if (0) + { + /* _Lock causes access violation on Windows. */ + reset_ddsd(&ddsd); + hr = IDirectDrawSurface4_Lock(surface2, NULL, &ddsd, DDLOCK_WAIT, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface4_Unlock(surface2, NULL); + } + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 4; + ddsd.dwHeight = 4; + U1(ddsd).lPitch = 4 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface4_SetSurfaceDesc(surface2, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + /* Does not crash now after setting user memory for the level. */ + hr = IDirectDrawSurface4_Lock(surface2, NULL, &ddsd, DDLOCK_WAIT, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(ddsd.lpSurface == data, "Got unexpected lpSurface %p.\n", ddsd.lpSurface); + IDirectDrawSurface4_Unlock(surface2, NULL); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 16; + ddsd.dwHeight = 16; + U1(ddsd).lPitch = 16 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface4_SetSurfaceDesc(surface2, &ddsd, 0); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface4_Release(surface2); + IDirectDrawSurface4_Release(surface); + } + + /* Test surface created with DDSD_LPSURFACE. */ + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_LPSURFACE | DDSD_PITCH; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + ddsd.lpSurface = data; + U1(ddsd).lPitch = 8 * 4; + ddsd.ddsCaps.dwCaps = DDSCAPS_SYSTEMMEMORY | DDSCAPS_OFFSCREENPLAIN; + hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DDERR_INVALIDCAPS, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + /* Cannot reset lpSurface. */ + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DDERR_INVALIDPARAMS, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_LPSURFACE | DDSD_PITCH; + ddsd.dwWidth = 4; + ddsd.dwHeight = 4; + ddsd.lpSurface = data; + U1(ddsd).lPitch = 8 * 4; + /* Can change the parameters of surface created with DDSD_LPSURFACE. */ + hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface4_Release(surface); + /* SetSurfaceDesc needs systemmemory surfaces. * * As a sidenote, fourcc surfaces aren't allowed in sysmem, thus testing DDSD_LINEARSIZE is moot. */ @@ -7283,7 +7425,7 @@ static void test_set_surface_desc(void) } hr = IDirectDraw4_CreateSurface(ddraw, &ddsd, &surface, NULL); - ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, "Failed to create surface, hr %#x.\n", hr); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Got unexpected hr %#x.\n", hr); if (FAILED(hr)) { skip("Cannot create a %s surface, skipping vidmem SetSurfaceDesc test.\n", @@ -7297,7 +7439,7 @@ static void test_set_surface_desc(void) hr = IDirectDrawSurface4_SetSurfaceDesc(surface, &ddsd, 0); if (invalid_caps_tests[i].supported) { - ok(SUCCEEDED(hr), "Failed to set surface desc, hr %#x.\n", hr); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); } else {
1
0
0
0
Paul Gofman : ddraw/tests: Add more tests for _SetSurfaceDesc with mipmaps.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: fde4cca30b4aec91cc2e2bc6a22983640878fa51 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=fde4cca30b4aec91cc2e2bc6…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 17 01:54:27 2020 +0300 ddraw/tests: Add more tests for _SetSurfaceDesc with mipmaps. Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/ddraw/tests/ddraw7.c | 87 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index c85f020111..15f552f88e 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -7147,6 +7147,93 @@ static void test_set_surface_desc(void) * parameters. */ hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_LPSURFACE; + ddsd.lpSurface = data; + hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DDERR_INVALIDSURFACETYPE, "Got unexpected hr %#x.\n", hr); + IDirectDrawSurface7_Release(surface); + } + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U2(ddsd).dwMipMapCount = 3; + ddsd.lpSurface = data; + ddsd.ddsCaps.dwCaps = DDSCAPS_TEXTURE | DDSCAPS_SYSTEMMEMORY | DDSCAPS_COMPLEX | DDSCAPS_MIPMAP; + + hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); + ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW || hr == E_NOINTERFACE, "Got unexpected hr %#x.\n", hr); + + if (hr == DD_OK) + { + static DDSCAPS2 caps = {DDSCAPS_TEXTURE, 0, 0, {0}}; + void *surface2_system_mem; + IDirectDrawSurface7 *surface2; + + hr = IDirectDrawSurface7_GetAttachedSurface(surface, &caps, &surface2); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + reset_ddsd(&ddsd); + hr = IDirectDrawSurface7_GetSurfaceDesc(surface2, &ddsd); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(ddsd.dwWidth == 4, "Got unexpected dwWidth %u.\n", ddsd.dwWidth); + + hr = IDirectDrawSurface7_Lock(surface2, NULL, &ddsd, 0, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + surface2_system_mem = ddsd.lpSurface; + IDirectDrawSurface7_Unlock(surface2, NULL); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 16; + ddsd.dwHeight = 16; + U1(ddsd).lPitch = 16 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 8; + ddsd.dwHeight = 8; + U1(ddsd).lPitch = 8 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface7_SetSurfaceDesc(surface, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + hr = IDirectDrawSurface7_Lock(surface2, NULL, &ddsd, 0, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(ddsd.lpSurface == surface2_system_mem, "Got unexpected lpSurface %p.\n", ddsd.lpSurface); + IDirectDrawSurface7_Unlock(surface2, NULL); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 4; + ddsd.dwHeight = 4; + U1(ddsd).lPitch = 4 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface7_SetSurfaceDesc(surface2, &ddsd, 0); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + reset_ddsd(&ddsd); + hr = IDirectDrawSurface7_Lock(surface2, NULL, &ddsd, 0, NULL); + ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + ok(ddsd.lpSurface == data, "Got unexpected lpSurface %p.\n", ddsd.lpSurface); + IDirectDrawSurface7_Unlock(surface2, NULL); + + reset_ddsd(&ddsd); + ddsd.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_PITCH | DDSD_LPSURFACE; + ddsd.dwWidth = 16; + ddsd.dwHeight = 16; + U1(ddsd).lPitch = 16 * 4; + ddsd.lpSurface = data; + hr = IDirectDrawSurface7_SetSurfaceDesc(surface2, &ddsd, 0); + todo_wine ok(hr == DD_OK, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface7_Release(surface2); IDirectDrawSurface7_Release(surface); }
1
0
0
0
Paul Gofman : wined3d: Set user memory separately for texture sub resources.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: cfeefc6b94c6517d169e055eb291188cb42c37b5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=cfeefc6b94c6517d169e055e…
Author: Paul Gofman <pgofman(a)codeweavers.com> Date: Wed Jun 17 01:54:26 2020 +0300 wined3d: Set user memory separately for texture sub resources. Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=43232
Signed-off-by: Paul Gofman <pgofman(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/device.c | 4 +-- dlls/ddraw/surface.c | 80 ++++++++++++++++++++++++------------------ dlls/wined3d/swapchain.c | 4 +-- dlls/wined3d/texture.c | 77 +++++++++++++++++++++++++--------------- dlls/wined3d/wined3d.spec | 2 +- dlls/wined3d/wined3d_private.h | 3 +- include/wine/wined3d.h | 2 +- 7 files changed, 103 insertions(+), 69 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=cfeefc6b94c6517d169e…
1
0
0
0
Nikolay Sivov : d2d1: Implement D2D1CreateDevice().
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: f7f800606465727bc4e5f62bda3c4e89b4723b0b URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f7f800606465727bc4e5f62b…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Wed Jun 17 21:02:29 2020 +0430 d2d1: Implement D2D1CreateDevice(). Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d2d1/d2d1.spec | 2 +- dlls/d2d1/d2d1_private.h | 1 + dlls/d2d1/factory.c | 32 ++++++++++++++++++++++++++++++++ dlls/d2d1/tests/d2d1.c | 19 +++++++++++++++++++ include/d2d1_1.idl | 17 +++++++++++++++++ 5 files changed, 70 insertions(+), 1 deletion(-) diff --git a/dlls/d2d1/d2d1.spec b/dlls/d2d1/d2d1.spec index fff6f1c9c8..0ebcd0af55 100644 --- a/dlls/d2d1/d2d1.spec +++ b/dlls/d2d1/d2d1.spec @@ -4,7 +4,7 @@ @ stdcall D2D1IsMatrixInvertible(ptr) @ stdcall D2D1InvertMatrix(ptr) @ stub D2D1ConvertColorSpace -@ stub D2D1CreateDevice +@ stdcall D2D1CreateDevice(ptr ptr ptr) @ stub D2D1CreateDeviceContext @ stub D2D1SinCos @ stub D2D1Tan diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 4eb7e33142..4546d5c1e3 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -27,6 +27,7 @@ #include <math.h> #define COBJMACROS #include "d2d1_2.h" +#include "d3d11.h" #ifdef D2D1_INIT_GUID #include "initguid.h" #endif diff --git a/dlls/d2d1/factory.c b/dlls/d2d1/factory.c index 80334d82d0..2f50836bbc 100644 --- a/dlls/d2d1/factory.c +++ b/dlls/d2d1/factory.c @@ -681,6 +681,38 @@ BOOL WINAPI D2D1InvertMatrix(D2D1_MATRIX_3X2_F *matrix) return d2d_matrix_invert(matrix, &m); } +HRESULT WINAPI D2D1CreateDevice(IDXGIDevice *dxgi_device, + const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device) +{ + D2D1_CREATION_PROPERTIES default_properties = {0}; + D2D1_FACTORY_OPTIONS factory_options; + ID3D11Device *d3d_device; + ID2D1Factory1 *factory; + HRESULT hr; + + TRACE("dxgi_device %p, properties %p, device %p.\n", dxgi_device, properties, device); + + if (!properties) + { + if (SUCCEEDED(IDXGIDevice_QueryInterface(dxgi_device, &IID_ID3D11Device, (void **)&d3d_device))) + { + if (!(ID3D11Device_GetCreationFlags(d3d_device) & D3D11_CREATE_DEVICE_SINGLETHREADED)) + default_properties.threadingMode = D2D1_THREADING_MODE_MULTI_THREADED; + ID3D11Device_Release(d3d_device); + } + properties = &default_properties; + } + + factory_options.debugLevel = properties->debugLevel; + if (FAILED(hr = D2D1CreateFactory(properties->threadingMode, + &IID_ID2D1Factory1, &factory_options, (void **)&factory))) + return hr; + + hr = ID2D1Factory1_CreateDevice(factory, dxgi_device, device); + ID2D1Factory1_Release(factory); + return hr; +} + static BOOL get_config_key_dword(HKEY default_key, HKEY application_key, const char *name, DWORD *value) { DWORD type, data, size; diff --git a/dlls/d2d1/tests/d2d1.c b/dlls/d2d1/tests/d2d1.c index 87c87324f3..f52a34514e 100644 --- a/dlls/d2d1/tests/d2d1.c +++ b/dlls/d2d1/tests/d2d1.c @@ -28,6 +28,9 @@ #include "wincodec.h" #include "wine/heap.h" +static HRESULT (WINAPI *pD2D1CreateDevice)(IDXGIDevice *dxgi_device, + const D2D1_CREATION_PROPERTIES *properties, ID2D1Device **device); + static BOOL use_mt = TRUE; static struct test_entry @@ -7911,6 +7914,7 @@ static void test_bezier_intersect(void) static void test_create_device(void) { + D2D1_CREATION_PROPERTIES properties = {0}; ID3D10Device1 *d3d_device; IDXGIDevice *dxgi_device; ID2D1Factory1 *factory; @@ -7943,6 +7947,19 @@ static void test_create_device(void) ID2D1Factory_Release(factory2); ID2D1Device_Release(device); + if (pD2D1CreateDevice) + { + hr = pD2D1CreateDevice(dxgi_device, NULL, &device); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ID2D1Device_Release(device); + + hr = pD2D1CreateDevice(dxgi_device, &properties, &device); + ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); + ID2D1Device_Release(device); + } + else + win_skip("D2D1CreateDevice() is unavailable.\n"); + IDXGIDevice_Release(dxgi_device); ID3D10Device1_Release(d3d_device); @@ -9416,6 +9433,8 @@ START_TEST(d2d1) unsigned int argc, i; char **argv; + pD2D1CreateDevice = (void *)GetProcAddress(GetModuleHandleA("d2d1.dll"), "D2D1CreateDevice"); + use_mt = !getenv("WINETEST_NO_MT_D3D"); argc = winetest_get_mainargs(&argv); diff --git a/include/d2d1_1.idl b/include/d2d1_1.idl index 4a644ffd4c..ddb7669c24 100644 --- a/include/d2d1_1.idl +++ b/include/d2d1_1.idl @@ -187,6 +187,20 @@ typedef enum D2D1_PROPERTY_TYPE D2D1_PROPERTY_TYPE_FORCE_DWORD = 0xffffffff, } D2D1_PROPERTY_TYPE; +typedef enum D2D1_THREADING_MODE +{ + D2D1_THREADING_MODE_SINGLE_THREADED = D2D1_FACTORY_TYPE_SINGLE_THREADED, + D2D1_THREADING_MODE_MULTI_THREADED = D2D1_FACTORY_TYPE_MULTI_THREADED, + D2D1_THREADING_MODE_FORCE_DWORD = 0xffffffff, +} D2D1_THREADING_MODE; + +typedef struct D2D1_CREATION_PROPERTIES +{ + D2D1_THREADING_MODE threadingMode; + D2D1_DEBUG_LEVEL debugLevel; + D2D1_DEVICE_CONTEXT_OPTIONS options; +} D2D1_CREATION_PROPERTIES; + typedef struct D2D1_STROKE_STYLE_PROPERTIES1 { D2D1_CAP_STYLE startCap; @@ -777,3 +791,6 @@ interface ID2D1Factory1 : ID2D1Factory [out] ID2D1Properties **props ); } + +[local] HRESULT __stdcall D2D1CreateDevice(IDXGIDevice *dxgi_device, + const D2D1_CREATION_PROPERTIES *creation_properties, ID2D1Device **device);
1
0
0
0
Matteo Bruni : d3dcompiler: Check shader for NULL.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: 7d92b1abbd2acc4461a913682188f575b70e5625 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=7d92b1abbd2acc4461a91368…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Wed Jun 17 17:27:26 2020 +0200 d3dcompiler: Check shader for NULL. Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/compiler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/d3dcompiler_43/compiler.c b/dlls/d3dcompiler_43/compiler.c index 78fb0c46cc..c400b83d8d 100644 --- a/dlls/d3dcompiler_43/compiler.c +++ b/dlls/d3dcompiler_43/compiler.c @@ -805,7 +805,7 @@ static HRESULT compile_shader(const char *preproc_shader, const char *target, co if (FAILED(blob_hr = D3DCreateBlob(size, &buffer))) { HeapFree(GetProcessHeap(), 0, messages); - if (*shader) + if (shader && *shader) { ID3D10Blob_Release(*shader); *shader = NULL;
1
0
0
0
Ziqing Hui : d3dx10/tests: Add tests for D3DX10GetImageInfoFromMemory().
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: 749ef9b218da4823697289d5990d9c7c60706db1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=749ef9b218da4823697289d5…
Author: Ziqing Hui <zhui(a)codeweavers.com> Date: Wed Jun 17 17:27:31 2020 +0200 d3dx10/tests: Add tests for D3DX10GetImageInfoFromMemory(). Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx10_43/tests/d3dx10.c | 167 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 167 insertions(+) diff --git a/dlls/d3dx10_43/tests/d3dx10.c b/dlls/d3dx10_43/tests/d3dx10.c index cd61d766e8..12ec0f4df7 100644 --- a/dlls/d3dx10_43/tests/d3dx10.c +++ b/dlls/d3dx10_43/tests/d3dx10.c @@ -22,6 +22,117 @@ #include "d3dx10.h" #include "wine/test.h" + +/* 1x1 8bpp bmp image */ +static const BYTE test_bmp_8bpp[] = +{ + 0x42, 0x4d, 0x42, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x02, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf1, 0xf2, 0xf3, 0x80, 0xf4, 0xf5, 0xf6, 0x81, 0x00, 0x00, + 0x00, 0x00 +}; + +/* 2x2 32bpp XRGB bmp image */ +static const BYTE test_bmp_32bpp_xrgb[] = +{ + 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2, + 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x00 +}; + +/* 2x2 32bpp ARGB bmp image */ +static const BYTE test_bmp_32bpp_argb[] = +{ + 0x42, 0x4d, 0x46, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x00, 0x28, 0x00, + 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x12, 0x0b, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa0, 0xb0, 0xc0, 0x00, 0xa1, 0xb1, 0xc1, 0x00, 0xa2, 0xb2, + 0xc2, 0x00, 0xa3, 0xb3, 0xc3, 0x01 +}; + +/* png image */ +static const BYTE test_png_grayscale[] = +{ + 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52, + 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x08, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x7e, 0x9b, + 0x55, 0x00, 0x00, 0x00, 0x0a, 0x49, 0x44, 0x41, 0x54, 0x08, 0xd7, 0x63, 0xf8, 0x0f, 0x00, 0x01, + 0x01, 0x01, 0x00, 0x1b, 0xb6, 0xee, 0x56, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44, 0xae, + 0x42, 0x60, 0x82 +}; + +/* 4x2 DXT5 dds image */ +static const BYTE test_dds_dxt5[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x02, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xef, 0x87, 0x0f, 0x78, 0x05, 0x05, 0x50, 0x50 +}; + +/* 4x4 DXT1 cube map */ +static const BYTE test_dds_cube[] = +{ + 0x44, 0x44, 0x53, 0x20, 0x7c, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0a, 0x00, 0x04, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, + 0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x31, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00, + 0x00, 0xfe, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, + 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, + 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, + 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, + 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00, 0xf5, 0xa7, 0x08, 0x69, 0x74, 0xc0, 0xbf, 0xd7, + 0x32, 0x96, 0x0b, 0x7b, 0xcc, 0x55, 0xcc, 0x55, 0x0e, 0x84, 0x0e, 0x84, 0x00, 0x00, 0x00, 0x00 +}; + +static const struct test_image +{ + const BYTE *data; + unsigned int size; + D3DX10_IMAGE_INFO expected; +} +test_image[] = +{ + { + test_bmp_8bpp, sizeof(test_bmp_8bpp), + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + }, + { + test_bmp_32bpp_xrgb, sizeof(test_bmp_32bpp_xrgb), + {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + }, + { + test_bmp_32bpp_argb, sizeof(test_bmp_32bpp_argb), + {2, 2, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_BMP} + }, + { + test_png_grayscale, sizeof(test_png_grayscale), + {1, 1, 1, 1, 1, 0, DXGI_FORMAT_R8G8B8A8_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_PNG} + }, + { + test_dds_dxt5, sizeof(test_dds_dxt5), + {4, 2, 1, 1, 1, 0, DXGI_FORMAT_BC3_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + }, + { + test_dds_cube, sizeof(test_dds_cube), + {4, 4, 1, 6, 3, 0x4, DXGI_FORMAT_BC1_UNORM, D3D10_RESOURCE_DIMENSION_TEXTURE2D, D3DX10_IFF_DDS} + }, +}; + static BOOL compare_float(float f, float g, unsigned int ulps) { int x = *(int *)&f; @@ -786,10 +897,66 @@ static void test_D3DX10CreateAsyncResourceLoader(void) ok(hr == D3DX10_ERR_INVALID_DATA, "Got unexpected hr %#x.\n", hr); } +static void test_get_image_info(void) +{ + D3DX10_IMAGE_INFO image_info; + unsigned int i; + DWORD dword; + HRESULT hr; + + todo_wine { + hr = D3DX10GetImageInfoFromMemory(test_image[0].data, 0, NULL, &image_info, NULL); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + hr = D3DX10GetImageInfoFromMemory(NULL, test_image[0].size, NULL, &image_info, NULL); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + hr = D3DX10GetImageInfoFromMemory(&dword, sizeof(dword), NULL, &image_info, NULL); + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + } + + for (i = 0; i < ARRAY_SIZE(test_image); ++i) + { + hr = D3DX10GetImageInfoFromMemory(test_image[i].data, test_image[i].size, NULL, &image_info, NULL); + todo_wine ok(hr == S_OK, "Test %u: Got unexpected hr %#x.\n", i, hr); + if (hr != S_OK) + continue; + + todo_wine { + ok(image_info.Width == test_image[i].expected.Width, + "Test %u: Got unexpected Width %u, expected %u.\n", + i, image_info.Width, test_image[i].expected.Width); + ok(image_info.Height == test_image[i].expected.Height, + "Test %u: Got unexpected Height %u, expected %u.\n", + i, image_info.Height, test_image[i].expected.Height); + ok(image_info.Depth == test_image[i].expected.Depth, + "Test %u: Got unexpected Depth %u, expected %u.\n", + i, image_info.Depth, test_image[i].expected.Depth); + ok(image_info.ArraySize == test_image[i].expected.ArraySize, + "Test %u: Got unexpected ArraySize %u, expected %u.\n", + i, image_info.ArraySize, test_image[i].expected.ArraySize); + ok(image_info.MipLevels == test_image[i].expected.MipLevels, + "Test %u: Got unexpected MipLevels %u, expected %u.\n", + i, image_info.MipLevels, test_image[i].expected.MipLevels); + ok(image_info.MiscFlags == test_image[i].expected.MiscFlags, + "Test %u: Got unexpected MiscFlags %#x, expected %#x.\n", + i, image_info.MiscFlags, test_image[i].expected.MiscFlags); + ok(image_info.Format == test_image[i].expected.Format, + "Test %u: Got unexpected Format %#x, expected %#x.\n", + i, image_info.Format, test_image[i].expected.Format); + ok(image_info.ResourceDimension == test_image[i].expected.ResourceDimension, + "Test %u: Got unexpected ResourceDimension %u, expected %u.\n", + i, image_info.ResourceDimension, test_image[i].expected.ResourceDimension); + ok(image_info.ImageFileFormat == test_image[i].expected.ImageFileFormat, + "Test %u: Got unexpected ImageFileFormat %u, expected %u.\n", + i, image_info.ImageFileFormat, test_image[i].expected.ImageFileFormat); + } + } +} + START_TEST(d3dx10) { test_D3DX10UnsetAllDeviceObjects(); test_D3DX10CreateAsyncMemoryLoader(); test_D3DX10CreateAsyncFileLoader(); test_D3DX10CreateAsyncResourceLoader(); + test_get_image_info(); }
1
0
0
0
Gijs Vermeulen : d3dx9: Implement ID3DXSkinInfo_Clone().
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: 35a4093eff75e5bf7fee0dc8d2a708d960b03768 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=35a4093eff75e5bf7fee0dc8…
Author: Gijs Vermeulen <gijsvrm(a)gmail.com> Date: Wed Jun 17 17:27:32 2020 +0200 d3dx9: Implement ID3DXSkinInfo_Clone(). Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=48779
Signed-off-by: Gijs Vermeulen <gijsvrm(a)gmail.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dx9_36/skin.c | 28 ++++++++++++++++++-- dlls/d3dx9_36/tests/mesh.c | 64 ++++++++++++++++++++++++++++++++++++++++------ 2 files changed, 82 insertions(+), 10 deletions(-) diff --git a/dlls/d3dx9_36/skin.c b/dlls/d3dx9_36/skin.c index 2c10260e2a..ffc89f0bad 100644 --- a/dlls/d3dx9_36/skin.c +++ b/dlls/d3dx9_36/skin.c @@ -298,9 +298,33 @@ static D3DXMATRIX * WINAPI d3dx9_skin_info_GetBoneOffsetMatrix(ID3DXSkinInfo *if static HRESULT WINAPI d3dx9_skin_info_Clone(ID3DXSkinInfo *iface, ID3DXSkinInfo **skin_info) { - FIXME("iface %p, skin_info %p stub!\n", iface, skin_info); + struct d3dx9_skin_info *skin = impl_from_ID3DXSkinInfo(iface); + unsigned int i; + HRESULT hr; - return E_NOTIMPL; + TRACE("iface %p, skin_info %p.\n", iface, skin_info); + + if (FAILED(hr = D3DXCreateSkinInfo(skin->num_vertices, skin->vertex_declaration, skin->num_bones, skin_info))) + return hr; + + for (i = 0; i < skin->num_bones; ++i) + { + struct bone *current_bone = &skin->bones[i]; + + if (current_bone->name && FAILED(hr = (*skin_info)->lpVtbl->SetBoneName(*skin_info, i, current_bone->name))) + break; + if (FAILED(hr = (*skin_info)->lpVtbl->SetBoneOffsetMatrix(*skin_info, i, ¤t_bone->transform))) + break; + if (current_bone->vertices && current_bone->weights + && FAILED(hr = (*skin_info)->lpVtbl->SetBoneInfluence(*skin_info, i, current_bone->num_influences, + current_bone->vertices, current_bone->weights))) + break; + } + + if (FAILED(hr)) + (*skin_info)->lpVtbl->Release(*skin_info); + + return hr; } static HRESULT WINAPI d3dx9_skin_info_Remap(ID3DXSkinInfo *iface, DWORD num_vertices, DWORD *vertex_remap) diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c index 81f902291d..c357200656 100644 --- a/dlls/d3dx9_36/tests/mesh.c +++ b/dlls/d3dx9_36/tests/mesh.c @@ -4966,14 +4966,20 @@ cleanup: static void test_create_skin_info(void) { - HRESULT hr; - ID3DXSkinInfo *skininfo = NULL; D3DVERTEXELEMENT9 empty_declaration[] = { D3DDECL_END() }; D3DVERTEXELEMENT9 declaration_out[MAX_FVF_DECL_SIZE]; const D3DVERTEXELEMENT9 declaration_with_nonzero_stream[] = { {1, 0, D3DDECLTYPE_FLOAT3, 0, D3DDECLUSAGE_POSITION, 0}, D3DDECL_END() }; + D3DVERTEXELEMENT9 declaration[MAX_FVF_DECL_SIZE]; + DWORD exp_vertices[2], vertices[2]; + float exp_weights[2], weights[2]; + const char *exp_string, *string; + ID3DXSkinInfo *skininfo = NULL; + DWORD exp_fvf, fvf; + unsigned int i; + HRESULT hr; hr = D3DXCreateSkinInfo(0, empty_declaration, 0, &skininfo); ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); @@ -4990,6 +4996,7 @@ static void test_create_skin_info(void) ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); if (skininfo) { + ID3DXSkinInfo *clone = NULL; DWORD dword_result; float flt_result; const char *string_result; @@ -5023,6 +5030,10 @@ static void test_create_skin_info(void) transform = skininfo->lpVtbl->GetBoneOffsetMatrix(skininfo, -1); ok(transform == NULL, "Expected NULL, got %p\n", transform); + hr = skininfo->lpVtbl->Clone(skininfo, &clone); + ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); + IUnknown_Release(clone); + { /* test [GS]etBoneOffsetMatrix */ hr = skininfo->lpVtbl->SetBoneOffsetMatrix(skininfo, 1, &identity_matrix); @@ -5066,12 +5077,7 @@ static void test_create_skin_info(void) { /* test [GS]etBoneInfluence */ - DWORD vertices[2]; - FLOAT weights[2]; - int i; DWORD num_influences; - DWORD exp_vertices[2]; - FLOAT exp_weights[2]; /* vertex and weight arrays untouched when num_influences is 0 */ vertices[0] = 0xdeadbeef; @@ -5139,14 +5145,17 @@ static void test_create_skin_info(void) ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); ok(vertices[0] == 0xdeadbeef, "expected vertex 0xdeadbeef, got %u\n", vertices[0]); ok(weights[0] == FLT_MAX, "expected weight %g, got %g\n", FLT_MAX, weights[0]); + + hr = skininfo->lpVtbl->SetBoneInfluence(skininfo, 0, num_influences, exp_vertices, exp_weights); + ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); } { /* test [GS]etFVF and [GS]etDeclaration */ D3DVERTEXELEMENT9 declaration_in[MAX_FVF_DECL_SIZE]; - DWORD fvf = D3DFVF_XYZ; DWORD got_fvf; + fvf = D3DFVF_XYZ; hr = skininfo->lpVtbl->SetDeclaration(skininfo, NULL); ok(hr == D3DERR_INVALIDCALL, "Expected D3DERR_INVALIDCALL, got %#x\n", hr); @@ -5182,6 +5191,45 @@ static void test_create_skin_info(void) ok(hr == D3D_OK, "Expected D3D_OK, got %#x\n", hr); compare_elements(declaration_out, declaration_in, __LINE__, 0); } + + /* Test Clone() */ + hr = skininfo->lpVtbl->Clone(skininfo, NULL); + ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); + + clone = NULL; + hr = skininfo->lpVtbl->Clone(skininfo, &clone); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = clone->lpVtbl->GetDeclaration(clone, declaration); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + compare_elements(declaration, declaration_out, __LINE__, 0); + + hr = D3DXFVFFromDeclarator(declaration_out, &exp_fvf); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + fvf = clone->lpVtbl->GetFVF(clone); + ok(fvf == exp_fvf, "Got unexpected fvf %#x.\n", fvf); + + exp_string = skininfo->lpVtbl->GetBoneName(skininfo, 0); + string = clone->lpVtbl->GetBoneName(clone, 0); + ok(!strcmp(string, exp_string), "Got unexpected bone 0 name %s.\n", debugstr_a(string)); + + transform = clone->lpVtbl->GetBoneOffsetMatrix(clone, 0); + check_matrix(transform, &identity_matrix); + + hr = skininfo->lpVtbl->GetBoneInfluence(skininfo, 0, exp_vertices, exp_weights); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = clone->lpVtbl->GetBoneInfluence(clone, 0, vertices, weights); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + for (i = 0; i < ARRAY_SIZE(vertices); ++i) + { + ok(vertices[i] == exp_vertices[i], "influence[%u]: got unexpected vertex %u, expected %u.\n", + i, vertices[i], exp_vertices[i]); + ok(((DWORD *)weights)[i] == ((DWORD *)exp_weights)[i], + "influence[%u]: got unexpected weight %.8e, expected %.8e.\n", i, weights[i], exp_weights[i]); + } + + IUnknown_Release(clone); } if (skininfo) IUnknown_Release(skininfo); skininfo = NULL;
1
0
0
0
Zebediah Figura : d3dcompiler: Factor out hlsl_ir_var allocation.
by Alexandre Julliard
17 Jun '20
17 Jun '20
Module: wine Branch: master Commit: a9e720e54fe555e0463a6aabfac15ea10d342cb5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a9e720e54fe555e0463a6aab…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Jun 11 16:44:20 2020 -0500 d3dcompiler: Factor out hlsl_ir_var allocation. Signed-off-by: Zebediah Figura <zfigura(a)codeweavers.com> Signed-off-by: Matteo Bruni <mbruni(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3dcompiler_43/hlsl.y | 58 +++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/dlls/d3dcompiler_43/hlsl.y b/dlls/d3dcompiler_43/hlsl.y index 28d4dd7f2c..393f8d52fb 100644 --- a/dlls/d3dcompiler_43/hlsl.y +++ b/dlls/d3dcompiler_43/hlsl.y @@ -508,8 +508,8 @@ static struct hlsl_ir_swizzle *get_swizzle(struct hlsl_ir_node *value, const cha return NULL; } -static struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type *type, - const struct source_location loc) +static struct hlsl_ir_var *new_var(const char *name, struct hlsl_type *type, const struct source_location loc, + const char *semantic, unsigned int modifiers, const struct reg_reservation *reg_reservation) { struct hlsl_ir_var *var; @@ -519,10 +519,22 @@ static struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type return NULL; } - var->name = strdup(name); + var->name = name; var->data_type = type; var->loc = loc; - list_add_tail(&hlsl_ctx.globals->vars, &var->scope_entry); + var->semantic = semantic; + var->modifiers = modifiers; + var->reg_reservation = reg_reservation; + return var; +} + +static struct hlsl_ir_var *new_synthetic_var(const char *name, struct hlsl_type *type, + const struct source_location loc) +{ + struct hlsl_ir_var *var = new_var(strdup(name), type, loc, NULL, 0, NULL); + + if (var) + list_add_tail(&hlsl_ctx.globals->vars, &var->scope_entry); return var; } @@ -785,23 +797,16 @@ static struct list *declare_vars(struct hlsl_type *basic_type, DWORD modifiers, LIST_FOR_EACH_ENTRY_SAFE(v, v_next, var_list, struct parse_variable_def, entry) { - var = d3dcompiler_alloc(sizeof(*var)); - if (!var) - { - ERR("Out of memory.\n"); - free_parse_variable_def(v); - continue; - } if (v->array_size) type = new_array_type(basic_type, v->array_size); else type = basic_type; - var->data_type = type; - var->loc = v->loc; - var->name = v->name; - var->modifiers = modifiers; - var->semantic = v->semantic; - var->reg_reservation = v->reg_reservation; + + if (!(var = new_var(v->name, type, v->loc, v->semantic, modifiers, v->reg_reservation))) + { + free_parse_variable_def(v); + continue; + } debug_dump_decl(type, modifiers, v->name, v->loc.line); if (hlsl_ctx.cur_scope == hlsl_ctx.globals) @@ -1081,29 +1086,20 @@ static BOOL add_typedef(DWORD modifiers, struct hlsl_type *orig_type, struct lis static BOOL add_func_parameter(struct list *list, struct parse_parameter *param, const struct source_location loc) { - struct hlsl_ir_var *decl = d3dcompiler_alloc(sizeof(*decl)); + struct hlsl_ir_var *var; if (param->type->type == HLSL_CLASS_MATRIX) assert(param->type->modifiers & HLSL_MODIFIERS_MAJORITY_MASK); - if (!decl) - { - ERR("Out of memory.\n"); + if (!(var = new_var(param->name, param->type, loc, param->semantic, param->modifiers, param->reg_reservation))) return FALSE; - } - decl->data_type = param->type; - decl->loc = loc; - decl->name = param->name; - decl->semantic = param->semantic; - decl->reg_reservation = param->reg_reservation; - decl->modifiers = param->modifiers; - if (!add_declaration(hlsl_ctx.cur_scope, decl, FALSE)) + if (!add_declaration(hlsl_ctx.cur_scope, var, FALSE)) { - free_declaration(decl); + free_declaration(var); return FALSE; } - list_add_tail(list, &decl->param_entry); + list_add_tail(list, &var->param_entry); return TRUE; }
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
...
95
Older →
Jump to page:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
Results per page:
10
25
50
100
200