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
March 2019
----- 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
1097 discussions
Start a n
N
ew thread
Jacek Caban : mshtml: Use load_flags instead of is_doc_uri in nsChannel implementation.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: 2678126f95e4d5d1bb9803b701e205cf48d8ee65 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=2678126f95e4d5d1bb9803b7…
Author: Jacek Caban <jacek(a)codeweavers.com> Date: Fri Mar 8 13:46:52 2019 +0100 mshtml: Use load_flags instead of is_doc_uri in nsChannel implementation. Signed-off-by: Jacek Caban <jacek(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mshtml/nsio.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dlls/mshtml/nsio.c b/dlls/mshtml/nsio.c index d818889..ca63a98 100644 --- a/dlls/mshtml/nsio.c +++ b/dlls/mshtml/nsio.c @@ -806,7 +806,7 @@ static nsresult NSAPI nsChannel_GetContentType(nsIHttpChannel *iface, nsACString return S_OK; } - if(This->uri->is_doc_uri) { + if(This->load_flags & LOAD_DOCUMENT_URI) { WARN("Document channel with no MIME set. Assuming text/html\n"); nsACString_SetData(aContentType, "text/html"); return S_OK; @@ -1074,6 +1074,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen { nsChannel *This = impl_from_nsIHttpChannel(iface); HTMLOuterWindow *window = NULL; + BOOL is_document_channel; BOOL cancel = FALSE; nsresult nsres = NS_OK; @@ -1095,7 +1096,8 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen } } - if(This->uri->is_doc_uri) { + is_document_channel = !!(This->load_flags & LOAD_DOCUMENT_URI); + if(is_document_channel) { window = get_channel_window(This); if(window) set_uri_window(This->uri, window); @@ -1121,7 +1123,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen return NS_ERROR_UNEXPECTED; } - if(This->uri->is_doc_uri && window == window->doc_obj->basedoc.window) { + if(is_document_channel && window == window->doc_obj->basedoc.window) { if(This->uri->channel_bsc) { channelbsc_set_channel(This->uri->channel_bsc, This, aListener, aContext); @@ -1141,7 +1143,7 @@ static nsresult NSAPI nsChannel_AsyncOpen(nsIHttpChannel *iface, nsIStreamListen } if(!cancel) - nsres = async_open(This, window, This->uri->is_doc_uri, aListener, aContext); + nsres = async_open(This, window, is_document_channel, aListener, aContext); if(NS_SUCCEEDED(nsres) && This->load_group) { nsres = nsILoadGroup_AddRequest(This->load_group, (nsIRequest*)&This->nsIHttpChannel_iface,
1
0
0
0
Jactry Zeng : mfplat: Unlock section after finishing.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: a1e117b79e289a83374545fd399682afe7d20ae1 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=a1e117b79e289a83374545fd…
Author: Jactry Zeng <jzeng(a)codeweavers.com> Date: Fri Mar 8 09:57:46 2019 +0300 mfplat: Unlock section after finishing. Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com> Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index 164f8f7..f6eecb6 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -525,7 +525,7 @@ static HRESULT WINAPI sample_GetBufferCount(IMFSample *iface, DWORD *count) EnterCriticalSection(&sample->cs); *count = sample->buffer_count; - EnterCriticalSection(&sample->cs); + LeaveCriticalSection(&sample->cs); return S_OK; }
1
0
0
0
Nikolay Sivov : mfplat: Set sample flags.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: f91cadcd9461cab77d042b4a292586be0525e702 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f91cadcd9461cab77d042b4a…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 8 09:57:45 2019 +0300 mfplat: Set sample flags. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/buffer.c | 10 ++++++++-- dlls/mfplat/tests/mfplat.c | 6 ++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index fb4b014..164f8f7 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -475,9 +475,15 @@ static HRESULT WINAPI sample_GetSampleFlags(IMFSample *iface, DWORD *flags) static HRESULT WINAPI sample_SetSampleFlags(IMFSample *iface, DWORD flags) { - FIXME("%p, %#x.\n", iface, flags); + struct sample *sample = impl_from_IMFSample(iface); - return E_NOTIMPL; + TRACE("%p, %#x.\n", iface, flags); + + EnterCriticalSection(&sample->cs); + sample->flags = flags; + LeaveCriticalSection(&sample->cs); + + return S_OK; } static HRESULT WINAPI sample_GetSampleTime(IMFSample *iface, LONGLONG *sampletime) diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 2f4db9b..1bf7ebb 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -734,6 +734,12 @@ static void test_sample(void) ok(hr == S_OK, "Failed to get sample flags, hr %#x.\n", hr); ok(!flags, "Unexpected flags %#x.\n", flags); + hr = IMFSample_SetSampleFlags(sample, 0x123); + ok(hr == S_OK, "Failed to set sample flags, hr %#x.\n", hr); + hr = IMFSample_GetSampleFlags(sample, &flags); + ok(hr == S_OK, "Failed to get sample flags, hr %#x.\n", hr); + ok(flags == 0x123, "Unexpected flags %#x.\n", flags); + hr = IMFSample_GetSampleTime(sample, &time); todo_wine ok(hr == MF_E_NO_SAMPLE_TIMESTAMP, "Unexpected hr %#x.\n", hr);
1
0
0
0
Nikolay Sivov : mfplat: Forward CopyAllItems() for samples.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: f9bb5f4a572a9de453645a151608571ee3108fb7 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=f9bb5f4a572a9de453645a15…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 8 09:57:44 2019 +0300 mfplat: Forward CopyAllItems() for samples. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/buffer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/mfplat/buffer.c b/dlls/mfplat/buffer.c index 833ec04..fb4b014 100644 --- a/dlls/mfplat/buffer.c +++ b/dlls/mfplat/buffer.c @@ -456,9 +456,8 @@ static HRESULT WINAPI sample_GetItemByIndex(IMFSample *iface, UINT32 index, GUID static HRESULT WINAPI sample_CopyAllItems(IMFSample *iface, IMFAttributes *dest) { - FIXME("%p, %p.\n", iface, dest); - - return E_NOTIMPL; + struct sample *sample = impl_from_IMFSample(iface); + return IMFAttributes_CopyAllItems(&sample->attributes.IMFAttributes_iface, dest); } static HRESULT WINAPI sample_GetSampleFlags(IMFSample *iface, DWORD *flags)
1
0
0
0
Nikolay Sivov : mfplat: Forward CopyAllItems() for media type as well.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: 0b2db93910da952c9084a559366f3f1cfad3c173 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0b2db93910da952c9084a559…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 8 09:57:43 2019 +0300 mfplat: Forward CopyAllItems() for media type as well. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/mediatype.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 7470d40..974ab3a 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -302,9 +302,8 @@ static HRESULT WINAPI mediatype_GetItemByIndex(IMFMediaType *iface, UINT32 index static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes *dest) { - FIXME("%p, %p.\n", iface, dest); - - return E_NOTIMPL; + struct media_type *media_type = impl_from_IMFMediaType(iface); + return IMFAttributes_CopyAllItems(&media_type->attributes.IMFAttributes_iface, dest); } static HRESULT WINAPI mediatype_GetMajorType(IMFMediaType *iface, GUID *guid)
1
0
0
0
Nikolay Sivov : mfplat: Forward media type methods to attribute storage.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: b80ace81fc546369ae6ce3ae4e08b699a347e0c5 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=b80ace81fc546369ae6ce3ae…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 8 09:57:42 2019 +0300 mfplat: Forward media type methods to attribute storage. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/mfplat/mediatype.c | 20 +++++++++++++++----- include/mfapi.h | 15 ++++++++------- 2 files changed, 23 insertions(+), 12 deletions(-) diff --git a/dlls/mfplat/mediatype.c b/dlls/mfplat/mediatype.c index 7abbf31..7470d40 100644 --- a/dlls/mfplat/mediatype.c +++ b/dlls/mfplat/mediatype.c @@ -309,16 +309,26 @@ static HRESULT WINAPI mediatype_CopyAllItems(IMFMediaType *iface, IMFAttributes static HRESULT WINAPI mediatype_GetMajorType(IMFMediaType *iface, GUID *guid) { - FIXME("%p, %p.\n", iface, guid); - - return E_NOTIMPL; + struct media_type *media_type = impl_from_IMFMediaType(iface); + TRACE("%p, %p.\n", iface, guid); + return IMFAttributes_GetGUID(&media_type->attributes.IMFAttributes_iface, &MF_MT_MAJOR_TYPE, guid); } static HRESULT WINAPI mediatype_IsCompressedFormat(IMFMediaType *iface, BOOL *compressed) { - FIXME("%p, %p.\n", iface, compressed); + struct media_type *media_type = impl_from_IMFMediaType(iface); + UINT32 value; + HRESULT hr; - return E_NOTIMPL; + TRACE("%p, %p.\n", iface, compressed); + + hr = IMFAttributes_GetUINT32(&media_type->attributes.IMFAttributes_iface, &MF_MT_ALL_SAMPLES_INDEPENDENT, &value); + if (FAILED(hr)) + value = 0; + + *compressed = !value; + + return hr; } static HRESULT WINAPI mediatype_IsEqual(IMFMediaType *iface, IMFMediaType *type, DWORD *flags) diff --git a/include/mfapi.h b/include/mfapi.h index f8414b7..2ad9f25 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -80,13 +80,14 @@ typedef enum _EAllocationType #include <initguid.h> #endif -DEFINE_GUID(MF_MT_AVG_BITRATE, 0x20332624, 0xfb0d, 0x4d9e, 0xbd, 0x0d, 0xcb, 0xf6, 0x78, 0x6c, 0x10, 0x2e); -DEFINE_GUID(MF_MT_FRAME_RATE, 0xc459a2e8, 0x3d2c, 0x4e44, 0xb1, 0x32, 0xfe, 0xe5, 0x15, 0x6c, 0x7b, 0xb0); -DEFINE_GUID(MF_MT_FRAME_SIZE, 0x1652c33d, 0xd6b2, 0x4012, 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d); -DEFINE_GUID(MF_MT_INTERLACE_MODE, 0xe2724bb8, 0xe676, 0x4806, 0xb4, 0xb2, 0xa8, 0xd6, 0xef, 0xb4, 0x4c, 0xcd); -DEFINE_GUID(MF_MT_MAJOR_TYPE, 0x48eba18e, 0xf8c9, 0x4687, 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f); -DEFINE_GUID(MF_MT_PIXEL_ASPECT_RATIO, 0xc6376a1e, 0x8d0a, 0x4027, 0xbe, 0x45, 0x6d, 0x9a, 0x0a, 0xd3, 0x9b, 0xb6); -DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5); +DEFINE_GUID(MF_MT_AVG_BITRATE, 0x20332624, 0xfb0d, 0x4d9e, 0xbd, 0x0d, 0xcb, 0xf6, 0x78, 0x6c, 0x10, 0x2e); +DEFINE_GUID(MF_MT_FRAME_RATE, 0xc459a2e8, 0x3d2c, 0x4e44, 0xb1, 0x32, 0xfe, 0xe5, 0x15, 0x6c, 0x7b, 0xb0); +DEFINE_GUID(MF_MT_FRAME_SIZE, 0x1652c33d, 0xd6b2, 0x4012, 0xb8, 0x34, 0x72, 0x03, 0x08, 0x49, 0xa3, 0x7d); +DEFINE_GUID(MF_MT_INTERLACE_MODE, 0xe2724bb8, 0xe676, 0x4806, 0xb4, 0xb2, 0xa8, 0xd6, 0xef, 0xb4, 0x4c, 0xcd); +DEFINE_GUID(MF_MT_MAJOR_TYPE, 0x48eba18e, 0xf8c9, 0x4687, 0xbf, 0x11, 0x0a, 0x74, 0xc9, 0xf9, 0x6a, 0x8f); +DEFINE_GUID(MF_MT_PIXEL_ASPECT_RATIO, 0xc6376a1e, 0x8d0a, 0x4027, 0xbe, 0x45, 0x6d, 0x9a, 0x0a, 0xd3, 0x9b, 0xb6); +DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5); +DEFINE_GUID(MF_MT_ALL_SAMPLES_INDEPENDENT, 0xc9173739, 0x5e56, 0x461c, 0xb7, 0x13, 0x46, 0xfb, 0x99, 0x5c, 0xb9, 0x5f); DEFINE_GUID(MFT_CATEGORY_VIDEO_DECODER, 0xd6c02d4b, 0x6833, 0x45b4, 0x97, 0x1a, 0x05, 0xa4, 0xb0, 0x4b, 0xab, 0x91); DEFINE_GUID(MFT_CATEGORY_VIDEO_ENCODER, 0xf79eac7d, 0xe545, 0x4387, 0xbd, 0xee, 0xd6, 0x47, 0xd7, 0xbd, 0xe4, 0x2a);
1
0
0
0
Nikolay Sivov : include: Add major media types GUIDs for Media Foundation.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: 0a7cab5c1c0d7869abdf69d40626e79751b28241 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=0a7cab5c1c0d7869abdf69d4…
Author: Nikolay Sivov <nsivov(a)codeweavers.com> Date: Fri Mar 8 09:57:41 2019 +0300 include: Add major media types GUIDs for Media Foundation. Signed-off-by: Nikolay Sivov <nsivov(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- include/mfapi.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/include/mfapi.h b/include/mfapi.h index 0c51627..f8414b7 100644 --- a/include/mfapi.h +++ b/include/mfapi.h @@ -88,8 +88,6 @@ DEFINE_GUID(MF_MT_MAJOR_TYPE, 0x48eba18e, 0xf8c9, 0x4687, 0xbf, 0x11, 0 DEFINE_GUID(MF_MT_PIXEL_ASPECT_RATIO, 0xc6376a1e, 0x8d0a, 0x4027, 0xbe, 0x45, 0x6d, 0x9a, 0x0a, 0xd3, 0x9b, 0xb6); DEFINE_GUID(MF_MT_SUBTYPE, 0xf7e34c9a, 0x42e8, 0x4714, 0xb7, 0x4b, 0xcb, 0x29, 0xd7, 0x2c, 0x35, 0xe5); -DEFINE_GUID(MFMediaType_Video, 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); - DEFINE_GUID(MFT_CATEGORY_VIDEO_DECODER, 0xd6c02d4b, 0x6833, 0x45b4, 0x97, 0x1a, 0x05, 0xa4, 0xb0, 0x4b, 0xab, 0x91); DEFINE_GUID(MFT_CATEGORY_VIDEO_ENCODER, 0xf79eac7d, 0xe545, 0x4387, 0xbd, 0xee, 0xd6, 0x47, 0xd7, 0xbd, 0xe4, 0x2a); DEFINE_GUID(MFT_CATEGORY_VIDEO_EFFECT, 0x12e17c21, 0x532c, 0x4a6e, 0x8a, 0x1c, 0x40, 0x82, 0x5a, 0x73, 0x63, 0x97); @@ -101,6 +99,21 @@ DEFINE_GUID(MFT_CATEGORY_AUDIO_EFFECT, 0x11064c48, 0x3648, 0x4ed0, 0x93, 0x2e DEFINE_GUID(MFT_CATEGORY_VIDEO_PROCESSOR, 0x302ea3fc, 0xaa5f, 0x47f9, 0x9f, 0x7a, 0xc2, 0x18, 0x8b, 0xb1, 0x63, 0x02); DEFINE_GUID(MFT_CATEGORY_OTHER, 0x90175d57, 0xb7ea, 0x4901, 0xae, 0xb3, 0x93, 0x3a, 0x87, 0x47, 0x75, 0x6f); +DEFINE_GUID(MFMediaType_Audio, 0x73647561, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); +DEFINE_GUID(MFMediaType_Binary, 0x72178c25, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); +DEFINE_GUID(MFMediaType_Default, 0x81a412e6, 0x8103, 0x4b06, 0x85, 0x7f, 0x18, 0x62, 0x78, 0x10, 0x24, 0xac); +DEFINE_GUID(MFMediaType_FileTransfer, 0x72178c26, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); +DEFINE_GUID(MFMediaType_HTML, 0x72178c24, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); +DEFINE_GUID(MFMediaType_Image, 0x72178c23, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); +DEFINE_GUID(MFMediaType_MultiplexedFrames, 0x6ea542b0, 0x281f, 0x4231, 0xa4, 0x64, 0xfe, 0x2f, 0x50, 0x22, 0x50, 0x1c); +DEFINE_GUID(MFMediaType_Perception, 0x597ff6f9, 0x6ea2, 0x4670, 0x85, 0xb4, 0xea, 0x84, 0x07, 0x3f, 0xe9, 0x40); +DEFINE_GUID(MFMediaType_Protected, 0x7b4b6fe6, 0x9d04, 0x4494, 0xbe, 0x14, 0x7e, 0x0b, 0xd0, 0x76, 0xc8, 0xe4); +DEFINE_GUID(MFMediaType_SAMI, 0xe69669a0, 0x3dcd, 0x40cb, 0x9e, 0x2e, 0x37, 0x08, 0x38, 0x7c, 0x06, 0x16); +DEFINE_GUID(MFMediaType_Script, 0x72178c22, 0xe45b, 0x11d5, 0xbc, 0x2a, 0x00, 0xb0, 0xd0, 0xf3, 0xf4, 0xab); +DEFINE_GUID(MFMediaType_Stream, 0xe436eb83, 0x524f, 0x11ce, 0x9f, 0x53, 0x00, 0x20, 0xaf, 0x0b, 0xa7, 0x70); +DEFINE_GUID(MFMediaType_Subtitle, 0xa6d13581, 0xed50, 0x4e65, 0xae, 0x08, 0x26, 0x06, 0x55, 0x76, 0xaa, 0xcc); +DEFINE_GUID(MFMediaType_Video, 0x73646976, 0x0000, 0x0010, 0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71); + typedef unsigned __int64 MFWORKITEM_KEY; typedef enum
1
0
0
0
Daniel Ansorregui : d3d9/tests: Add tests for Fetch4 with depth textures.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: 771f5284292a9ed19bd081700c5da8a5348d4122 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=771f5284292a9ed19bd08170…
Author: Daniel Ansorregui <mailszeros(a)gmail.com> Date: Wed Mar 6 16:48:16 2019 +0330 d3d9/tests: Add tests for Fetch4 with depth textures. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 173 insertions(+), 2 deletions(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index 4b9b241..61a6794 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -15639,16 +15639,75 @@ static void test_fetch4(void) }, }; + static const struct + { + D3DCOLOR colour_off, colour_amd, colour_intel; + unsigned int x, y; + } + expected_depth[][4] = + { + { + /* Shadow samplers. */ + {0xffffffff, 0xffffffff, 0xffffffff, 20, 15}, + {0xffffffff, 0xffffffff, 0xffffffff, 260, 15}, + {0x00000000, 0x00000000, 0x00000000, 20, 255}, + {0x00000000, 0x00000000, 0x00000000, 260, 135}, + }, + { + /* DF16. */ + {0xfffe0000, 0xfedfdfbf, 0xffffffff, 20, 15}, + {0xff9f0000, 0x9f7f7f5f, 0x9fbfbf9f, 260, 15}, + {0xff800000, 0x7f5f5f3f, 0x9f809f80, 20, 255}, + {0xff600000, 0x5f3f3f1f, 0x80809f60, 260, 135}, + }, + { + /* DF24. */ + {0xffff0000, 0xffdfdfbf, 0xffffffff, 20, 15}, + {0xff9f0000, 0x9f7f7f5f, 0x9fbfbf9f, 260, 15}, + {0xff800000, 0x7f5f5f3f, 0x9f809f80, 20, 255}, + {0xff600000, 0x5f3f3f1f, 0x80809f60, 260, 135}, + }, + { + /* INTZ. */ + {0xffffffff, 0xffdfdfbf, 0xffffffff, 20, 15}, + {0x9f9f9f9f, 0x9f7f7f5f, 0x9fbfbf9f, 260, 15}, + {0x7f7f7f7f, 0x7f5f5f3f, 0x9f809f80, 20, 255}, + {0x5f5f5f5f, 0x5f3f3f1f, 0x80809f60, 260, 135}, + } + }; + + static const struct + { + const char *name; + D3DFORMAT format; + unsigned int index; + } + depth_tests[] = + { + {"D16_LOCKABLE", D3DFMT_D16_LOCKABLE, 0}, + {"D32", D3DFMT_D32, 0}, + {"D15S1", D3DFMT_D15S1, 0}, + {"D24S8", D3DFMT_D24S8, 0}, + {"D24X8", D3DFMT_D24X8, 0}, + {"D24X4S4", D3DFMT_D24X4S4, 0}, + {"D16", D3DFMT_D16, 0}, + {"D32F_LOCKABLE", D3DFMT_D32F_LOCKABLE, 0}, + {"D24FS8", D3DFMT_D24FS8, 0}, + {"DF16", MAKEFOURCC('D','F','1','6'), 1}, + {"DF24", MAKEFOURCC('D','F','2','4'), 2}, + {"INTZ", MAKEFOURCC('I','N','T','Z'), 3}, + }; + D3DCOLOR colour, colour_amd, colour_intel, colour_off, colour_zround; IDirect3DPixelShader9 *ps[ARRAY_SIZE(shaders)]; IDirect3DVolumeTexture9 *texture_3d; - IDirect3DSurface9 *original_rt; + IDirect3DSurface9 *original_rt, *rt; IDirect3DPixelShader9 *ps_3d; struct surface_readback rb; IDirect3DVertexShader9 *vs; IDirect3DTexture9 *texture; + unsigned int i, j, k, x, y; IDirect3DDevice9 *device; - unsigned int i, j, x, y; D3DLOCKED_RECT lr; D3DLOCKED_BOX lb; IDirect3D9 *d3d; @@ -15682,6 +15741,9 @@ static void test_fetch4(void) } hr = IDirect3DDevice9_GetRenderTarget(device, 0, &original_rt); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_CreateRenderTarget(device, 8, 8, D3DFMT_A8R8G8B8, + D3DMULTISAMPLE_NONE, 0, FALSE, &rt, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_CreateTexture(device, 4, 4, 1, 0, D3DFMT_L8, D3DPOOL_MANAGED, &texture, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -15900,6 +15962,114 @@ static void test_fetch4(void) ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); } + /* Test Fetch4 with depth textures. */ + for (i = 0; i < ARRAY_SIZE(depth_tests); ++i) + { + D3DFORMAT format = depth_tests[i].format; + IDirect3DTexture9 *depth_texture; + IDirect3DSurface9 *ds; + + if (FAILED(IDirect3D9_CheckDeviceFormat(d3d, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, + D3DFMT_X8R8G8B8, D3DUSAGE_DEPTHSTENCIL, D3DRTYPE_TEXTURE, format))) + { + skip("Skipping %s depth test, unsupported format.\n", depth_tests[i].name); + continue; + } + + hr = IDirect3DDevice9_CreateTexture(device, 8, 8, 1, + D3DUSAGE_DEPTHSTENCIL, format, D3DPOOL_DEFAULT, &depth_texture, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DTexture9_GetSurfaceLevel(depth_texture, 0, &ds); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetDepthStencilSurface(device, ds); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, rt); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetVertexShader(device, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetSamplerState(device, 0, + D3DSAMP_MIPMAPLODBIAS, MAKEFOURCC('G','E','T','1')); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Setup the depth/stencil surface. */ + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_ZBUFFER, 0, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Render to the depth surface. */ + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(*quad2)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_SetDepthStencilSurface(device, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DSurface9_Release(ds); + hr = IDirect3DDevice9_SetRenderTarget(device, 0, original_rt); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)depth_texture); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Set a shader for depth sampling, otherwise Windows does not show + * anything. */ + hr = IDirect3DDevice9_SetVertexShader(device, vs); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, ps[1]); /* texld */ + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + for (j = 0; j < 2; ++j) + { + hr = IDirect3DDevice9_SetSamplerState(device, 0, + D3DSAMP_MIPMAPLODBIAS, MAKEFOURCC('G','E','T', j ? '4' : '1' )); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Do the actual shadow mapping. */ + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(*quad2)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + get_rt_readback(original_rt, &rb); + for (k = 0; k < ARRAY_SIZE(expected_depth[depth_tests[i].index]); ++k) + { + x = expected_depth[depth_tests[i].index][k].x; + y = expected_depth[depth_tests[i].index][k].y; + colour_amd = expected_depth[depth_tests[i].index][k].colour_amd; + colour_intel = expected_depth[depth_tests[i].index][k].colour_intel; + colour_off = expected_depth[depth_tests[i].index][k].colour_off; + colour = get_readback_color(&rb, x, y); + + /* When Fetch4 is off, ignore the .g and .b channels on + * windows. Some implementations will replicate the .r channel + * to .g and .b, others will return 0 for .g and .b. */ + if (!j) + ok(color_match(colour, colour_off, 2) + || broken(color_match(colour & 0x00ff0000, colour_off & 0x00ff0000, 2)), + "Test off: Got unexpected colour 0x%08x for format %s at (%u, %u).\n", + colour, depth_tests[i].name, x, y); + else + ok(color_match(colour, colour_amd, 2) || broken(color_match(colour, colour_intel, 2)), + "Test on: Got unexpected colour 0x%08x for format %s at (%u, %u).\n", + colour, depth_tests[i].name, x, y); + } + release_surface_readback(&rb); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + + hr = IDirect3DDevice9_SetTexture(device, 0, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + IDirect3DTexture9_Release(depth_texture); + } + IDirect3DVolumeTexture9_Release(texture_3d); IDirect3DTexture9_Release(texture); for (i = 0; i < ARRAY_SIZE(ps); ++i) @@ -15909,6 +16079,7 @@ static void test_fetch4(void) } IDirect3DPixelShader9_Release(ps_3d); IDirect3DVertexShader9_Release(vs); + IDirect3DSurface9_Release(rt); IDirect3DSurface9_Release(original_rt); refcount = IDirect3DDevice9_Release(device); ok(!refcount, "Device has %u references left.\n", refcount);
1
0
0
0
Daniel Ansorregui : d3d9/tests: Add tests for Fetch4 with 3D textures.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: 48ca8c1c63dad214f1a65431981d9e13dc4e9b17 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=48ca8c1c63dad214f1a65431…
Author: Daniel Ansorregui <mailszeros(a)gmail.com> Date: Wed Mar 6 16:48:15 2019 +0330 d3d9/tests: Add tests for Fetch4 with 3D textures. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 86 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 85 insertions(+), 1 deletion(-) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index f6b9211..4b9b241 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -15481,6 +15481,15 @@ static void test_fetch4(void) 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ 0x0000ffff, /* end */ }; + static const DWORD ps_code_3d[] = + { + 0xffff0300, /* ps_3_0 */ + 0x0200001f, 0x80000005, 0x900f0000, /* dcl_texcoord v0 */ + 0x0200001f, 0xa0000000, 0xa00f0800, /* dcl_volume s0 */ + 0x03000042, 0x800f0000, 0x90e40000, 0xa0e40800, /* texld r0, v0, s0 */ + 0x02000001, 0x800f0800, 0x80e40000, /* mov oC0, r0 */ + 0x0000ffff, /* end */ + }; static const struct { @@ -15510,6 +15519,8 @@ static void test_fetch4(void) D3DCOLOR colour_amd[16]; D3DCOLOR colour_intel[16]; D3DCOLOR colour_fetch4_off[16]; + D3DCOLOR colour_3d_fetch4_off[16]; + D3DCOLOR colour_3d_amd_zround[16]; } expected_colours = { @@ -15532,6 +15543,16 @@ static void test_fetch4(void) 0x02020202, 0xf2f2f2f2, 0xf1f1f1f1, 0x01010101, 0x04040404, 0xf4f4f4f4, 0xf3f3f3f3, 0x03030303, 0x23232323, 0x22222222, 0x21212121, 0x20202020}, + /* Fetch4 off on 3D textures. */ + {0xff020202, 0xfff2f2f2, 0xfff1f1f1, 0xff010101, + 0xff050505, 0xfff4f4f4, 0xfff3f3f3, 0xff030303, + 0xff232323, 0xff222222, 0xff212121, 0xff202020, + 0xff131313, 0xff121212, 0xff111111, 0xff101010}, + /* Fetch4 on, 3D texture without nearest z rounding. */ + {0x02f204f4, 0xf2f1f4f3, 0xf101f303, 0x01010303, + 0x04f42322, 0xf4f32221, 0xf3032120, 0x03032020, + 0x23221312, 0x22211211, 0x21201110, 0x20201010, + 0x13121312, 0x12111211, 0x11101110, 0x10101010}, }; static const DWORD fetch4_data[] = {0x10111213, 0x01f1f202, 0x03f3f404, 0x20212223}; @@ -15618,15 +15639,18 @@ static void test_fetch4(void) }, }; - D3DCOLOR colour, colour_amd, colour_intel, colour_off; + D3DCOLOR colour, colour_amd, colour_intel, colour_off, colour_zround; IDirect3DPixelShader9 *ps[ARRAY_SIZE(shaders)]; + IDirect3DVolumeTexture9 *texture_3d; IDirect3DSurface9 *original_rt; + IDirect3DPixelShader9 *ps_3d; struct surface_readback rb; IDirect3DVertexShader9 *vs; IDirect3DTexture9 *texture; IDirect3DDevice9 *device; unsigned int i, j, x, y; D3DLOCKED_RECT lr; + D3DLOCKED_BOX lb; IDirect3D9 *d3d; ULONG refcount; D3DCAPS9 caps; @@ -15681,6 +15705,8 @@ static void test_fetch4(void) hr = IDirect3DDevice9_CreatePixelShader(device, shaders[i].ps_code, &ps[i]); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); } + hr = IDirect3DDevice9_CreatePixelShader(device, ps_code_3d, &ps_3d); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); hr = IDirect3DDevice9_SetFVF(device, D3DFVF_XYZ | D3DFVF_TEX1 | D3DFVF_TEXCOORDSIZE4(0)); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); @@ -15818,12 +15844,70 @@ static void test_fetch4(void) IDirect3DTexture9_Release(tex); } + hr = IDirect3DDevice9_CreateVolumeTexture(device, 4, 4, 2, 1, 0, D3DFMT_L8, D3DPOOL_MANAGED, &texture_3d, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DVolumeTexture9_LockBox(texture_3d, 0, &lb, NULL, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + for (i = 0; i < ARRAY_SIZE(fetch4_data); ++i) + { + memcpy((BYTE *)lb.pBits + i * lb.RowPitch, &fetch4_data[i], sizeof(fetch4_data[i])); + /* Shift the lower level, to keep it different. */ + memcpy((BYTE *)lb.pBits + i * lb.RowPitch + lb.SlicePitch, &fetch4_data[(i + 1) % 4], sizeof(fetch4_data[i])); + } + hr = IDirect3DVolumeTexture9_UnlockBox(texture_3d, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)texture_3d); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Test Fetch4 with 3D textures. */ + for (i = 0; i < 2; ++i) + { + hr = IDirect3DDevice9_SetVertexShader(device, i ? vs : NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, i ? ps_3d : NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(*quad2)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + get_rt_readback(original_rt, &rb); + for (j = 0; j < ARRAY_SIZE(expected_colours.colour_amd); ++j) + { + x = expected_colours.x[j % 4]; + y = expected_colours.y[j / 4]; + colour_amd = expected_colours.colour_amd[j]; + colour_intel = expected_colours.colour_intel[j]; + colour_off = expected_colours.colour_3d_fetch4_off[j]; + colour_zround = expected_colours.colour_3d_amd_zround[j]; + colour = get_readback_color(&rb, x, y); + + /* Note: Fetch4 on 3D textures have different results based on the vendor/driver + * - AMD "HD 5700" rounds to nearest "z" texel, and does fetch4 normally on .xy + * - AMD "R500" has fetch4 disabled + * - AMD "R580" has fetch4 enabled sampling at .xy0 + * - Intel UHD 620 sample with fetch4 at .xy0 */ + ok(color_match(colour, colour_off, 2) || broken(color_match(colour, colour_zround, 2) + || color_match(colour, colour_intel, 2) || color_match(colour, colour_amd, 2)), + "Test 3D %s: Got unexpected colour 0x%08x at (%u, %u).\n", shaders[i].name, colour, x, y); + } + release_surface_readback(&rb); + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + + IDirect3DVolumeTexture9_Release(texture_3d); IDirect3DTexture9_Release(texture); for (i = 0; i < ARRAY_SIZE(ps); ++i) { if (ps[i]) IDirect3DPixelShader9_Release(ps[i]); } + IDirect3DPixelShader9_Release(ps_3d); IDirect3DVertexShader9_Release(vs); IDirect3DSurface9_Release(original_rt); refcount = IDirect3DDevice9_Release(device);
1
0
0
0
Daniel Ansorregui : d3d9/tests: Add tests for Fetch4 format support.
by Alexandre Julliard
09 Mar '19
09 Mar '19
Module: wine Branch: master Commit: c4235cee1b0cd36b4e3c57a8d03c195e00a74e99 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=c4235cee1b0cd36b4e3c57a8…
Author: Daniel Ansorregui <mailszeros(a)gmail.com> Date: Wed Mar 6 16:48:14 2019 +0330 d3d9/tests: Add tests for Fetch4 format support. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/d3d9/tests/visual.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+) diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c index c62a94a..f6b9211 100644 --- a/dlls/d3d9/tests/visual.c +++ b/dlls/d3d9/tests/visual.c @@ -15493,6 +15493,15 @@ static void test_fetch4(void) {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 4.0f, 2.0f}}, {{-1.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 4.0f, 2.0f}}, {{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f, 4.0f, 2.0f}}, + }, + quad2[] = + { + /* Tilted on the z-axis to get a depth gradient in the depth test. */ + /* Note: Using 0.55f-0.6f to avoid rounding errors on depth tests. */ + {{-1.0f, 1.0f, 1.0f}, {0.0f, 0.0f, 0.6f, 0.0f}}, + {{ 1.0f, 1.0f, 0.0f}, {1.0f, 0.0f, 0.6f, 0.0f}}, + {{-1.0f, -1.0f, 0.0f}, {0.0f, 1.0f, 0.6f, 0.0f}}, + {{ 1.0f, -1.0f, 0.0f}, {1.0f, 1.0f, 0.6f, 0.0f}}, }; static const struct @@ -15548,6 +15557,67 @@ static void test_fetch4(void) {"FFP_proj3", NULL, 4, FALSE, D3DTTFF_COUNT3 | D3DTTFF_PROJECTED}, }; + static const struct + { + const char *name; + D3DFORMAT format; + DWORD data; + unsigned int x, y; + unsigned int w, h; + D3DCOLOR colour_amd[3]; + D3DCOLOR colour_intel[3]; + BOOL todo; + } + format_tests[] = + { + /* Enabled formats */ + { + "L8", D3DFMT_L8, + 0xff804010, 360, 30, 2, 2, + {0x40400000, 0x40400000, 0x10400000}, + {0x40101040, 0x40101040, 0x40101040}, + }, + { + "L16", D3DFMT_L16, + 0xff804010, 360, 30, 2, 2, + {0xffff0000, 0xffff0000, 0x40ff0000}, + {0xff4040ff, 0xff4040ff, 0xff4040ff}, + }, + { + "R16F", D3DFMT_R16F, + 0x38003c00, 360, 30, 2, 2, + {0x80800000, 0x80800000, 0xff800000}, + {0x80ffff80, 0x80ffff80, 0x80ffff80}, + }, + { + "R32F", D3DFMT_R32F, + 0x3f000000, 360, 30, 2, 2, + {0x00000000, 0x00000000, 0x80000000}, + {0x00808000, 0x00808000, 0x00808000}, + }, + { + "ATI1", MAKEFOURCC('A','T','I','1'), + 0xb97700ff, 360, 30, 4, 4, + {0x6d6d6d6d, 0x6d6d6d6d, 0x49494949}, + {0xff6d00ff, 0xff6d00ff, 0xff4900ff}, + }, + /* Unsupported on Intel, broken in Wine. */ + { + "A8", D3DFMT_A8, + 0xff804010, 360, 30, 2, 2, + {0x40400000, 0x40400000, 0x10400000}, + {0x00000000, 0x00000000, 0x00000000}, + TRUE, + }, + /* Unsupported format. */ + { + "A8R8G8B8", D3DFMT_A8R8G8B8, + 0xff804010, 360, 270, 2, 2, + {0x00000000, 0x00000000, 0xff804010}, + {0x00000000, 0x00000000, 0xff804010}, + }, + }; + D3DCOLOR colour, colour_amd, colour_intel, colour_off; IDirect3DPixelShader9 *ps[ARRAY_SIZE(shaders)]; IDirect3DSurface9 *original_rt; @@ -15695,6 +15765,58 @@ static void test_fetch4(void) hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); } + hr = IDirect3DDevice9_SetTextureStageState(device, 0, D3DTSS_TEXTURETRANSFORMFLAGS, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + /* Test Fetch4 format support. */ + for (i = 0; i < ARRAY_SIZE(format_tests); ++i) + { + IDirect3DTexture9 *tex; + + hr = IDirect3DDevice9_CreateTexture(device, format_tests[i].w, format_tests[i].h, + 1, 0, format_tests[i].format, D3DPOOL_MANAGED, &tex, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DTexture9_LockRect(tex, 0, &lr, NULL, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + memcpy(lr.pBits, &format_tests[i].data, 4); + hr = IDirect3DTexture9_UnlockRect(tex, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetTexture(device, 0, (IDirect3DBaseTexture9 *)tex); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + for (j = 0; j < ARRAY_SIZE(format_tests[i].colour_amd); ++j) + { + hr = IDirect3DDevice9_SetVertexShader(device, ps[j] ? vs : NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_SetPixelShader(device, ps[j]); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, 0, 0.0f, 0); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_BeginScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_DrawPrimitiveUP(device, D3DPT_TRIANGLESTRIP, 2, quad2, sizeof(*quad2)); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + hr = IDirect3DDevice9_EndScene(device); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + + get_rt_readback(original_rt, &rb); + colour_amd = format_tests[i].colour_amd[j]; + colour_intel = format_tests[i].colour_intel[j]; + colour = get_readback_color(&rb, format_tests[i].x, format_tests[i].y); + /* On windows just test the R channel, since G/B might be 0xff or 0x00. */ + todo_wine_if(format_tests[i].todo) + ok(color_match(colour, colour_amd, 2) || broken(color_match(colour, colour_intel, 2)) + || broken(color_match(colour & 0x00ff0000, colour_amd & 0x00ff0000, 2)), + "Test %s on %s: Got unexpected colour 0x%08x at (%u, %u).\n", + shaders[j].name, format_tests[i].name, colour, format_tests[i].x, format_tests[i].y); + release_surface_readback(&rb); + + hr = IDirect3DDevice9_Present(device, NULL, NULL, NULL, NULL); + ok(hr == D3D_OK, "Got unexpected hr %#x.\n", hr); + } + IDirect3DTexture9_Release(tex); + } IDirect3DTexture9_Release(texture); for (i = 0; i < ARRAY_SIZE(ps); ++i)
1
0
0
0
← Newer
1
...
68
69
70
71
72
73
74
...
110
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Results per page:
10
25
50
100
200