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
November 2014
----- 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
394 discussions
Start a n
N
ew thread
Hans Leidekker : msi: Update properties after each transform that affects the property table.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: 98ae03ff4d1d8b1292301486b5ea30988de6fa51 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=98ae03ff4d1d8b1292301486b…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Nov 4 10:57:40 2014 +0100 msi: Update properties after each transform that affects the property table. --- dlls/msi/action.c | 3 --- dlls/msi/dialog.c | 1 - dlls/msi/msipriv.h | 1 + dlls/msi/package.c | 7 ++----- dlls/msi/table.c | 6 ++++++ 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index eb7ac62..524c4f7 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -7813,10 +7813,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, package->full_reinstall = 1; } - /* properties may have been added by a transform */ - msi_clone_properties( package->db ); msi_set_original_database_property( package->db, szPackagePath ); - msi_parse_command_line( package, szCommandLine, FALSE ); msi_adjust_privilege_properties( package ); msi_set_context( package ); diff --git a/dlls/msi/dialog.c b/dlls/msi/dialog.c index 6708f13..4e1052e 100644 --- a/dlls/msi/dialog.c +++ b/dlls/msi/dialog.c @@ -155,7 +155,6 @@ static const WCHAR szVolumeCostList[] = { 'V','o','l','u','m','e','C','o','s','t static const WCHAR szVolumeSelectCombo[] = { 'V','o','l','u','m','e','S','e','l','e','c','t','C','o','m','b','o',0 }; static const WCHAR szSelectionDescription[] = {'S','e','l','e','c','t','i','o','n','D','e','s','c','r','i','p','t','i','o','n',0}; static const WCHAR szSelectionPath[] = {'S','e','l','e','c','t','i','o','n','P','a','t','h',0}; -static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0}; static const WCHAR szHyperLink[] = {'H','y','p','e','r','L','i','n','k',0}; /* dialog sequencing */ diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index a66835e..fd7b116 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -1180,6 +1180,7 @@ static const WCHAR szName[] = {'N','a','m','e',0}; static const WCHAR szData[] = {'D','a','t','a',0}; static const WCHAR szLangResource[] = {'\\','V','a','r','F','i','l','e','I','n','f','o','\\','T','r','a','n','s','l','a','t','i','o','n',0}; static const WCHAR szInstallLocation[] = {'I','n','s','t','a','l','l','L','o','c','a','t','i','o','n',0}; +static const WCHAR szProperty[] = {'P','r','o','p','e','r','t','y',0}; /* memory allocation macro functions */ static void *msi_alloc( size_t len ) __WINE_ALLOC_SIZE(1); diff --git a/dlls/msi/package.c b/dlls/msi/package.c index c910d82..bf9c79c 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -1677,11 +1677,8 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) } index++; } - if (index) - { - msi_clone_properties( package->db ); - msi_adjust_privilege_properties( package ); - } + if (index) msi_adjust_privilege_properties( package ); + r = msi_set_original_database_property( package->db, szPackage ); if (r != ERROR_SUCCESS) { diff --git a/dlls/msi/table.c b/dlls/msi/table.c index 9ed9421..900f9ae 100644 --- a/dlls/msi/table.c +++ b/dlls/msi/table.c @@ -2716,6 +2716,7 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) string_table *strings; UINT ret = ERROR_FUNCTION_FAILED; UINT bytes_per_strref; + BOOL property_update = FALSE; TRACE("%p %p\n", db, stg ); @@ -2760,6 +2761,8 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) tables = transform; else if (!strcmpW( transform->name, szColumns ) ) columns = transform; + else if (!strcmpW( transform->name, szProperty )) + property_update = TRUE; TRACE("transform contains stream %s\n", debugstr_w(name)); @@ -2809,7 +2812,10 @@ UINT msi_table_apply_transform( MSIDATABASE *db, IStorage *stg ) } if ( ret == ERROR_SUCCESS ) + { append_storage_to_db( db, stg ); + if (property_update) msi_clone_properties( db ); + } end: if ( stgenum )
1
0
0
0
Hans Leidekker : msi: Pass a database pointer to msi_clone_properties instead of a package pointer.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: 35ce56ac859793fcecb223b357f414e405281b61 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=35ce56ac859793fcecb223b35…
Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Nov 4 10:57:13 2014 +0100 msi: Pass a database pointer to msi_clone_properties instead of a package pointer. --- dlls/msi/action.c | 2 +- dlls/msi/msipriv.h | 2 +- dlls/msi/package.c | 12 ++++++------ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/msi/action.c b/dlls/msi/action.c index 66c2858..eb7ac62 100644 --- a/dlls/msi/action.c +++ b/dlls/msi/action.c @@ -7814,7 +7814,7 @@ UINT MSI_InstallPackage( MSIPACKAGE *package, LPCWSTR szPackagePath, } /* properties may have been added by a transform */ - msi_clone_properties( package ); + msi_clone_properties( package->db ); msi_set_original_database_property( package->db, szPackagePath ); msi_parse_command_line( package, szCommandLine, FALSE ); diff --git a/dlls/msi/msipriv.h b/dlls/msi/msipriv.h index bf788ba..a66835e 100644 --- a/dlls/msi/msipriv.h +++ b/dlls/msi/msipriv.h @@ -864,7 +864,7 @@ extern UINT MSI_SetFeatureStateW(MSIPACKAGE*, LPCWSTR, INSTALLSTATE ) DECLSPEC_H extern UINT msi_download_file( LPCWSTR szUrl, LPWSTR filename ) DECLSPEC_HIDDEN; extern UINT msi_package_add_info(MSIPACKAGE *, DWORD, DWORD, LPCWSTR, LPWSTR) DECLSPEC_HIDDEN; extern UINT msi_package_add_media_disk(MSIPACKAGE *, DWORD, DWORD, DWORD, LPWSTR, LPWSTR) DECLSPEC_HIDDEN; -extern UINT msi_clone_properties(MSIPACKAGE *) DECLSPEC_HIDDEN; +extern UINT msi_clone_properties(MSIDATABASE *) DECLSPEC_HIDDEN; extern UINT msi_set_context(MSIPACKAGE *) DECLSPEC_HIDDEN; extern void msi_adjust_privilege_properties(MSIPACKAGE *) DECLSPEC_HIDDEN; extern UINT MSI_GetFeatureCost(MSIPACKAGE *, MSIFEATURE *, MSICOSTTREE, INSTALLSTATE, LPINT) DECLSPEC_HIDDEN; diff --git a/dlls/msi/package.c b/dlls/msi/package.c index 2805003..c910d82 100644 --- a/dlls/msi/package.c +++ b/dlls/msi/package.c @@ -386,7 +386,7 @@ static UINT create_temp_property_table(MSIPACKAGE *package) return rc; } -UINT msi_clone_properties(MSIPACKAGE *package) +UINT msi_clone_properties( MSIDATABASE *db ) { static const WCHAR query_select[] = { 'S','E','L','E','C','T',' ','*',' ','F','R','O','M',' ', @@ -403,7 +403,7 @@ UINT msi_clone_properties(MSIPACKAGE *package) MSIQUERY *view_select; UINT rc; - rc = MSI_DatabaseOpenViewW( package->db, query_select, &view_select ); + rc = MSI_DatabaseOpenViewW( db, query_select, &view_select ); if (rc != ERROR_SUCCESS) return rc; @@ -424,7 +424,7 @@ UINT msi_clone_properties(MSIPACKAGE *package) if (rc != ERROR_SUCCESS) break; - rc = MSI_DatabaseOpenViewW( package->db, query_insert, &view_insert ); + rc = MSI_DatabaseOpenViewW( db, query_insert, &view_insert ); if (rc != ERROR_SUCCESS) { msiobj_release( &rec_select->hdr ); @@ -440,7 +440,7 @@ UINT msi_clone_properties(MSIPACKAGE *package) TRACE("insert failed, trying update\n"); - rc = MSI_DatabaseOpenViewW( package->db, query_update, &view_update ); + rc = MSI_DatabaseOpenViewW( db, query_update, &view_update ); if (rc != ERROR_SUCCESS) { WARN("open view failed %u\n", rc); @@ -1175,7 +1175,7 @@ MSIPACKAGE *MSI_CreatePackage( MSIDATABASE *db, LPCWSTR base_url ) package->BaseURL = strdupW( base_url ); create_temp_property_table( package ); - msi_clone_properties( package ); + msi_clone_properties( package->db ); msi_adjust_privilege_properties( package ); package->ProductCode = msi_dup_property( package->db, szProductCode ); @@ -1679,7 +1679,7 @@ UINT MSI_OpenPackageW(LPCWSTR szPackage, MSIPACKAGE **pPackage) } if (index) { - msi_clone_properties( package ); + msi_clone_properties( package->db ); msi_adjust_privilege_properties( package ); } r = msi_set_original_database_property( package->db, szPackage );
1
0
0
0
Stefan Dösinger : d3d8/tests: Check if the current display settings match the registry settings.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: dcf7d294ccc6ec073d97fc0f0b8776bc6902cbda URL:
http://source.winehq.org/git/wine.git/?a=commit;h=dcf7d294ccc6ec073d97fc0f0…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Nov 3 22:34:00 2014 +0100 d3d8/tests: Check if the current display settings match the registry settings. --- dlls/d3d8/tests/device.c | 91 ++++++++++++++++++++++++++++-------------------- 1 file changed, 53 insertions(+), 38 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=dcf7d294ccc6ec073d97f…
1
0
0
0
Stefan Dösinger : d3d9/tests: Check if the current display settings match the registry settings.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: 40c2fc215d272376d5eac0722048252c926ab997 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=40c2fc215d272376d5eac0722…
Author: Stefan Dösinger <stefan(a)codeweavers.com> Date: Mon Nov 3 22:33:58 2014 +0100 d3d9/tests: Check if the current display settings match the registry settings. --- dlls/d3d9/tests/d3d9ex.c | 52 +++++++++++++--------- dlls/d3d9/tests/device.c | 113 ++++++++++++++++++++++++++++------------------- 2 files changed, 98 insertions(+), 67 deletions(-) Diff:
http://source.winehq.org/git/wine.git/?a=commitdiff;h=40c2fc215d272376d5eac…
1
0
0
0
Matteo Bruni : d3d8/tests: Add an ATI1N entry to the test_volume_blocks test.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: e16016227f602a1bc1b1ed75a08d973e93f5f168 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=e16016227f602a1bc1b1ed75a…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 3 22:38:31 2014 +0100 d3d8/tests: Add an ATI1N entry to the test_volume_blocks test. --- dlls/d3d8/tests/device.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 9d498dc..a7b87a2 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -5255,25 +5255,28 @@ static void test_volume_blocks(void) unsigned int block_height; unsigned int block_depth; unsigned int block_size; - BOOL broken; + unsigned int broken; BOOL create_size_checked, core_fmt; } formats[] = { /* Scratch volumes enforce DXTn block locks, unlike their surface counterparts. * ATI2N and YUV blocks are not enforced on any tested card (r200, gtx 460). */ - {D3DFMT_DXT1, "D3DFMT_DXT1", 4, 4, 1, 8, FALSE, TRUE, TRUE }, - {D3DFMT_DXT2, "D3DFMT_DXT2", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, FALSE, TRUE, TRUE }, + {D3DFMT_DXT1, "D3DFMT_DXT1", 4, 4, 1, 8, 0, TRUE, TRUE }, + {D3DFMT_DXT2, "D3DFMT_DXT2", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, 0, TRUE, TRUE }, /* ATI2N has 2x2 blocks on all AMD cards and Geforce 7 cards, * which doesn't match the format spec. On newer Nvidia cards - * it has the correct 4x4 block size */ - {MAKEFOURCC('A','T','I','2'), "ATI2N", 4, 4, 1, 16, TRUE, FALSE, FALSE}, - {D3DFMT_YUY2, "D3DFMT_YUY2", 2, 1, 1, 4, TRUE, FALSE, TRUE }, - {D3DFMT_UYVY, "D3DFMT_UYVY", 2, 1, 1, 4, TRUE, FALSE, TRUE }, + * it has the correct 4x4 block size. + * ATI1N volume textures are only supported by AMD GPUs right + * now and locking offsets seem just wrong. */ + {MAKEFOURCC('A','T','I','1'), "ATI1N", 4, 4, 1, 8, 2, FALSE, FALSE}, + {MAKEFOURCC('A','T','I','2'), "ATI2N", 4, 4, 1, 16, 1, FALSE, FALSE}, + {D3DFMT_YUY2, "D3DFMT_YUY2", 2, 1, 1, 4, 1, FALSE, TRUE }, + {D3DFMT_UYVY, "D3DFMT_UYVY", 2, 1, 1, 4, 1, FALSE, TRUE }, }; static const struct { @@ -5421,10 +5424,14 @@ static void test_volume_blocks(void) ok(SUCCEEDED(hr), "Failed to unlock volume texture, hr %#x.\n", hr); base = locked_box.pBits; - if (formats[i].broken) + if (formats[i].broken == 1) { expected_row_pitch = bytes_per_pixel * 24; } + else if (formats[i].broken == 2) + { + expected_row_pitch = 24; + } else { expected_row_pitch = (24 /* tex width */ + formats[i].block_height - 1) / formats[i].block_width @@ -5459,12 +5466,18 @@ static void test_volume_blocks(void) ok(SUCCEEDED(hr), "Failed to lock volume texture, hr %#x, j %u.\n", hr, j); offset = (BYTE *)locked_box.pBits - base; - if (formats[i].broken) + if (formats[i].broken == 1) { expected_offset = box.Front * expected_slice_pitch + box.Top * expected_row_pitch + box.Left * bytes_per_pixel; } + else if (formats[i].broken == 2) + { + expected_offset = box.Front * expected_slice_pitch + + box.Top * expected_row_pitch + + box.Left; + } else { expected_offset = (box.Front / formats[i].block_depth) * expected_slice_pitch
1
0
0
0
Matteo Bruni : d3d9/tests: Add an ATI1N entry to the test_volume_blocks test.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: d690aaeeb6f25755dfed1a7afb042e4e9802c765 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=d690aaeeb6f25755dfed1a7af…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 3 22:38:30 2014 +0100 d3d9/tests: Add an ATI1N entry to the test_volume_blocks test. --- dlls/d3d9/tests/device.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index a523e14..009b474 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -7790,25 +7790,28 @@ static void test_volume_blocks(void) unsigned int block_height; unsigned int block_depth; unsigned int block_size; - BOOL broken; + unsigned int broken; BOOL create_size_checked, core_fmt; } formats[] = { /* Scratch volumes enforce DXTn block locks, unlike their surface counterparts. * ATI2N and YUV blocks are not enforced on any tested card (r200, gtx 460). */ - {D3DFMT_DXT1, "D3DFMT_DXT1", 4, 4, 1, 8, FALSE, TRUE, TRUE }, - {D3DFMT_DXT2, "D3DFMT_DXT2", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, FALSE, TRUE, TRUE }, - {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, FALSE, TRUE, TRUE }, + {D3DFMT_DXT1, "D3DFMT_DXT1", 4, 4, 1, 8, 0, TRUE, TRUE }, + {D3DFMT_DXT2, "D3DFMT_DXT2", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, 0, TRUE, TRUE }, + {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 1, 16, 0, TRUE, TRUE }, /* ATI2N has 2x2 blocks on all AMD cards and Geforce 7 cards, * which doesn't match the format spec. On newer Nvidia cards - * it has the correct 4x4 block size */ - {MAKEFOURCC('A','T','I','2'), "ATI2N", 4, 4, 1, 16, TRUE, FALSE, FALSE}, - {D3DFMT_YUY2, "D3DFMT_YUY2", 2, 1, 1, 4, TRUE, FALSE, TRUE }, - {D3DFMT_UYVY, "D3DFMT_UYVY", 2, 1, 1, 4, TRUE, FALSE, TRUE }, + * it has the correct 4x4 block size. + * ATI1N volume textures are only supported by AMD GPUs right + * now and locking offsets seem just wrong. */ + {MAKEFOURCC('A','T','I','1'), "ATI1N", 4, 4, 1, 8, 2, FALSE, FALSE}, + {MAKEFOURCC('A','T','I','2'), "ATI2N", 4, 4, 1, 16, 1, FALSE, FALSE}, + {D3DFMT_YUY2, "D3DFMT_YUY2", 2, 1, 1, 4, 1, FALSE, TRUE }, + {D3DFMT_UYVY, "D3DFMT_UYVY", 2, 1, 1, 4, 1, FALSE, TRUE }, }; static const struct { @@ -7956,10 +7959,14 @@ static void test_volume_blocks(void) ok(SUCCEEDED(hr), "Failed to unlock volume texture, hr %#x.\n", hr); base = locked_box.pBits; - if (formats[i].broken) + if (formats[i].broken == 1) { expected_row_pitch = bytes_per_pixel * 24; } + else if (formats[i].broken == 2) + { + expected_row_pitch = 24; + } else { expected_row_pitch = (24 /* tex width */ + formats[i].block_height - 1) / formats[i].block_width @@ -7994,12 +8001,18 @@ static void test_volume_blocks(void) ok(SUCCEEDED(hr), "Failed to lock volume texture, hr %#x, j %u.\n", hr, j); offset = (BYTE *)locked_box.pBits - base; - if (formats[i].broken) + if (formats[i].broken == 1) { expected_offset = box.Front * expected_slice_pitch + box.Top * expected_row_pitch + box.Left * bytes_per_pixel; } + else if (formats[i].broken == 2) + { + expected_offset = box.Front * expected_slice_pitch + + box.Top * expected_row_pitch + + box.Left; + } else { expected_offset = (box.Front / formats[i].block_depth) * expected_slice_pitch
1
0
0
0
Matteo Bruni : d3d8/tests: Add a test for ATI1N and ATI2N texture formats.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: 8f3477e1063addd6f5af4cc1e9b411ecbc1cd4e3 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=8f3477e1063addd6f5af4cc1e…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 3 22:38:29 2014 +0100 d3d8/tests: Add a test for ATI1N and ATI2N texture formats. --- dlls/d3d8/tests/device.c | 5 +- dlls/d3d8/tests/visual.c | 160 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 163 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/tests/device.c b/dlls/d3d8/tests/device.c index 5f8f52a..9d498dc 100644 --- a/dlls/d3d8/tests/device.c +++ b/dlls/d3d8/tests/device.c @@ -4367,9 +4367,10 @@ static void test_surface_blocks(void) {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, FALSE, TRUE, TRUE }, {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, FALSE, TRUE, TRUE }, {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, FALSE, TRUE, TRUE }, - /* ATI2N has 2x2 blocks on all AMD cards and Geforce 7 cards, + /* ATI1N and ATI2N have 2x2 blocks on all AMD cards and Geforce 7 cards, * which doesn't match the format spec. On newer Nvidia cards - * it has the correct 4x4 block size */ + * they have the correct 4x4 block size */ + {MAKEFOURCC('A','T','I','1'), "ATI1N", 4, 4, TRUE, FALSE, FALSE}, {MAKEFOURCC('A','T','I','2'), "ATI2N", 4, 4, TRUE, FALSE, FALSE}, /* Windows drivers generally enforce block-aligned locks for * YUY2 and UYVY. The notable exception is the AMD r500 driver diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index 163110c..9895a73 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -5058,6 +5058,165 @@ done: DestroyWindow(window); } +static void test_3dc_formats(void) +{ + static const char ati1n_data[] = + { + /* A 4x4 texture with the color component at 50%. */ + 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + static const char ati2n_data[] = + { + /* A 8x4 texture consisting of 2 4x4 blocks. The first block has 50% first color component, + * 0% second component. Second block is the opposite. */ + 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + static const struct + { + struct vec3 position; + struct vec2 texcoord; + } + quads[] = + { + {{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f}}, + {{-1.0f, 1.0f, 0.0f}, {0.0f, 1.0f}}, + {{ 0.0f, -1.0f, 1.0f}, {1.0f, 0.0f}}, + {{ 0.0f, 1.0f, 1.0f}, {1.0f, 1.0f}}, + + {{ 0.0f, -1.0f, 0.0f}, {0.0f, 0.0f}}, + {{ 0.0f, 1.0f, 0.0f}, {0.0f, 1.0f}}, + {{ 1.0f, -1.0f, 1.0f}, {1.0f, 0.0f}}, + {{ 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f}}, + }; + static const DWORD ati1n_fourcc = MAKEFOURCC('A','T','I','1'); + static const DWORD ati2n_fourcc = MAKEFOURCC('A','T','I','2'); + static const struct + { + struct vec2 position; + D3DCOLOR amd; + D3DCOLOR nvidia; + } + expected_colors[] = + { + {{ 80, 240}, 0x003f3f3f, 0x007f0000}, + {{240, 240}, 0x003f3f3f, 0x007f0000}, + {{400, 240}, 0x00007fff, 0x00007fff}, + {{560, 240}, 0x007f00ff, 0x007f00ff}, + }; + IDirect3D8 *d3d; + IDirect3DDevice8 *device; + IDirect3DTexture8 *ati1n_texture, *ati2n_texture; + D3DCAPS8 caps; + D3DLOCKED_RECT rect; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; + unsigned int i; + + window = CreateWindowA("static", "d3d8_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate8(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, ati1n_fourcc))) + { + skip("ATI1N textures are not supported, skipping test.\n"); + goto done; + } + if (FAILED(IDirect3D8_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, ati2n_fourcc))) + { + skip("ATI2N textures are not supported, skipping test.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + hr = IDirect3DDevice8_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (!(caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP)) + { + skip("D3DTA_TEMP not supported, skipping tests.\n"); + IDirect3DDevice8_Release(device); + goto done; + } + + hr = IDirect3DDevice8_CreateTexture(device, 4, 4, 1, 0, ati1n_fourcc, + D3DPOOL_MANAGED, &ati1n_texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = IDirect3DTexture8_LockRect(ati1n_texture, 0, &rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock texture, hr %#x.\n", hr); + memcpy(rect.pBits, ati1n_data, sizeof(ati1n_data)); + hr = IDirect3DTexture8_UnlockRect(ati1n_texture, 0); + ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr); + + hr = IDirect3DDevice8_CreateTexture(device, 8, 4, 1, 0, ati2n_fourcc, + D3DPOOL_MANAGED, &ati2n_texture); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = IDirect3DTexture8_LockRect(ati2n_texture, 0, &rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock texture, hr %#x.\n", hr); + memcpy(rect.pBits, ati2n_data, sizeof(ati2n_data)); + hr = IDirect3DTexture8_UnlockRect(ati2n_texture, 0); + ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr); + + hr = IDirect3DDevice8_SetVertexShader(device, D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE2(0)); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_BLENDTEXTUREALPHA); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TEMP); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTextureStageState(device, 0, D3DTSS_MAGFILTER, D3DTEXF_POINT); + ok(SUCCEEDED(hr), "Failed to set mag filter, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff00ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice8_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)ati1n_texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_SetTexture(device, 0, (IDirect3DBaseTexture8 *)ati2n_texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice8_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[4], sizeof(*quads)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice8_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + hr = IDirect3DDevice8_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + for (i = 0; i < 4; ++i) + { + color = getPixelColor(device, expected_colors[i].position.x, expected_colors[i].position.y); + ok (color_match(color, expected_colors[i].amd, 1) || color_match(color, expected_colors[i].nvidia, 1), + "Expected color 0x%08x or 0x%08x, got 0x%08x, case %u.\n", + expected_colors[i].amd, expected_colors[i].nvidia, color, i); + } + + IDirect3DTexture8_Release(ati2n_texture); + IDirect3DTexture8_Release(ati1n_texture); + refcount = IDirect3DDevice8_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + +done: + IDirect3D8_Release(d3d); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER8 identifier; @@ -5107,4 +5266,5 @@ START_TEST(visual) volume_dxt5_test(); volume_v16u16_test(); add_dirty_rect_test(); + test_3dc_formats(); }
1
0
0
0
Matteo Bruni : d3d9/tests: Add a test for ATI1N and ATI2N texture formats.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: da54670a9444bd7e0db817a193a6a48251aac912 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=da54670a9444bd7e0db817a19…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 3 22:38:28 2014 +0100 d3d9/tests: Add a test for ATI1N and ATI2N texture formats. --- dlls/d3d9/tests/device.c | 6 +- dlls/d3d9/tests/visual.c | 161 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 165 insertions(+), 2 deletions(-) diff --git a/dlls/d3d9/tests/device.c b/dlls/d3d9/tests/device.c index 2b7edd7..a523e14 100644 --- a/dlls/d3d9/tests/device.c +++ b/dlls/d3d9/tests/device.c @@ -6145,6 +6145,7 @@ static void test_lockrect_offset(void) {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, 16}, {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, 16}, {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, 16}, + {MAKEFOURCC('A','T','I','1'), "ATI1N", 1, 1, 1}, {MAKEFOURCC('A','T','I','2'), "ATI2N", 1, 1, 1}, }; unsigned int expected_offset, offset, i; @@ -6812,9 +6813,10 @@ static void test_surface_blocks(void) {D3DFMT_DXT3, "D3DFMT_DXT3", 4, 4, FALSE, TRUE, TRUE }, {D3DFMT_DXT4, "D3DFMT_DXT4", 4, 4, FALSE, TRUE, TRUE }, {D3DFMT_DXT5, "D3DFMT_DXT5", 4, 4, FALSE, TRUE, TRUE }, - /* ATI2N has 2x2 blocks on all AMD cards and Geforce 7 cards, + /* ATI1N and ATI2N have 2x2 blocks on all AMD cards and Geforce 7 cards, * which doesn't match the format spec. On newer Nvidia cards - * it has the correct 4x4 block size */ + * they have the correct 4x4 block size */ + {MAKEFOURCC('A','T','I','1'), "ATI1N", 4, 4, TRUE, FALSE, FALSE}, {MAKEFOURCC('A','T','I','2'), "ATI2N", 4, 4, TRUE, FALSE, FALSE}, {D3DFMT_YUY2, "D3DFMT_YUY2", 2, 1, FALSE, FALSE, TRUE }, {D3DFMT_UYVY, "D3DFMT_UYVY", 2, 1, FALSE, FALSE, TRUE }, diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 117c8eb..d1d7447 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -16660,6 +16660,166 @@ done: DestroyWindow(window); } +static void test_3dc_formats(void) +{ + static const char ati1n_data[] = + { + /* A 4x4 texture with the color component at 50%. */ + 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + static const char ati2n_data[] = + { + /* A 8x4 texture consisting of 2 4x4 blocks. The first block has 50% first color component, + * 0% second component. Second block is the opposite. */ + 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x7f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + static const struct + { + struct vec3 position; + struct vec2 texcoord; + } + quads[] = + { + {{-1.0f, -1.0f, 0.0f}, {0.0f, 0.0f}}, + {{-1.0f, 1.0f, 0.0f}, {0.0f, 1.0f}}, + {{ 0.0f, -1.0f, 1.0f}, {1.0f, 0.0f}}, + {{ 0.0f, 1.0f, 1.0f}, {1.0f, 1.0f}}, + + {{ 0.0f, -1.0f, 0.0f}, {0.0f, 0.0f}}, + {{ 0.0f, 1.0f, 0.0f}, {0.0f, 1.0f}}, + {{ 1.0f, -1.0f, 1.0f}, {1.0f, 0.0f}}, + {{ 1.0f, 1.0f, 1.0f}, {1.0f, 1.0f}}, + }; + static const DWORD ati1n_fourcc = MAKEFOURCC('A','T','I','1'); + static const DWORD ati2n_fourcc = MAKEFOURCC('A','T','I','2'); + static const struct + { + struct vec2 position; + D3DCOLOR amd; + D3DCOLOR nvidia; + } + expected_colors[] = + { + {{ 80, 240}, 0x003f3f3f, 0x007f0000}, + {{240, 240}, 0x003f3f3f, 0x007f0000}, + {{400, 240}, 0x00007fff, 0x00007fff}, + {{560, 240}, 0x007f00ff, 0x007f00ff}, + }; + IDirect3D9 *d3d; + IDirect3DDevice9 *device; + IDirect3DTexture9 *ati1n_texture, *ati2n_texture; + D3DCAPS9 caps; + D3DLOCKED_RECT rect; + D3DCOLOR color; + ULONG refcount; + HWND window; + HRESULT hr; + unsigned int i; + + window = CreateWindowA("static", "d3d9_test", WS_OVERLAPPEDWINDOW | WS_VISIBLE, + 0, 0, 640, 480, NULL, NULL, NULL, NULL); + d3d = Direct3DCreate9(D3D_SDK_VERSION); + ok(!!d3d, "Failed to create a D3D object.\n"); + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, ati1n_fourcc))) + { + skip("ATI1N textures are not supported, skipping test.\n"); + goto done; + } + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, 0, D3DRTYPE_TEXTURE, ati2n_fourcc))) + { + skip("ATI2N textures are not supported, skipping test.\n"); + goto done; + } + if (!(device = create_device(d3d, window, window, TRUE))) + { + skip("Failed to create a D3D device, skipping tests.\n"); + goto done; + } + hr = IDirect3DDevice9_GetDeviceCaps(device, &caps); + ok(SUCCEEDED(hr), "Failed to get device caps, hr %#x.\n", hr); + if (!(caps.PrimitiveMiscCaps & D3DPMISCCAPS_TSSARGTEMP)) + { + skip("D3DTA_TEMP not supported, skipping tests.\n"); + IDirect3DDevice9_Release(device); + goto done; + } + + hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, ati1n_fourcc, + D3DPOOL_MANAGED, &ati1n_texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = IDirect3DTexture9_LockRect(ati1n_texture, 0, &rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock texture, hr %#x.\n", hr); + memcpy(rect.pBits, ati1n_data, sizeof(ati1n_data)); + hr = IDirect3DTexture9_UnlockRect(ati1n_texture, 0); + ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr); + + hr = IDirect3DDevice9_CreateTexture(device, 8, 4, 1, 0, ati2n_fourcc, + D3DPOOL_MANAGED, &ati2n_texture, NULL); + ok(SUCCEEDED(hr), "Failed to create texture, hr %#x.\n", hr); + + hr = IDirect3DTexture9_LockRect(ati2n_texture, 0, &rect, NULL, 0); + ok(SUCCEEDED(hr), "Failed to lock texture, hr %#x.\n", hr); + memcpy(rect.pBits, ati2n_data, sizeof(ati2n_data)); + hr = IDirect3DTexture9_UnlockRect(ati2n_texture, 0); + ok(SUCCEEDED(hr), "Failed to unlock texture, hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE2(0)); + ok(SUCCEEDED(hr), "Failed to set FVF, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLOROP, D3DTOP_BLENDTEXTUREALPHA); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + /* The temporary register is initialized to 0. */ + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_COLORARG2, D3DTA_TEMP); + ok(SUCCEEDED(hr), "Failed to set color arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); + ok(SUCCEEDED(hr), "Failed to set alpha op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_ALPHAARG1, D3DTA_TEXTURE); + ok(SUCCEEDED(hr), "Failed to set alpha arg, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTextureStageState(device, 1, D3DTSS_COLOROP, D3DTOP_DISABLE); + ok(SUCCEEDED(hr), "Failed to set color op, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, D3DSAMP_MAGFILTER, D3DTEXF_POINT); + ok(SUCCEEDED(hr), "Failed to set mag filter, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0x00ff00ff, 1.0f, 0); + ok(SUCCEEDED(hr), "Failed to clear, hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(SUCCEEDED(hr), "Failed to begin scene, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)ati1n_texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[0], sizeof(*quads)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)ati2n_texture); + ok(SUCCEEDED(hr), "Failed to set texture, hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, &quads[4], sizeof(*quads)); + ok(SUCCEEDED(hr), "Failed to draw, hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(SUCCEEDED(hr), "Failed to end scene, hr %#x.\n", hr); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(SUCCEEDED(hr), "Failed to present, hr %#x.\n", hr); + for (i = 0; i < 4; ++i) + { + color = getPixelColor(device, expected_colors[i].position.x, expected_colors[i].position.y); + ok (color_match(color, expected_colors[i].amd, 1) || color_match(color, expected_colors[i].nvidia, 1), + "Expected color 0x%08x or 0x%08x, got 0x%08x, case %u.\n", + expected_colors[i].amd, expected_colors[i].nvidia, color, i); + } + + IDirect3DTexture9_Release(ati2n_texture); + IDirect3DTexture9_Release(ati1n_texture); + refcount = IDirect3DDevice9_Release(device); + ok(!refcount, "Device has %u references left.\n", refcount); + +done: + IDirect3D9_Release(d3d); + DestroyWindow(window); +} + START_TEST(visual) { D3DADAPTER_IDENTIFIER9 identifier; @@ -16767,4 +16927,5 @@ START_TEST(visual) resz_test(); stencil_cull_test(); test_per_stage_constant(); + test_3dc_formats(); }
1
0
0
0
Matteo Bruni : wined3d: Dirtify pixel shader on texture format change.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: 2dd237e200d3fd9ccdaf423c6c9ddaa71423c9e2 URL:
http://source.winehq.org/git/wine.git/?a=commit;h=2dd237e200d3fd9ccdaf423c6…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 3 22:38:27 2014 +0100 wined3d: Dirtify pixel shader on texture format change. --- dlls/wined3d/cs.c | 7 ++++++- dlls/wined3d/wined3d_private.h | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index bdd86c8..b8a32e5 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -636,10 +636,15 @@ static void wined3d_cs_exec_set_texture(struct wined3d_cs *cs, const void *data) if (op->texture) { + const struct wined3d_format *new_format = op->texture->resource.format; + const struct wined3d_format *old_format = prev ? prev->resource.format : NULL; + if (InterlockedIncrement(&op->texture->resource.bind_count) == 1) op->texture->sampler = op->stage; - if (!prev || op->texture->target != prev->target) + if (!prev || op->texture->target != prev->target + || !is_same_fixup(new_format->color_fixup, old_format->color_fixup) + || (new_format->flags & WINED3DFMT_FLAG_SHADOW) != (old_format->flags & WINED3DFMT_FLAG_SHADOW)) device_invalidate_state(cs->device, STATE_SHADER(WINED3D_SHADER_TYPE_PIXEL)); if (!prev && op->stage < d3d_info->limits.ffp_blend_stages) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 9cbd18d..0f302c4 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -145,6 +145,14 @@ static inline BOOL is_complex_fixup(struct color_fixup_desc fixup) return fixup.x_source == CHANNEL_SOURCE_COMPLEX0 || fixup.x_source == CHANNEL_SOURCE_COMPLEX1; } +static inline BOOL is_same_fixup(struct color_fixup_desc f1, struct color_fixup_desc f2) +{ + return f1.x_sign_fixup == f2.x_sign_fixup && f1.x_source == f2.x_source + && f1.y_sign_fixup == f2.y_sign_fixup && f1.y_source == f2.y_source + && f1.z_sign_fixup == f2.z_sign_fixup && f1.z_source == f2.z_source + && f1.w_sign_fixup == f2.w_sign_fixup && f1.w_source == f2.w_source; +} + static inline enum complex_fixup get_complex_fixup(struct color_fixup_desc fixup) { enum complex_fixup complex_fixup = 0;
1
0
0
0
Matteo Bruni : wined3d: Add ATI1N texture format support.
by Alexandre Julliard
04 Nov '14
04 Nov '14
Module: wine Branch: master Commit: ea85db2a3fd081ca9f84d8989f775357a250914a URL:
http://source.winehq.org/git/wine.git/?a=commit;h=ea85db2a3fd081ca9f84d8989…
Author: Matteo Bruni <mbruni(a)codeweavers.com> Date: Mon Nov 3 22:38:26 2014 +0100 wined3d: Add ATI1N texture format support. --- dlls/wined3d/utils.c | 13 +++++++++++++ include/wine/wined3d.h | 1 + 2 files changed, 14 insertions(+) diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index b9d60de..d3fb1d6 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -129,6 +129,7 @@ static const struct wined3d_format_channels formats[] = {WINED3DFMT_R32G32B32A32_UINT, 32, 32, 32, 32, 0, 32, 64, 96, 16, 0, 0}, {WINED3DFMT_R16G16B16A16_SNORM, 16, 16, 16, 16, 0, 16, 32, 48, 8, 0, 0}, /* Vendor-specific formats */ + {WINED3DFMT_ATI1N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_ATI2N, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0}, {WINED3DFMT_NVDB, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {WINED3DFMT_INST, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, @@ -175,6 +176,7 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_B4G4R4X4_UNORM, WINED3DFMT_FLAG_GETDC}, {WINED3DFMT_R8G8B8A8_UNORM, WINED3DFMT_FLAG_GETDC}, {WINED3DFMT_R8G8B8X8_UNORM, WINED3DFMT_FLAG_GETDC}, + {WINED3DFMT_ATI1N, WINED3DFMT_FLAG_BROKEN_PITCH}, {WINED3DFMT_ATI2N, WINED3DFMT_FLAG_BROKEN_PITCH}, {WINED3DFMT_R32_FLOAT, WINED3DFMT_FLAG_FLOAT}, {WINED3DFMT_R32G32_FLOAT, WINED3DFMT_FLAG_FLOAT}, @@ -203,6 +205,7 @@ static const struct wined3d_format_block_info format_block_info[] = {WINED3DFMT_DXT3, 4, 4, 16, TRUE}, {WINED3DFMT_DXT4, 4, 4, 16, TRUE}, {WINED3DFMT_DXT5, 4, 4, 16, TRUE}, + {WINED3DFMT_ATI1N, 4, 4, 8, FALSE}, {WINED3DFMT_ATI2N, 4, 4, 16, FALSE}, {WINED3DFMT_YUY2, 2, 1, 4, FALSE}, {WINED3DFMT_UYVY, 2, 1, 4, FALSE}, @@ -1184,6 +1187,11 @@ static const struct wined3d_format_texture_info format_texture_info[] = WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_DEPTH | WINED3DFMT_FLAG_STENCIL | WINED3DFMT_FLAG_SHADOW, ARB_DEPTH_BUFFER_FLOAT, convert_s8_uint_d24_float}, /* Vendor-specific formats */ + {WINED3DFMT_ATI1N, GL_COMPRESSED_RED_RGTC1, GL_COMPRESSED_RED_RGTC1, 0, + GL_RED, GL_UNSIGNED_BYTE, 0, + WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING + | WINED3DFMT_FLAG_COMPRESSED, + ARB_TEXTURE_COMPRESSION_RGTC, NULL}, {WINED3DFMT_ATI2N, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI, 0, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE, 0, WINED3DFMT_FLAG_TEXTURE | WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING | WINED3DFMT_FLAG_FILTERING @@ -2020,6 +2028,10 @@ static void apply_format_fixups(struct wined3d_adapter *adapter, struct wined3d_ if (gl_info->supported[ARB_TEXTURE_COMPRESSION_RGTC]) { + idx = getFmtIdx(WINED3DFMT_ATI1N); + gl_info->formats[idx].color_fixup = create_color_fixup_desc( + 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_X); + idx = getFmtIdx(WINED3DFMT_ATI2N); gl_info->formats[idx].color_fixup = create_color_fixup_desc( 0, CHANNEL_SOURCE_Y, 0, CHANNEL_SOURCE_X, 0, CHANNEL_SOURCE_ONE, 0, CHANNEL_SOURCE_ONE); @@ -2316,6 +2328,7 @@ const char *debug_d3dformat(enum wined3d_format_id format_id) FMT_TO_STR(WINED3DFMT_S8_UINT_D24_FLOAT); FMT_TO_STR(WINED3DFMT_VERTEXDATA); FMT_TO_STR(WINED3DFMT_R8G8_SNORM_Cx); + FMT_TO_STR(WINED3DFMT_ATI1N); FMT_TO_STR(WINED3DFMT_ATI2N); FMT_TO_STR(WINED3DFMT_NVDB); FMT_TO_STR(WINED3DFMT_NVHU); diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 9785277..8f563bb 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -241,6 +241,7 @@ enum wined3d_format_id WINED3DFMT_MULTI2_ARGB8 = WINEMAKEFOURCC('M','E','T','1'), WINED3DFMT_G8R8_G8B8 = WINEMAKEFOURCC('G','R','G','B'), WINED3DFMT_R8G8_B8G8 = WINEMAKEFOURCC('R','G','B','G'), + WINED3DFMT_ATI1N = WINEMAKEFOURCC('A','T','I','1'), WINED3DFMT_ATI2N = WINEMAKEFOURCC('A','T','I','2'), WINED3DFMT_INST = WINEMAKEFOURCC('I','N','S','T'), WINED3DFMT_NVDB = WINEMAKEFOURCC('N','V','D','B'),
1
0
0
0
← Newer
1
...
32
33
34
35
36
37
38
39
40
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
Results per page:
10
25
50
100
200