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
April 2020
----- 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
1016 discussions
Start a n
N
ew thread
Zebediah Figura : qcap/filewriter: Implement IAMFilterMiscFlags.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 91d0d9ec05579309cd61f8a128d9c25633af6016 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=91d0d9ec05579309cd61f8a1…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:47:06 2020 -0500 qcap/filewriter: Implement IAMFilterMiscFlags. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/filewriter.c | 46 +++++++++++++++++++++++++++++++++++++++++++- dlls/qcap/tests/filewriter.c | 19 +++++++++++++++++- 2 files changed, 63 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/filewriter.c b/dlls/qcap/filewriter.c index 2a3c8df4b9..4d9262e757 100644 --- a/dlls/qcap/filewriter.c +++ b/dlls/qcap/filewriter.c @@ -29,6 +29,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(qcap); struct file_writer { struct strmbase_filter filter; + IAMFilterMiscFlags IAMFilterMiscFlags_iface; IFileSinkFilter IFileSinkFilter_iface; struct strmbase_sink sink; @@ -105,7 +106,9 @@ static HRESULT file_writer_query_interface(struct strmbase_filter *iface, REFIID { struct file_writer *filter = impl_from_strmbase_filter(iface); - if (IsEqualGUID(iid, &IID_IFileSinkFilter)) + if (IsEqualGUID(iid, &IID_IAMFilterMiscFlags)) + *out = &filter->IAMFilterMiscFlags_iface; + else if (IsEqualGUID(iid, &IID_IFileSinkFilter)) *out = &filter->IFileSinkFilter_iface; else return E_NOINTERFACE; @@ -228,6 +231,46 @@ static const IFileSinkFilterVtbl filesinkfilter_vtbl = filesinkfilter_GetCurFile, }; +static inline struct file_writer *impl_from_IAMFilterMiscFlags(IAMFilterMiscFlags *iface) +{ + return CONTAINING_RECORD(iface, struct file_writer, IAMFilterMiscFlags_iface); +} + +static HRESULT WINAPI misc_flags_QueryInterface(IAMFilterMiscFlags *iface, REFIID iid, void **out) +{ + struct file_writer *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_QueryInterface(filter->filter.outer_unk, iid, out); +} + +static ULONG WINAPI misc_flags_AddRef(IAMFilterMiscFlags *iface) +{ + struct file_writer *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_AddRef(filter->filter.outer_unk); +} + +static ULONG WINAPI misc_flags_Release(IAMFilterMiscFlags *iface) +{ + struct file_writer *filter = impl_from_IAMFilterMiscFlags(iface); + return IUnknown_Release(filter->filter.outer_unk); +} + +static ULONG WINAPI misc_flags_GetMiscFlags(IAMFilterMiscFlags *iface) +{ + struct file_writer *filter = impl_from_IAMFilterMiscFlags(iface); + + TRACE("filter %p.\n", filter); + + return AM_FILTER_MISC_FLAGS_IS_RENDERER; +} + +static const IAMFilterMiscFlagsVtbl misc_flags_vtbl = +{ + misc_flags_QueryInterface, + misc_flags_AddRef, + misc_flags_Release, + misc_flags_GetMiscFlags, +}; + HRESULT file_writer_create(IUnknown *outer, IUnknown **out) { static const WCHAR sink_name[] = {'i','n',0}; @@ -238,6 +281,7 @@ HRESULT file_writer_create(IUnknown *outer, IUnknown **out) strmbase_filter_init(&object->filter, outer, &CLSID_FileWriter, &filter_ops); object->IFileSinkFilter_iface.lpVtbl = &filesinkfilter_vtbl; + object->IAMFilterMiscFlags_iface.lpVtbl = &misc_flags_vtbl; strmbase_sink_init(&object->sink, &object->filter, sink_name, &sink_ops, NULL); diff --git a/dlls/qcap/tests/filewriter.c b/dlls/qcap/tests/filewriter.c index f0c20e660e..7e8a91d3fb 100644 --- a/dlls/qcap/tests/filewriter.c +++ b/dlls/qcap/tests/filewriter.c @@ -78,7 +78,7 @@ static void test_interfaces(void) ULONG ref; IPin *pin; - todo_wine check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); + check_interface(filter, &IID_IAMFilterMiscFlags, TRUE); check_interface(filter, &IID_IBaseFilter, TRUE); check_interface(filter, &IID_IFileSinkFilter, TRUE); todo_wine check_interface(filter, &IID_IFileSinkFilter2, TRUE); @@ -769,6 +769,22 @@ static void test_connect_pin(void) ok(!ref, "Got outstanding refcount %d.\n", ref); } +static void test_misc_flags(void) +{ + IBaseFilter *filter = create_file_writer(); + IAMFilterMiscFlags *misc_flags; + ULONG flags, ref; + + IBaseFilter_QueryInterface(filter, &IID_IAMFilterMiscFlags, (void **)&misc_flags); + + flags = IAMFilterMiscFlags_GetMiscFlags(misc_flags); + ok(flags == AM_FILTER_MISC_FLAGS_IS_RENDERER, "Got flags %#x.\n", flags); + + IAMFilterMiscFlags_Release(misc_flags); + ref = IBaseFilter_Release(filter); + ok(!ref, "Got outstanding refcount %d.\n", ref); +} + START_TEST(filewriter) { CoInitializeEx(NULL, COINIT_MULTITHREADED); @@ -781,6 +797,7 @@ START_TEST(filewriter) test_media_types(); test_enum_media_types(); test_connect_pin(); + test_misc_flags(); CoUninitialize(); }
1
0
0
0
Zebediah Figura : qcap/filewriter: Implement sample processing.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 28f17d8e6ec069a55aed27c8fdabc1c56afb9ea4 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=28f17d8e6ec069a55aed27c8…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:47:05 2020 -0500 qcap/filewriter: Implement sample processing. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/filewriter.c | 26 ++++++++++++++++++ dlls/qcap/tests/filewriter.c | 65 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 90 insertions(+), 1 deletion(-) diff --git a/dlls/qcap/filewriter.c b/dlls/qcap/filewriter.c index caec4936cf..2a3c8df4b9 100644 --- a/dlls/qcap/filewriter.c +++ b/dlls/qcap/filewriter.c @@ -64,10 +64,36 @@ static HRESULT file_writer_sink_query_accept(struct strmbase_pin *iface, const A return S_OK; } +static HRESULT WINAPI file_writer_sink_receive(struct strmbase_sink *iface, IMediaSample *sample) +{ + struct file_writer *filter = impl_from_strmbase_pin(&iface->pin); + REFERENCE_TIME start, stop; + LARGE_INTEGER offset; + HRESULT hr; + DWORD size; + BYTE *data; + + if ((hr = IMediaSample_GetTime(sample, &start, &stop)) != S_OK) + ERR("Failed to get sample time, hr %#x.\n", hr); + + if ((hr = IMediaSample_GetPointer(sample, &data)) != S_OK) + ERR("Failed to get sample pointer, hr %#x.\n", hr); + + offset.QuadPart = start; + if (!SetFilePointerEx(filter->file, offset, NULL, FILE_BEGIN) + || !WriteFile(filter->file, data, stop - start, &size, NULL)) + ERR("Failed to write file, error %u.\n", GetLastError()); + if (size != stop - start) + ERR("Short write, %u/%u.\n", size, (DWORD)(stop - start)); + + return S_OK; +} + static const struct strmbase_sink_ops sink_ops = { .base.pin_query_interface = file_writer_sink_query_interface, .base.pin_query_accept = file_writer_sink_query_accept, + .pfnReceive = file_writer_sink_receive, }; static inline struct file_writer *impl_from_strmbase_filter(struct strmbase_filter *iface) diff --git a/dlls/qcap/tests/filewriter.c b/dlls/qcap/tests/filewriter.c index 57bd2ec872..f0c20e660e 100644 --- a/dlls/qcap/tests/filewriter.c +++ b/dlls/qcap/tests/filewriter.c @@ -549,7 +549,7 @@ static void test_allocator(IMemInputPin *input, IMemAllocator *allocator) ok(hr == E_POINTER, "Got hr %#x.\n", hr); props.cBuffers = 1; - props.cbBuffer = 256; + props.cbBuffer = 512; props.cbAlign = 512; props.cbPrefix = 0; hr = IMemAllocator_SetProperties(allocator, &props, &ret_props); @@ -616,6 +616,68 @@ static void test_filter_state(IMediaControl *control) ok(state == State_Stopped, "Got state %u.\n", state); } +static void test_sample_processing(IMediaControl *control, IMemInputPin *input, + IMemAllocator *allocator, const WCHAR *filename) +{ + REFERENCE_TIME start, stop; + IMediaSample *sample; + BYTE buffer[600]; + FILE *file; + HRESULT hr; + BYTE *data; + LONG size; + + hr = IMemInputPin_ReceiveCanBlock(input); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0); + ok(hr == VFW_E_NOT_COMMITTED, "Got hr %#x.\n", hr); + + hr = IMemAllocator_Commit(allocator); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaSample_GetPointer(sample, &data); + ok(hr == S_OK, "Got hr %#x.\n", hr); + size = IMediaSample_GetSize(sample); + ok(size == 512, "Got size %d.\n", size); + memset(data, 0xcc, size); + start = 0; + stop = 512; + hr = IMediaSample_SetTime(sample, &start, &stop); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + strcpy((char *)data, "abcdefghi"); + hr = IMediaSample_SetActualDataLength(sample, 9); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMemInputPin_Receive(input, sample); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + memset(data, 0xcc, size); + strcpy((char *)data, "123456"); + hr = IMediaSample_SetActualDataLength(sample, 6); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMemInputPin_Receive(input, sample); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + file = _wfopen(filename, L"rb"); + ok(!!file, "Failed to open file: %s.\n", strerror(errno)); + size = fread(buffer, 1, sizeof(buffer), file); + ok(size == 512, "Got size %d.\n", size); + ok(!memcmp(buffer, "123456\0\xcc\xcc\xcc", 10), "Got data %s.\n", + debugstr_an((char *)buffer, size)); + fclose(file); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + IMediaSample_Release(sample); +} + static void test_connect_pin(void) { AM_MEDIA_TYPE req_mt = @@ -675,6 +737,7 @@ static void test_connect_pin(void) test_allocator(meminput, allocator); test_filter_state(control); + test_sample_processing(control, meminput, allocator, filename); hr = IFilterGraph2_Disconnect(graph, pin); ok(hr == S_OK, "Got hr %#x.\n", hr);
1
0
0
0
Zebediah Figura : qcap/filewriter: Implement state change methods.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 439458af33da84c9891c1e0afc357f7804e3cb10 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=439458af33da84c9891c1e0a…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:47:04 2020 -0500 qcap/filewriter: Implement state change methods. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/qcap/filewriter.c | 26 +++++++++++++++++++ dlls/qcap/tests/filewriter.c | 62 ++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 86 insertions(+), 2 deletions(-) diff --git a/dlls/qcap/filewriter.c b/dlls/qcap/filewriter.c index aa58226bd0..caec4936cf 100644 --- a/dlls/qcap/filewriter.c +++ b/dlls/qcap/filewriter.c @@ -34,6 +34,7 @@ struct file_writer struct strmbase_sink sink; WCHAR *filename; + HANDLE file; }; static inline struct file_writer *impl_from_strmbase_pin(struct strmbase_pin *iface) @@ -106,11 +107,36 @@ static void file_writer_destroy(struct strmbase_filter *iface) heap_free(filter); } +static HRESULT file_writer_init_stream(struct strmbase_filter *iface) +{ + struct file_writer *filter = impl_from_strmbase_filter(iface); + HANDLE file; + + if ((file = CreateFileW(filter->filename, GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, + NULL, CREATE_ALWAYS, 0, NULL)) == INVALID_HANDLE_VALUE) + { + ERR("Failed to create %s, error %u.\n", debugstr_w(filter->filename), GetLastError()); + return HRESULT_FROM_WIN32(GetLastError()); + } + filter->file = file; + return S_OK; +} + +static HRESULT file_writer_cleanup_stream(struct strmbase_filter *iface) +{ + struct file_writer *filter = impl_from_strmbase_filter(iface); + + CloseHandle(filter->file); + return S_OK; +} + static struct strmbase_filter_ops filter_ops = { .filter_query_interface = file_writer_query_interface, .filter_get_pin = file_writer_get_pin, .filter_destroy = file_writer_destroy, + .filter_init_stream = file_writer_init_stream, + .filter_cleanup_stream = file_writer_cleanup_stream, }; static inline struct file_writer *impl_from_IFileSinkFilter(IFileSinkFilter *iface) diff --git a/dlls/qcap/tests/filewriter.c b/dlls/qcap/tests/filewriter.c index cfc9e5d634..57bd2ec872 100644 --- a/dlls/qcap/tests/filewriter.c +++ b/dlls/qcap/tests/filewriter.c @@ -564,6 +564,58 @@ static void test_allocator(IMemInputPin *input, IMemAllocator *allocator) IMemAllocator_Release(ret_allocator); } +static void test_filter_state(IMediaControl *control) +{ + OAFilterState state; + HRESULT hr; + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IMediaControl_Run(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IMediaControl_Pause(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Paused, "Got state %u.\n", state); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); + + hr = IMediaControl_Run(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Running, "Got state %u.\n", state); + + hr = IMediaControl_Stop(control); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IMediaControl_GetState(control, 0, &state); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(state == State_Stopped, "Got state %u.\n", state); +} + static void test_connect_pin(void) { AM_MEDIA_TYPE req_mt = @@ -574,19 +626,21 @@ static void test_connect_pin(void) }; IBaseFilter *filter = create_file_writer(); + WCHAR *filename = set_filename(filter); struct testfilter source; IMemAllocator *allocator; + IMediaControl *control; IMemInputPin *meminput; IFilterGraph2 *graph; AM_MEDIA_TYPE mt; IPin *pin, *peer; HRESULT hr; ULONG ref; - - set_filename(filter); + BOOL ret; testfilter_init(&source); CoCreateInstance(&CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, &IID_IFilterGraph2, (void **)&graph); + IFilterGraph2_QueryInterface(graph, &IID_IMediaControl, (void **)&control); hr = IFilterGraph2_AddFilter(graph, filter, L"filewriter"); ok(hr == S_OK, "Got hr %#x.\n", hr); IFilterGraph2_AddFilter(graph, &source.filter.IBaseFilter_iface, L"source"); @@ -620,6 +674,7 @@ static void test_connect_pin(void) &IID_IMemAllocator, (void **)&allocator); test_allocator(meminput, allocator); + test_filter_state(control); hr = IFilterGraph2_Disconnect(graph, pin); ok(hr == S_OK, "Got hr %#x.\n", hr); @@ -636,6 +691,9 @@ static void test_connect_pin(void) hr = IPin_ConnectionMediaType(pin, &mt); ok(hr == VFW_E_NOT_CONNECTED, "Got hr %#x.\n", hr); + ret = DeleteFileW(filename); + ok(ret, "Failed to delete file, error %u.\n", GetLastError()); + IMediaControl_Release(control); ref = IFilterGraph2_Release(graph); ok(!ref, "Got outstanding refcount %d.\n", ref); IMemInputPin_Release(meminput);
1
0
0
0
Zebediah Figura : include: Rename the other In*OrderModuleList fields to In*OrderLinks for consistency.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: ea753c384e1040c578a7692c3f003b4380ec283d URL:
https://source.winehq.org/git/wine.git/?a=commit;h=ea753c384e1040c578a7692c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:17:34 2020 -0500 include: Rename the other In*OrderModuleList fields to In*OrderLinks for consistency. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/module.c | 6 +++--- dlls/kernel32/tests/loader.c | 2 +- dlls/kernel32/toolhelp.c | 4 ++-- dlls/ntdll/loader.c | 42 +++++++++++++++++++++--------------------- include/winternl.h | 4 ++-- programs/winedbg/symbol.c | 4 ++-- 6 files changed, 31 insertions(+), 31 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=ea753c384e1040c578a7…
1
0
0
0
Zebediah Figura : include: Rename BaseAddress to DllBase.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 09db718d99026959c8bcf0718dccad589cad34f3 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=09db718d99026959c8bcf071…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:17:33 2020 -0500 include: Rename BaseAddress to DllBase. To match Microsoft's public definition. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/module.c | 8 ++-- dlls/kernel32/toolhelp.c | 4 +- dlls/ntdll/actctx.c | 2 +- dlls/ntdll/exception.c | 6 +-- dlls/ntdll/loader.c | 90 ++++++++++++++++++++++---------------------- dlls/ntdll/tests/rtl.c | 16 ++++---- dlls/ntoskrnl.exe/ntoskrnl.c | 2 +- include/winternl.h | 2 +- programs/winedbg/symbol.c | 2 +- 9 files changed, 66 insertions(+), 66 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=09db718d99026959c8bc…
1
0
0
0
Zebediah Figura : include: Rename InMemoryOrderModuleList to InMemoryOrderLinks.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 4b3e820e07e3ca00411d8cc5fcb13e7a94a4c494 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4b3e820e07e3ca00411d8cc5…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:17:32 2020 -0500 include: Rename InMemoryOrderModuleList to InMemoryOrderLinks. To match Microsoft's public definition. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/tests/loader.c | 2 +- dlls/ntdll/loader.c | 18 +++++++++--------- dlls/ntdll/tests/rtl.c | 6 +++--- include/winternl.h | 2 +- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/dlls/kernel32/tests/loader.c b/dlls/kernel32/tests/loader.c index 89496ac7e8..2164440494 100644 --- a/dlls/kernel32/tests/loader.c +++ b/dlls/kernel32/tests/loader.c @@ -3816,7 +3816,7 @@ static void test_InMemoryOrderModuleList(void) entry1 = entry1->Flink, entry2 = entry2->Flink) { module1 = CONTAINING_RECORD(entry1, LDR_DATA_TABLE_ENTRY, InLoadOrderModuleList); - module2 = CONTAINING_RECORD(entry2, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + module2 = CONTAINING_RECORD(entry2, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(module1 == module2, "expected module1 == module2, got %p and %p\n", module1, module2); } ok(entry1 == mark1, "expected entry1 == mark1, got %p and %p\n", entry1, mark1); diff --git a/dlls/ntdll/loader.c b/dlls/ntdll/loader.c index 8f60fd1043..22843706db 100644 --- a/dlls/ntdll/loader.c +++ b/dlls/ntdll/loader.c @@ -478,7 +478,7 @@ static WINE_MODREF *get_modref( HMODULE hmod ) mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); if (mod->BaseAddress == hmod) return cached_modref = CONTAINING_RECORD(mod, WINE_MODREF, ldr); } @@ -1226,7 +1226,7 @@ static WINE_MODREF *alloc_module( HMODULE hModule, const UNICODE_STRING *nt_name InsertTailList(&NtCurrentTeb()->Peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList); InsertTailList(&NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList, - &wm->ldr.InMemoryOrderModuleList); + &wm->ldr.InMemoryOrderLinks); /* wait until init is called for inserting into InInitializationOrderModuleList */ if (!(nt->OptionalHeader.DllCharacteristics & IMAGE_DLLCHARACTERISTICS_NX_COMPAT)) @@ -1638,7 +1638,7 @@ NTSTATUS WINAPI LdrFindEntryForAddress( const void *addr, PLDR_DATA_TABLE_ENTRY mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); if (mod->BaseAddress <= addr && (const char *)addr < (char*)mod->BaseAddress + mod->SizeOfImage) { @@ -1668,7 +1668,7 @@ NTSTATUS WINAPI LdrEnumerateLoadedModules( void *unknown, LDRENUMPROC callback, mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; for (entry = mark->Flink; entry != mark; entry = entry->Flink) { - mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList ); + mod = CONTAINING_RECORD( entry, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks ); callback( mod, context, &stop ); if (stop) break; } @@ -2029,7 +2029,7 @@ static NTSTATUS build_so_dll_module( const WCHAR *load_path, const UNICODE_STRIN { /* the module has only been inserted in the load & memory order lists */ RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); /* FIXME: free the modref */ return status; } @@ -2572,7 +2572,7 @@ static NTSTATUS load_native_dll( LPCWSTR load_path, const UNICODE_STRING *nt_nam { /* the module has only be inserted in the load & memory order lists */ RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); /* FIXME: there are several more dangling references * left. Including dlls loaded by this dll before the @@ -3790,7 +3790,7 @@ void WINAPI LdrShutdownThread(void) static void free_modref( WINE_MODREF *wm ) { RemoveEntryList(&wm->ldr.InLoadOrderModuleList); - RemoveEntryList(&wm->ldr.InMemoryOrderModuleList); + RemoveEntryList(&wm->ldr.InMemoryOrderLinks); if (wm->ldr.InInitializationOrderModuleList.Flink) RemoveEntryList(&wm->ldr.InInitializationOrderModuleList); @@ -4578,8 +4578,8 @@ void __wine_process_init(void) /* the main exe needs to be the first in the load order list */ RemoveEntryList( &wm->ldr.InLoadOrderModuleList ); InsertHeadList( &peb->LdrData->InLoadOrderModuleList, &wm->ldr.InLoadOrderModuleList ); - RemoveEntryList( &wm->ldr.InMemoryOrderModuleList ); - InsertHeadList( &peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderModuleList ); + RemoveEntryList( &wm->ldr.InMemoryOrderLinks ); + InsertHeadList( &peb->LdrData->InMemoryOrderModuleList, &wm->ldr.InMemoryOrderLinks ); virtual_alloc_thread_stack( &stack, 0, 0, NULL ); teb->Tib.StackBase = stack.StackBase; diff --git a/dlls/ntdll/tests/rtl.c b/dlls/ntdll/tests/rtl.c index b8e30bd947..f29eca24f0 100644 --- a/dlls/ntdll/tests/rtl.c +++ b/dlls/ntdll/tests/rtl.c @@ -3455,7 +3455,7 @@ static void CALLBACK ldr_notify_callback1(ULONG reason, LDR_DLL_NOTIFICATION_DAT /* expect module to be last module listed in LdrData load order list */ mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); ok(!lstrcmpiW(mod->BaseDllName.Buffer, expected_dll), "Expected %s, got %s\n", @@ -3516,7 +3516,7 @@ static void CALLBACK ldr_notify_callback_dll_main(ULONG reason, LDR_DLL_NOTIFICA return; mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); if (mod->BaseAddress != data->Loaded.DllBase) @@ -3555,7 +3555,7 @@ static void CALLBACK ldr_notify_callback_fail(ULONG reason, LDR_DLL_NOTIFICATION return; mark = &NtCurrentTeb()->Peb->LdrData->InMemoryOrderModuleList; - mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderModuleList); + mod = CONTAINING_RECORD(mark->Blink, LDR_DATA_TABLE_ENTRY, InMemoryOrderLinks); ok(mod->BaseAddress == data->Loaded.DllBase, "Expected base address %p, got %p\n", data->Loaded.DllBase, mod->BaseAddress); if (mod->BaseAddress != data->Loaded.DllBase) diff --git a/include/winternl.h b/include/winternl.h index 0fa5485596..b246871f07 100644 --- a/include/winternl.h +++ b/include/winternl.h @@ -2320,7 +2320,7 @@ typedef enum _LDR_DLL_LOAD_REASON typedef struct _LDR_DATA_TABLE_ENTRY { LIST_ENTRY InLoadOrderModuleList; - LIST_ENTRY InMemoryOrderModuleList; + LIST_ENTRY InMemoryOrderLinks; LIST_ENTRY InInitializationOrderModuleList; void* BaseAddress; void* EntryPoint;
1
0
0
0
Zebediah Figura : include: Rename LDR_MODULE to LDR_DATA_TABLE_ENTRY.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: feeb1c7c244bf9e9b78b2a770cdc15036d243849 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=feeb1c7c244bf9e9b78b2a77…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Thu Apr 23 20:17:31 2020 -0500 include: Rename LDR_MODULE to LDR_DATA_TABLE_ENTRY. This name is used in Microsoft's public winternl.h. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/kernel32/kernel_main.c | 2 +- dlls/kernel32/module.c | 32 ++++++++++----------- dlls/kernel32/tests/loader.c | 6 ++-- dlls/kernel32/toolhelp.c | 16 +++++------ dlls/kernelbase/loader.c | 2 +- dlls/krnl386.exe16/ne_module.c | 2 +- dlls/ntdll/actctx.c | 4 +-- dlls/ntdll/exception.c | 4 +-- dlls/ntdll/loader.c | 64 +++++++++++++++++++++--------------------- dlls/ntdll/ntdll_misc.h | 2 +- dlls/ntdll/signal_arm64.c | 2 +- dlls/ntdll/signal_x86_64.c | 2 +- dlls/ntdll/tests/rtl.c | 14 ++++----- dlls/ntoskrnl.exe/ntoskrnl.c | 8 +++--- include/winternl.h | 8 +++--- programs/winedbg/symbol.c | 4 +-- tools/winapi/win32.api | 2 +- 17 files changed, 87 insertions(+), 87 deletions(-) Diff:
https://source.winehq.org/git/wine.git/?a=commitdiff;h=feeb1c7c244bf9e9b78b…
1
0
0
0
Henri Verbeet : wined3d: Handle MSAA resolves in the Vulkan blitter.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 01f640556fe30e11a10d3ea75715c4a7bfa75748 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=01f640556fe30e11a10d3ea7…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Apr 24 02:39:26 2020 +0430 wined3d: Handle MSAA resolves in the Vulkan blitter. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 81 +++++++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 27 deletions(-) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 3e9c350aa9..1e6452a09d 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -5807,12 +5807,6 @@ static bool vk_blitter_blit_supported(enum wined3d_blit_op op, const struct wine return false; } - if (wined3d_resource_get_sample_count(src_resource) > 1) - { - TRACE("Multi-sample source resource not supported.\n"); - return false; - } - if (op == WINED3D_BLIT_OP_RAW_BLIT) return true; @@ -5846,7 +5840,7 @@ static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_ VkImageAspectFlags src_aspect, dst_aspect; VkCommandBuffer vk_command_buffer; struct wined3d_blitter *next; - VkImageCopy region; + bool resolve = false; TRACE("blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_rect %s, " "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, colour_key %p, filter %s.\n", @@ -5865,6 +5859,9 @@ static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_ goto next; } + if (wined3d_resource_get_sample_count(&src_texture_vk->t.resource) > 1) + resolve = true; + src_level = src_sub_resource_idx % src_texture->level_count; src_layer = src_sub_resource_idx / src_texture->level_count; @@ -5912,26 +5909,56 @@ static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_ dst_texture_vk->layout, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, dst_texture_vk->vk_image, dst_aspect); - region.srcSubresource.aspectMask = src_aspect; - region.srcSubresource.mipLevel = src_level; - region.srcSubresource.baseArrayLayer = src_layer; - region.srcSubresource.layerCount = 1; - region.srcOffset.x = src_rect->left; - region.srcOffset.y = src_rect->top; - region.srcOffset.z = 0; - region.dstSubresource.aspectMask = dst_aspect; - region.dstSubresource.mipLevel = dst_level; - region.dstSubresource.baseArrayLayer = dst_layer; - region.dstSubresource.layerCount = 1; - region.dstOffset.x = dst_rect->left; - region.dstOffset.y = dst_rect->top; - region.dstOffset.z = 0; - region.extent.width = src_rect->right - src_rect->left; - region.extent.height = src_rect->bottom - src_rect->top; - region.extent.depth = 1; - - VK_CALL(vkCmdCopyImage(vk_command_buffer, src_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, - dst_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion)); + if (resolve) + { + VkImageResolve region; + + region.srcSubresource.aspectMask = src_aspect; + region.srcSubresource.mipLevel = src_level; + region.srcSubresource.baseArrayLayer = src_layer; + region.srcSubresource.layerCount = 1; + region.srcOffset.x = src_rect->left; + region.srcOffset.y = src_rect->top; + region.srcOffset.z = 0; + region.dstSubresource.aspectMask = dst_aspect; + region.dstSubresource.mipLevel = dst_level; + region.dstSubresource.baseArrayLayer = dst_layer; + region.dstSubresource.layerCount = 1; + region.dstOffset.x = dst_rect->left; + region.dstOffset.y = dst_rect->top; + region.dstOffset.z = 0; + region.extent.width = src_rect->right - src_rect->left; + region.extent.height = src_rect->bottom - src_rect->top; + region.extent.depth = 1; + + VK_CALL(vkCmdResolveImage(vk_command_buffer, src_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + dst_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion)); + } + else + { + VkImageCopy region; + + region.srcSubresource.aspectMask = src_aspect; + region.srcSubresource.mipLevel = src_level; + region.srcSubresource.baseArrayLayer = src_layer; + region.srcSubresource.layerCount = 1; + region.srcOffset.x = src_rect->left; + region.srcOffset.y = src_rect->top; + region.srcOffset.z = 0; + region.dstSubresource.aspectMask = dst_aspect; + region.dstSubresource.mipLevel = dst_level; + region.dstSubresource.baseArrayLayer = dst_layer; + region.dstSubresource.layerCount = 1; + region.dstOffset.x = dst_rect->left; + region.dstOffset.y = dst_rect->top; + region.dstOffset.z = 0; + region.extent.width = src_rect->right - src_rect->left; + region.extent.height = src_rect->bottom - src_rect->top; + region.extent.depth = 1; + + VK_CALL(vkCmdCopyImage(vk_command_buffer, src_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + dst_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion)); + } wined3d_context_vk_image_barrier(context_vk, vk_command_buffer, VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT,
1
0
0
0
Henri Verbeet : wined3d: Implement raw blits in the Vulkan GPU blitter.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: 6601bc3443462b5abb215b62e36008ab49ae688e URL:
https://source.winehq.org/git/wine.git/?a=commit;h=6601bc3443462b5abb215b62…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Apr 24 02:39:25 2020 +0430 wined3d: Implement raw blits in the Vulkan GPU blitter. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/texture.c | 183 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 183 insertions(+) diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 407c1078c4..3e9c350aa9 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -5760,13 +5760,93 @@ static void vk_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_dev clear_rects, draw_rect, flags, colour, depth, stencil); } +static bool vk_blitter_blit_supported(enum wined3d_blit_op op, const struct wined3d_context *context, + const struct wined3d_resource *src_resource, const RECT *src_rect, + const struct wined3d_resource *dst_resource, const RECT *dst_rect) +{ + const struct wined3d_format *src_format = src_resource->format; + const struct wined3d_format *dst_format = dst_resource->format; + + if (!(dst_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) + { + TRACE("Destination resource does not have GPU access.\n"); + return false; + } + + if (!(src_resource->access & WINED3D_RESOURCE_ACCESS_GPU)) + { + TRACE("Source resource does not have GPU access.\n"); + return false; + } + + if (dst_format->id != src_format->id) + { + if (!is_identity_fixup(dst_format->color_fixup)) + { + TRACE("Destination fixups are not supported.\n"); + return false; + } + + if (!is_identity_fixup(src_format->color_fixup)) + { + TRACE("Source fixups are not supported.\n"); + return false; + } + + if (op != WINED3D_BLIT_OP_RAW_BLIT + && wined3d_format_vk(src_format)->vk_format != wined3d_format_vk(dst_format)->vk_format) + { + TRACE("Format conversion not supported.\n"); + return false; + } + } + + if (wined3d_resource_get_sample_count(dst_resource) > 1) + { + TRACE("Multi-sample destination resource not supported.\n"); + return false; + } + + if (wined3d_resource_get_sample_count(src_resource) > 1) + { + TRACE("Multi-sample source resource not supported.\n"); + return false; + } + + if (op == WINED3D_BLIT_OP_RAW_BLIT) + return true; + + if (op != WINED3D_BLIT_OP_COLOR_BLIT) + { + TRACE("Unsupported blit operation %#x.\n", op); + return false; + } + + if ((src_rect->right - src_rect->left != dst_rect->right - dst_rect->left) + || (src_rect->bottom - src_rect->top != dst_rect->bottom - dst_rect->top)) + { + TRACE("Scaling not supported.\n"); + return false; + } + + return true; +} + static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect, const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter) { + struct wined3d_texture_vk *src_texture_vk = wined3d_texture_vk(src_texture); + struct wined3d_texture_vk *dst_texture_vk = wined3d_texture_vk(dst_texture); + struct wined3d_context_vk *context_vk = wined3d_context_vk(context); + const struct wined3d_vk_info *vk_info = context_vk->vk_info; + unsigned int src_level, src_layer, dst_level, dst_layer; + VkImageAspectFlags src_aspect, dst_aspect; + VkCommandBuffer vk_command_buffer; struct wined3d_blitter *next; + VkImageCopy region; TRACE("blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_rect %s, " "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, colour_key %p, filter %s.\n", @@ -5774,6 +5854,109 @@ static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_ wine_dbgstr_rect(src_rect), dst_texture, dst_sub_resource_idx, wined3d_debug_location(dst_location), wine_dbgstr_rect(dst_rect), colour_key, debug_d3dtexturefiltertype(filter)); + if (!vk_blitter_blit_supported(op, context, &src_texture->resource, src_rect, &dst_texture->resource, dst_rect)) + goto next; + + src_aspect = vk_aspect_mask_from_format(src_texture_vk->t.resource.format); + dst_aspect = vk_aspect_mask_from_format(dst_texture_vk->t.resource.format); + if ((src_aspect | dst_aspect) & (VK_IMAGE_ASPECT_DEPTH_BIT | VK_IMAGE_ASPECT_STENCIL_BIT)) + { + TRACE("Depth/stencil blits not supported.\n"); + goto next; + } + + src_level = src_sub_resource_idx % src_texture->level_count; + src_layer = src_sub_resource_idx / src_texture->level_count; + + dst_level = dst_sub_resource_idx % dst_texture->level_count; + dst_layer = dst_sub_resource_idx / dst_texture->level_count; + + if (!wined3d_texture_load_location(src_texture, src_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB)) + ERR("Failed to load the source sub-resource.\n"); + + if (texture2d_is_full_rect(dst_texture, dst_level, dst_rect)) + { + if (!wined3d_texture_prepare_location(dst_texture, + dst_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB)) + { + ERR("Failed to prepare the destination sub-resource.\n"); + goto next; + } + } + else + { + if (!wined3d_texture_load_location(dst_texture, + dst_sub_resource_idx, context, WINED3D_LOCATION_TEXTURE_RGB)) + { + ERR("Failed to load the destination sub-resource.\n"); + goto next; + } + } + + if (!(vk_command_buffer = wined3d_context_vk_get_command_buffer(context_vk))) + { + ERR("Failed to get command buffer.\n"); + goto next; + } + + wined3d_context_vk_image_barrier(context_vk, vk_command_buffer, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, + vk_access_mask_from_bind_flags(src_texture_vk->t.resource.bind_flags), + VK_ACCESS_TRANSFER_READ_BIT, + src_texture_vk->layout, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + src_texture_vk->vk_image, src_aspect); + wined3d_context_vk_image_barrier(context_vk, vk_command_buffer, + VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, VK_PIPELINE_STAGE_TRANSFER_BIT, + vk_access_mask_from_bind_flags(dst_texture_vk->t.resource.bind_flags), + VK_ACCESS_TRANSFER_WRITE_BIT, + dst_texture_vk->layout, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, + dst_texture_vk->vk_image, dst_aspect); + + region.srcSubresource.aspectMask = src_aspect; + region.srcSubresource.mipLevel = src_level; + region.srcSubresource.baseArrayLayer = src_layer; + region.srcSubresource.layerCount = 1; + region.srcOffset.x = src_rect->left; + region.srcOffset.y = src_rect->top; + region.srcOffset.z = 0; + region.dstSubresource.aspectMask = dst_aspect; + region.dstSubresource.mipLevel = dst_level; + region.dstSubresource.baseArrayLayer = dst_layer; + region.dstSubresource.layerCount = 1; + region.dstOffset.x = dst_rect->left; + region.dstOffset.y = dst_rect->top; + region.dstOffset.z = 0; + region.extent.width = src_rect->right - src_rect->left; + region.extent.height = src_rect->bottom - src_rect->top; + region.extent.depth = 1; + + VK_CALL(vkCmdCopyImage(vk_command_buffer, src_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, + dst_texture_vk->vk_image, VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, 1, ®ion)); + + wined3d_context_vk_image_barrier(context_vk, vk_command_buffer, + VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, + VK_ACCESS_TRANSFER_WRITE_BIT, + vk_access_mask_from_bind_flags(dst_texture_vk->t.resource.bind_flags), + VK_IMAGE_LAYOUT_TRANSFER_DST_OPTIMAL, dst_texture_vk->layout, + dst_texture_vk->vk_image, dst_aspect); + wined3d_context_vk_image_barrier(context_vk, vk_command_buffer, + VK_PIPELINE_STAGE_TRANSFER_BIT, VK_PIPELINE_STAGE_ALL_COMMANDS_BIT, + VK_ACCESS_TRANSFER_READ_BIT, + vk_access_mask_from_bind_flags(src_texture_vk->t.resource.bind_flags), + VK_IMAGE_LAYOUT_TRANSFER_SRC_OPTIMAL, src_texture_vk->layout, + src_texture_vk->vk_image, src_aspect); + + wined3d_texture_validate_location(dst_texture, dst_sub_resource_idx, WINED3D_LOCATION_TEXTURE_RGB); + wined3d_texture_invalidate_location(dst_texture, dst_sub_resource_idx, ~WINED3D_LOCATION_TEXTURE_RGB); + if (!wined3d_texture_load_location(dst_texture, dst_sub_resource_idx, context, dst_location)) + ERR("Failed to load the destination sub-resource into %s.\n", wined3d_debug_location(dst_location)); + + wined3d_context_vk_reference_texture(context_vk, src_texture_vk); + wined3d_context_vk_reference_texture(context_vk, dst_texture_vk); + + return dst_location | WINED3D_LOCATION_TEXTURE_RGB; + +next: if (!(next = blitter->next)) { ERR("No blitter to handle blit op %#x.\n", op);
1
0
0
0
Henri Verbeet : wined3d: Introduce a Vulkan GPU blitter.
by Alexandre Julliard
24 Apr '20
24 Apr '20
Module: wine Branch: master Commit: d6ef8b0700d296e3ba192ab1c16a0cde471f7bbc URL:
https://source.winehq.org/git/wine.git/?a=commit;h=d6ef8b0700d296e3ba192ab1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Fri Apr 24 02:39:24 2020 +0430 wined3d: Introduce a Vulkan GPU blitter. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/wined3d/adapter_vk.c | 1 + dlls/wined3d/texture.c | 80 ++++++++++++++++++++++++++++++++++++++++++ dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 82 insertions(+) diff --git a/dlls/wined3d/adapter_vk.c b/dlls/wined3d/adapter_vk.c index 9fd5c35d4b..16a23a5fec 100644 --- a/dlls/wined3d/adapter_vk.c +++ b/dlls/wined3d/adapter_vk.c @@ -675,6 +675,7 @@ static HRESULT adapter_vk_init_3d(struct wined3d_device *device) wined3d_context_vk_cleanup(context_vk); return E_FAIL; } + wined3d_vk_blitter_create(&device_vk->d.blitter); wined3d_device_create_default_samplers(device, &context_vk->c); diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c index 7a219a9521..407c1078c4 100644 --- a/dlls/wined3d/texture.c +++ b/dlls/wined3d/texture.c @@ -5725,3 +5725,83 @@ void wined3d_raw_blitter_create(struct wined3d_blitter **next, const struct wine blitter->next = *next; *next = blitter; } + +static void vk_blitter_destroy(struct wined3d_blitter *blitter, struct wined3d_context *context) +{ + struct wined3d_blitter *next; + + TRACE("blitter %p, context %p.\n", blitter, context); + + if ((next = blitter->next)) + next->ops->blitter_destroy(next, context); + + heap_free(blitter); +} + +static void vk_blitter_clear(struct wined3d_blitter *blitter, struct wined3d_device *device, + unsigned int rt_count, const struct wined3d_fb_state *fb, unsigned int rect_count, const RECT *clear_rects, + const RECT *draw_rect, DWORD flags, const struct wined3d_color *colour, float depth, DWORD stencil) +{ + struct wined3d_blitter *next; + + TRACE("blitter %p, device %p, rt_count %u, fb %p, rect_count %u, clear_rects %p, " + "draw_rect %s, flags %#x, colour %s, depth %.8e, stencil %#x.\n", + blitter, device, rt_count, fb, rect_count, clear_rects, + wine_dbgstr_rect(draw_rect), flags, debug_color(colour), depth, stencil); + + if (!(next = blitter->next)) + { + ERR("No blitter to handle clear.\n"); + return; + } + + TRACE("Forwarding to blitter %p.\n", next); + next->ops->blitter_clear(next, device, rt_count, fb, rect_count, + clear_rects, draw_rect, flags, colour, depth, stencil); +} + +static DWORD vk_blitter_blit(struct wined3d_blitter *blitter, enum wined3d_blit_op op, + struct wined3d_context *context, struct wined3d_texture *src_texture, unsigned int src_sub_resource_idx, + DWORD src_location, const RECT *src_rect, struct wined3d_texture *dst_texture, + unsigned int dst_sub_resource_idx, DWORD dst_location, const RECT *dst_rect, + const struct wined3d_color_key *colour_key, enum wined3d_texture_filter_type filter) +{ + struct wined3d_blitter *next; + + TRACE("blitter %p, op %#x, context %p, src_texture %p, src_sub_resource_idx %u, src_location %s, src_rect %s, " + "dst_texture %p, dst_sub_resource_idx %u, dst_location %s, dst_rect %s, colour_key %p, filter %s.\n", + blitter, op, context, src_texture, src_sub_resource_idx, wined3d_debug_location(src_location), + wine_dbgstr_rect(src_rect), dst_texture, dst_sub_resource_idx, wined3d_debug_location(dst_location), + wine_dbgstr_rect(dst_rect), colour_key, debug_d3dtexturefiltertype(filter)); + + if (!(next = blitter->next)) + { + ERR("No blitter to handle blit op %#x.\n", op); + return dst_location; + } + + TRACE("Forwarding to blitter %p.\n", next); + return next->ops->blitter_blit(next, op, context, src_texture, src_sub_resource_idx, src_location, + src_rect, dst_texture, dst_sub_resource_idx, dst_location, dst_rect, colour_key, filter); +} + +static const struct wined3d_blitter_ops vk_blitter_ops = +{ + .blitter_destroy = vk_blitter_destroy, + .blitter_clear = vk_blitter_clear, + .blitter_blit = vk_blitter_blit, +}; + +void wined3d_vk_blitter_create(struct wined3d_blitter **next) +{ + struct wined3d_blitter *blitter; + + if (!(blitter = heap_alloc(sizeof(*blitter)))) + return; + + TRACE("Created blitter %p.\n", blitter); + + blitter->ops = &vk_blitter_ops; + blitter->next = *next; + *next = blitter; +} diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 22e1f5160b..9ced75711f 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2436,6 +2436,7 @@ struct wined3d_blitter *wined3d_glsl_blitter_create(struct wined3d_blitter **nex const struct wined3d_device *device) DECLSPEC_HIDDEN; void wined3d_raw_blitter_create(struct wined3d_blitter **next, const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN; +void wined3d_vk_blitter_create(struct wined3d_blitter **next) DECLSPEC_HIDDEN; BOOL wined3d_clip_blit(const RECT *clip_rect, RECT *clipped, RECT *other) DECLSPEC_HIDDEN;
1
0
0
0
← Newer
1
...
15
16
17
18
19
20
21
...
102
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
Results per page:
10
25
50
100
200