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
February 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
1 participants
672 discussions
Start a n
N
ew thread
Zebediah Figura : quartz/tests/filesource: Add tests for IAsyncReader_Request() and IAsyncReader_WaitForNext().
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: wine Branch: master Commit: 4a4eca6e6850169d0f6a6321c976e84f62ab7880 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=4a4eca6e6850169d0f6a6321…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 25 21:39:46 2019 -0600 quartz/tests/filesource: Add tests for IAsyncReader_Request() and IAsyncReader_WaitForNext(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/tests/filesource.c | 94 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 94 insertions(+) diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index 36a2539..d526236 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -720,6 +720,99 @@ static void test_sync_read_aligned(IAsyncReader *reader, IMemAllocator *allocato IMediaSample_Release(sample); } +static void test_request(IAsyncReader *reader, IMemAllocator *allocator) +{ + IMediaSample *sample, *sample2, *ret_sample; + REFERENCE_TIME start_time, end_time; + BYTE *data, *data2; + DWORD_PTR cookie; + HRESULT hr; + LONG len; + int i; + + IMemAllocator_GetBuffer(allocator, &sample, NULL, NULL, 0); + IMediaSample_GetPointer(sample, &data); + IMemAllocator_GetBuffer(allocator, &sample2, NULL, NULL, 0); + IMediaSample_GetPointer(sample2, &data2); + + hr = IAsyncReader_WaitForNext(reader, 0, &ret_sample, &cookie); + ok(hr == VFW_E_TIMEOUT, "Got hr %#x.\n", hr); + + start_time = 0; + end_time = 512 * (LONGLONG)10000000; + hr = IMediaSample_SetTime(sample, &start_time, &end_time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAsyncReader_Request(reader, sample, 123); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAsyncReader_WaitForNext(reader, 1000, &ret_sample, &cookie); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(ret_sample == sample, "Expected sample %p, got %p.\n", sample, ret_sample); + ok(cookie == 123, "Got cookie %lu.\n", cookie); + + len = IMediaSample_GetActualDataLength(sample); + ok(len == 512, "Got length %d.\n", hr); + + for (i = 0; i < 512; i++) + ok(data[i] == i % 111, "Got wrong byte %02x at %u.\n", data[i], i); + + start_time = 1024 * (LONGLONG)10000000; + end_time = 1536 * (LONGLONG)10000000; + hr = IMediaSample_SetTime(sample, &start_time, &end_time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAsyncReader_Request(reader, sample, 123); + ok(hr == HRESULT_FROM_WIN32(ERROR_HANDLE_EOF), "Got hr %#x.\n", hr); + + start_time = 0; + end_time = 512 * (LONGLONG)10000000; + hr = IMediaSample_SetTime(sample, &start_time, &end_time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAsyncReader_Request(reader, sample, 123); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + start_time = 512 * (LONGLONG)10000000; + end_time = 1024 * (LONGLONG)10000000; + hr = IMediaSample_SetTime(sample2, &start_time, &end_time); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAsyncReader_Request(reader, sample2, 456); + ok(hr == S_OK, "Got hr %#x.\n", hr); + + hr = IAsyncReader_WaitForNext(reader, 1000, &ret_sample, &cookie); + ok(hr == S_OK, "Got hr %#x.\n", hr); + if (cookie == 123) + { + ok(ret_sample == sample, "Expected sample %p, got %p.\n", sample, ret_sample); + + hr = IAsyncReader_WaitForNext(reader, 1000, &ret_sample, &cookie); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(ret_sample == sample2, "Expected sample %p, got %p.\n", sample2, ret_sample); + ok(cookie == 456, "Got cookie %lu.\n", cookie); + } + else + { + ok(cookie == 456, "Got cookie %lu.\n", cookie); + ok(ret_sample == sample2, "Expected sample %p, got %p.\n", sample2, ret_sample); + + hr = IAsyncReader_WaitForNext(reader, 1000, &ret_sample, &cookie); + ok(hr == S_OK, "Got hr %#x.\n", hr); + ok(ret_sample == sample, "Expected sample %p, got %p.\n", sample, ret_sample); + ok(cookie == 123, "Got cookie %lu.\n", cookie); + } + + for (i = 0; i < 512; i++) + ok(data[i] == i % 111, "Got wrong byte %02x at %u.\n", data[i], i); + + for (i = 0; i < 88; i++) + ok(data2[i] == (512 + i) % 111, "Got wrong byte %02x at %u.\n", data2[i], i); + + IMediaSample_Release(sample); + IMediaSample_Release(sample2); +} + static void test_async_reader(void) { ALLOCATOR_PROPERTIES req_props = {2, 1024, 512, 0}, ret_props; @@ -800,6 +893,7 @@ static void test_async_reader(void) IMemAllocator_Commit(allocator); test_sync_read_aligned(reader, allocator); + test_request(reader, allocator); IMemAllocator_Release(allocator); IAsyncReader_Release(reader);
1
0
0
0
Zebediah Figura : quartz/filesource: Remove some incorrect assertions.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: wine Branch: master Commit: dbca5c56671692c87497e25c71022671c282a238 URL:
https://source.winehq.org/git/wine.git/?a=commit;h=dbca5c56671692c87497e25c…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 25 21:39:45 2019 -0600 quartz/filesource: Remove some incorrect assertions. There's no point checking the sample's time again. Moreover, short reads are not an error. Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filesource.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 9e36057..fc3e508 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -1222,7 +1222,6 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw if (SUCCEEDED(hr)) { REFERENCE_TIME rtStart, rtStop; - REFERENCE_TIME rtSampleStart, rtSampleStop; DATAREQUEST *pDataRq = This->sample_list + buffer; DWORD dwBytes = 0; @@ -1247,16 +1246,7 @@ static HRESULT WINAPI FileAsyncReader_WaitForNext(IAsyncReader * iface, DWORD dw rtStart = MEDIATIME_FROM_BYTES(rtStart); rtStop = rtStart + MEDIATIME_FROM_BYTES(dwBytes); - IMediaSample_GetTime(pDataRq->pSample, &rtSampleStart, &rtSampleStop); - assert(rtStart == rtSampleStart); - assert(rtStop <= rtSampleStop); - IMediaSample_SetTime(pDataRq->pSample, &rtStart, &rtStop); - assert(rtStart == rtSampleStart); - if (hr == S_OK) - assert(rtStop == rtSampleStop); - else - assert(rtStop == rtStart); This->sample_list[buffer].pSample = NULL; assert(This->oldest_sample < This->samples);
1
0
0
0
Zebediah Figura : quartz/filesource: Set the sample length in IAsyncReader_SyncReadAligned().
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: wine Branch: master Commit: 3d24e7dea9470c77cb5da3a8ebe841261f1c8d6f URL:
https://source.winehq.org/git/wine.git/?a=commit;h=3d24e7dea9470c77cb5da3a8…
Author: Zebediah Figura <z.figura12(a)gmail.com> Date: Mon Feb 25 21:39:44 2019 -0600 quartz/filesource: Set the sample length in IAsyncReader_SyncReadAligned(). Signed-off-by: Zebediah Figura <z.figura12(a)gmail.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/quartz/filesource.c | 5 +++++ dlls/quartz/tests/filesource.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dlls/quartz/filesource.c b/dlls/quartz/filesource.c index 71724af..9e36057 100644 --- a/dlls/quartz/filesource.c +++ b/dlls/quartz/filesource.c @@ -1292,6 +1292,8 @@ static BOOL sync_read(HANDLE file, LONGLONG offset, LONG length, BYTE *buffer, D ovl.u.s.Offset = (DWORD)offset; ovl.u.s.OffsetHigh = offset >> 32; + *read_len = 0; + ret = ReadFile(file, buffer, length, NULL, &ovl); if (ret || GetLastError() == ERROR_IO_PENDING) ret = GetOverlappedResult(file, &ovl, read_len, TRUE); @@ -1331,6 +1333,9 @@ static HRESULT WINAPI FileAsyncReader_SyncReadAligned(IAsyncReader *iface, IMedi hr = HRESULT_FROM_WIN32(GetLastError()); } + if (SUCCEEDED(hr)) + IMediaSample_SetActualDataLength(sample, read_len); + return hr; } diff --git a/dlls/quartz/tests/filesource.c b/dlls/quartz/tests/filesource.c index 340d1c4..36a2539 100644 --- a/dlls/quartz/tests/filesource.c +++ b/dlls/quartz/tests/filesource.c @@ -687,7 +687,6 @@ static void test_sync_read_aligned(IAsyncReader *reader, IMemAllocator *allocato ok(hr == S_OK, "Got hr %#x.\n", hr); len = IMediaSample_GetActualDataLength(sample); -todo_wine ok(len == 512, "Got length %d.\n", len); for (i = 0; i < 512; i++) @@ -702,7 +701,6 @@ todo_wine ok(hr == S_FALSE, "Got hr %#x.\n", hr); len = IMediaSample_GetActualDataLength(sample); -todo_wine ok(len == 88, "Got length %d.\n", len); for (i = 0; i < 88; i++) @@ -717,7 +715,6 @@ todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr); len = IMediaSample_GetActualDataLength(sample); -todo_wine ok(len == 0, "Got length %d.\n", len); IMediaSample_Release(sample);
1
0
0
0
Józef Kucia : tests: Fix domain shader code in test_tessellation_dcl_index_range().
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: 98d89c09febf579780248d8589d6674e9a35a6f2 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=98d89c09febf579780248d8…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:28:00 2019 +0100 tests: Fix domain shader code in test_tessellation_dcl_index_range(). Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/d3d12.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index 24db7a8..5ae8511 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -22815,9 +22815,9 @@ static void test_tessellation_dcl_index_range(void) static const D3D12_SHADER_BYTECODE hs = {hs_code, sizeof(hs_code)}; static const DWORD ds_code[] = { - 0x43425844, 0xeb6b7631, 0x07f5469e, 0xed0cbf4a, 0x7158b3a6, 0x00000001, 0x00000284, 0x00000004, + 0x43425844, 0x4f187d50, 0x6743fe93, 0x10dfbe63, 0xf8cfd202, 0x00000001, 0x00000284, 0x00000004, 0x00000030, 0x00000064, 0x00000128, 0x0000015c, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, - 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x505f5653, 0x5449534f, + 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x505f5653, 0x5449534f, 0x004e4f49, 0x47534350, 0x000000bc, 0x00000006, 0x00000008, 0x00000098, 0x00000000, 0x0000000b, 0x00000003, 0x00000000, 0x00000001, 0x00000098, 0x00000001, 0x0000000b, 0x00000003, 0x00000001, 0x00000001, 0x00000098, 0x00000002, 0x0000000b, 0x00000003, 0x00000002, 0x00000001, 0x00000098,
1
0
0
0
Józef Kucia : tests: Add test for hull shader control point phase.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: 5bfd2b8ed4c515ef8372f605f9aa256c6e27ca03 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=5bfd2b8ed4c515ef8372f60…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:27:59 2019 +0100 tests: Add test for hull shader control point phase. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- tests/d3d12.c | 151 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 151 insertions(+) diff --git a/tests/d3d12.c b/tests/d3d12.c index d8a13a7..24db7a8 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -22909,6 +22909,156 @@ static void test_tessellation_dcl_index_range(void) destroy_test_context(&context); } +static void test_hull_shader_control_point_phase(void) +{ + static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f}; + D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc; + ID3D12GraphicsCommandList *command_list; + struct test_context_desc desc; + struct test_context context; + ID3D12CommandQueue *queue; + HRESULT hr; + + static const DWORD vs_code[] = + { +#if 0 + void main() + { + } +#endif + 0x43425844, 0x590b08ae, 0x11d28adb, 0x825a5628, 0x34c0c208, 0x00000001, 0x00000064, 0x00000003, + 0x0000002c, 0x0000003c, 0x0000004c, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f, + 0x00000008, 0x00000000, 0x00000008, 0x58454853, 0x00000010, 0x00010050, 0x00000004, 0x0100086a, + 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE vs = {vs_code, sizeof(vs_code)}; +#if 0 + struct data + { + float4 position : SV_Position; + }; + + struct patch_constant_data + { + float edges[3] : SV_TessFactor; + float inside : SV_InsideTessFactor; + }; + + void patch_constant(out patch_constant_data output) + { + output.edges[0] = output.edges[1] = output.edges[2] = 1.0f; + output.inside = 1.0f; + } + + [domain("tri")] + [outputcontrolpoints(3)] + [partitioning("integer")] + [outputtopology("triangle_cw")] + [patchconstantfunc("patch_constant")] + data hs_main(uint i : SV_OutputControlPointID) + { + data output; + + if (i == 0) + output.position = float4(-1, 1, 0, 1); + else if (i == 1) + output.position = float4(3, 1, 0, 1); + else + output.position = float4(-1, -3, 0, 1); + + return output; + } + + [domain("tri")] + void ds_main(patch_constant_data input, + float3 tess_coord : SV_DomainLocation, + const OutputPatch<data, 3> patch, + out data output) + { + uint index = uint(tess_coord.y + 2 * tess_coord.z); + output.position = patch[index].position; + } +#endif + static const DWORD hs_code[] = + { + 0x43425844, 0x4204890e, 0x43f4f8e0, 0xbff7edfd, 0x0a48b715, 0x00000001, 0x0000028c, 0x00000004, + 0x00000030, 0x00000040, 0x00000074, 0x00000108, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, + 0x4e47534f, 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, + 0x00000000, 0x0000000f, 0x505f5653, 0x7469736f, 0x006e6f69, 0x47534350, 0x0000008c, 0x00000004, + 0x00000008, 0x00000068, 0x00000000, 0x0000000d, 0x00000003, 0x00000000, 0x00000e01, 0x00000068, + 0x00000001, 0x0000000d, 0x00000003, 0x00000001, 0x00000e01, 0x00000068, 0x00000002, 0x0000000d, + 0x00000003, 0x00000002, 0x00000e01, 0x00000076, 0x00000000, 0x0000000e, 0x00000003, 0x00000003, + 0x00000e01, 0x545f5653, 0x46737365, 0x6f746361, 0x56530072, 0x736e495f, 0x54656469, 0x46737365, + 0x6f746361, 0xabab0072, 0x58454853, 0x0000017c, 0x00030050, 0x0000005f, 0x01000071, 0x01000893, + 0x01001894, 0x01001095, 0x01000896, 0x01001897, 0x0100086a, 0x01000072, 0x0200005f, 0x00016000, + 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x06000020, 0x00100012, 0x00000000, + 0x00016001, 0x00004001, 0x00000001, 0x0f000037, 0x001000f2, 0x00000000, 0x00100006, 0x00000000, + 0x00004002, 0x40400000, 0x3f800000, 0x00000000, 0x3f800000, 0x00004002, 0xbf800000, 0xc0400000, + 0x00000000, 0x3f800000, 0x0b000037, 0x001020f2, 0x00000000, 0x00016001, 0x00100e46, 0x00000000, + 0x00004002, 0xbf800000, 0x3f800000, 0x00000000, 0x3f800000, 0x0100003e, 0x01000073, 0x02000099, + 0x00000003, 0x0200005f, 0x00017000, 0x04000067, 0x00102012, 0x00000000, 0x00000011, 0x04000067, + 0x00102012, 0x00000001, 0x00000012, 0x04000067, 0x00102012, 0x00000002, 0x00000013, 0x02000068, + 0x00000001, 0x0400005b, 0x00102012, 0x00000000, 0x00000003, 0x04000036, 0x00100012, 0x00000000, + 0x0001700a, 0x06000036, 0x00902012, 0x0010000a, 0x00000000, 0x00004001, 0x3f800000, 0x0100003e, + 0x01000073, 0x04000067, 0x00102012, 0x00000003, 0x00000014, 0x05000036, 0x00102012, 0x00000003, + 0x00004001, 0x3f800000, 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE hs = {hs_code, sizeof(hs_code)}; + static const DWORD ds_code[] = + { + 0x43425844, 0x33c6120a, 0x2d46da82, 0x2c17dddf, 0x252ae7e0, 0x00000001, 0x000001c8, 0x00000004, + 0x00000030, 0x00000064, 0x000000f8, 0x0000012c, 0x4e475349, 0x0000002c, 0x00000001, 0x00000008, + 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x00000f0f, 0x505f5653, 0x7469736f, + 0x006e6f69, 0x47534350, 0x0000008c, 0x00000004, 0x00000008, 0x00000068, 0x00000000, 0x0000000d, + 0x00000003, 0x00000000, 0x00000001, 0x00000068, 0x00000001, 0x0000000d, 0x00000003, 0x00000001, + 0x00000001, 0x00000068, 0x00000002, 0x0000000d, 0x00000003, 0x00000002, 0x00000001, 0x00000076, + 0x00000000, 0x0000000e, 0x00000003, 0x00000003, 0x00000001, 0x545f5653, 0x46737365, 0x6f746361, + 0x56530072, 0x736e495f, 0x54656469, 0x46737365, 0x6f746361, 0xabab0072, 0x4e47534f, 0x0000002c, + 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, + 0x505f5653, 0x7469736f, 0x006e6f69, 0x58454853, 0x00000094, 0x00040050, 0x00000025, 0x01001893, + 0x01001095, 0x0100086a, 0x0200005f, 0x0001c062, 0x0400005f, 0x002190f2, 0x00000003, 0x00000000, + 0x04000067, 0x001020f2, 0x00000000, 0x00000001, 0x02000068, 0x00000001, 0x07000032, 0x00100012, + 0x00000000, 0x0001c02a, 0x00004001, 0x40000000, 0x0001c01a, 0x0500001c, 0x00100012, 0x00000000, + 0x0010000a, 0x00000000, 0x07000036, 0x001020f2, 0x00000000, 0x00a19e46, 0x0010000a, 0x00000000, + 0x00000000, 0x0100003e, + }; + static const D3D12_SHADER_BYTECODE ds = {ds_code, sizeof(ds_code)}; + + memset(&desc, 0, sizeof(desc)); + desc.no_pipeline = true; + if (!init_test_context(&context, &desc)) + return; + command_list = context.list; + queue = context.queue; + + init_pipeline_state_desc(&pso_desc, context.root_signature, + context.render_target_desc.Format, NULL, NULL, NULL); + pso_desc.VS = vs; + pso_desc.HS = hs; + pso_desc.DS = ds; + pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_PATCH; + hr = ID3D12Device_CreateGraphicsPipelineState(context.device, &pso_desc, + &IID_ID3D12PipelineState, (void **)&context.pipeline_state); + ok(hr == S_OK, "Failed to create state, hr %#x.\n", hr); + + ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL); + + ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, FALSE, NULL); + ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature); + ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state); + ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_3_CONTROL_POINT_PATCHLIST); + ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport); + ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect); + ID3D12GraphicsCommandList_DrawInstanced(command_list, 3, 1, 0, 0); + + transition_resource_state(command_list, context.render_target, + D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE); + + check_sub_resource_uint(context.render_target, 0, queue, command_list, 0xff00ff00, 0); + + destroy_test_context(&context); +} + static void test_render_a8(void) { static const float black[] = {0.0f, 0.0f, 0.0f, 0.0f}; @@ -25257,6 +25407,7 @@ START_TEST(d3d12) run_test(test_nop_tessellation_shaders); run_test(test_quad_tessellation); run_test(test_tessellation_dcl_index_range); + run_test(test_hull_shader_control_point_phase); run_test(test_render_a8); run_test(test_cpu_descriptors_lifetime); run_test(test_clip_distance);
1
0
0
0
Józef Kucia : vkd3d-shader: Introduce is_control_point_phase() helper.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: 0ffaf4a2b703b570c072b4b67ea16773ec1eefc1 URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=0ffaf4a2b703b570c072b4b…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:27:58 2019 +0100 vkd3d-shader: Introduce is_control_point_phase() helper. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 34e274f..de4c683 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1997,6 +1997,11 @@ struct vkd3d_dxbc_compiler size_t shader_phases_size; }; +static bool is_control_point_phase(const struct vkd3d_shader_phase *phase) +{ + return phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE; +} + static void vkd3d_dxbc_compiler_emit_initial_declarations(struct vkd3d_dxbc_compiler *compiler); struct vkd3d_dxbc_compiler *vkd3d_dxbc_compiler_create(const struct vkd3d_shader_version *shader_version, @@ -3912,8 +3917,7 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler shader_signature = is_patch_constant ? compiler->patch_constant_signature : compiler->output_signature; - array_size = phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE - ? compiler->output_control_point_count : 0; + array_size = is_control_point_phase(phase) ? compiler->output_control_point_count : 0; if (!(signature_element = vkd3d_find_signature_element_for_reg(shader_signature, &signature_idx, reg->idx[0].offset, dst->write_mask))) @@ -3993,7 +3997,6 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler storage_class = SpvStorageClassPrivate; vkd3d_symbol_make_register(®_symbol, reg); - if (!use_private_variable) var_id = id; else if ((entry = rb_get(&compiler->symbol_table, ®_symbol))) @@ -4006,7 +4009,7 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler vkd3d_symbol_set_register_info(®_symbol, var_id, storage_class, use_private_variable ? VKD3D_TYPE_FLOAT : component_type, VKD3DSP_WRITEMASK_ALL); reg_symbol.info.reg.is_aggregate = use_private_variable ? false : array_size; - if (!use_private_variable && phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + if (!use_private_variable && is_control_point_phase(phase)) { struct vkd3d_shader_register r; @@ -4196,7 +4199,7 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ param_id[i] = vkd3d_spirv_build_op_load(builder, type_id, param_id[i], SpvMemoryAccessMaskNone); } - if (phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + if (is_control_point_phase(phase)) { struct vkd3d_shader_register r; uint32_t invocation_id; @@ -5227,7 +5230,7 @@ static void vkd3d_dxbc_compiler_leave_shader_phase(struct vkd3d_dxbc_compiler *c * in fork/join phases. We have to remove all output registers' symbols * when leaving the control point phase. */ - if (phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + if (is_control_point_phase(phase)) { memset(®, 0, sizeof(reg)); reg.type = VKD3DSPR_OUTPUT; @@ -5313,7 +5316,7 @@ static const struct vkd3d_shader_phase *vkd3d_dxbc_compiler_get_control_point_ph return NULL; phase = &compiler->shader_phases[0]; - if (phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + if (is_control_point_phase(phase)) return phase; return NULL; @@ -5438,7 +5441,7 @@ static void vkd3d_dxbc_compiler_emit_hull_shader_main(struct vkd3d_dxbc_compiler for (i = 0; i < compiler->shader_phase_count; ++i) { phase = &compiler->shader_phases[i]; - if (phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + if (is_control_point_phase(phase)) continue; if (phase->instance_count)
1
0
0
0
Józef Kucia : vkd3d-shader: Index control point phase outputs by InvocationId.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: ff132543c169641b4a1fb57701ca67deaee83fcd URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=ff132543c169641b4a1fb57…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:27:57 2019 +0100 vkd3d-shader: Index control point phase outputs by InvocationId. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 72 ++++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 65 insertions(+), 7 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 0e6df47..34e274f 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1754,6 +1754,7 @@ struct vkd3d_symbol_register_data unsigned int write_mask; unsigned int structure_stride; bool is_aggregate; /* An aggregate, i.e. a structure or an array. */ + bool is_dynamically_indexed; /* If member_idx is a variable ID instead of a constant. */ }; struct vkd3d_symbol_resource_data @@ -1832,6 +1833,7 @@ static void vkd3d_symbol_set_register_info(struct vkd3d_symbol *symbol, symbol->info.reg.write_mask = write_mask; symbol->info.reg.structure_stride = 0; symbol->info.reg.is_aggregate = false; + symbol->info.reg.is_dynamically_indexed = false; } static void vkd3d_symbol_make_resource(struct vkd3d_symbol *symbol, @@ -2505,6 +2507,7 @@ struct vkd3d_shader_register_info uint32_t member_idx; unsigned int structure_stride; bool is_aggregate; + bool is_dynamically_indexed; }; static bool vkd3d_dxbc_compiler_get_register_info(const struct vkd3d_dxbc_compiler *compiler, @@ -2525,6 +2528,7 @@ static bool vkd3d_dxbc_compiler_get_register_info(const struct vkd3d_dxbc_compil register_info->write_mask = VKD3DSP_WRITEMASK_ALL; register_info->structure_stride = 0; register_info->is_aggregate = false; + register_info->is_dynamically_indexed = false; return true; } @@ -2544,6 +2548,7 @@ static bool vkd3d_dxbc_compiler_get_register_info(const struct vkd3d_dxbc_compil register_info->write_mask = symbol->info.reg.write_mask; register_info->structure_stride = symbol->info.reg.structure_stride; register_info->is_aggregate = symbol->info.reg.is_aggregate; + register_info->is_dynamically_indexed = symbol->info.reg.is_dynamically_indexed; return true; } @@ -2577,8 +2582,17 @@ static void vkd3d_dxbc_compiler_emit_dereference_register(struct vkd3d_dxbc_comp if (reg->idx[1].rel_addr) FIXME("Relative addressing not implemented.\n"); - reg_idx.offset = register_info->member_idx; - indexes[index_count++] = vkd3d_dxbc_compiler_emit_register_addressing(compiler, ®_idx); + if (register_info->is_dynamically_indexed) + { + indexes[index_count++] = vkd3d_spirv_build_op_load(builder, + vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_INT, 1), + register_info->member_idx, SpvMemoryAccessMaskNone); + } + else + { + reg_idx.offset = register_info->member_idx; + indexes[index_count++] = vkd3d_dxbc_compiler_emit_register_addressing(compiler, ®_idx); + } } else { @@ -3889,6 +3903,7 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler struct rb_entry *entry = NULL; unsigned int signature_idx; bool use_private_variable; + unsigned int array_size; bool is_patch_constant; uint32_t id, var_id; @@ -3897,6 +3912,9 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler shader_signature = is_patch_constant ? compiler->patch_constant_signature : compiler->output_signature; + array_size = phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE + ? compiler->output_control_point_count : 0; + if (!(signature_element = vkd3d_find_signature_element_for_reg(shader_signature, &signature_idx, reg->idx[0].offset, dst->write_mask))) { @@ -3931,15 +3949,15 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler { if (builtin) { - id = vkd3d_dxbc_compiler_emit_builtin_variable(compiler, builtin, storage_class, 0); + id = vkd3d_dxbc_compiler_emit_builtin_variable(compiler, builtin, storage_class, array_size); vkd3d_dxbc_compiler_emit_register_execution_mode(compiler, &dst->reg); if (component_idx) FIXME("Unhandled component index %u.\n", component_idx); } else { - id = vkd3d_dxbc_compiler_emit_variable(compiler, &builder->global_stream, - storage_class, component_type, output_component_count); + id = vkd3d_dxbc_compiler_emit_array_variable(compiler, &builder->global_stream, + storage_class, component_type, output_component_count, array_size); vkd3d_spirv_add_iface_variable(builder, id); if (is_dual_source_blending(compiler) && reg->idx[0].offset < 2) @@ -3987,6 +4005,19 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler { vkd3d_symbol_set_register_info(®_symbol, var_id, storage_class, use_private_variable ? VKD3D_TYPE_FLOAT : component_type, VKD3DSP_WRITEMASK_ALL); + reg_symbol.info.reg.is_aggregate = use_private_variable ? false : array_size; + if (!use_private_variable && phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + { + struct vkd3d_shader_register r; + + memset(&r, 0, sizeof(r)); + r.type = VKD3DSPR_OUTPOINTID; + r.idx[0].offset = ~0u; + r.idx[1].offset = ~0u; + + reg_symbol.info.reg.member_idx = vkd3d_dxbc_compiler_get_register_id(compiler, &r); + reg_symbol.info.reg.is_dynamically_indexed = true; + } vkd3d_dxbc_compiler_put_symbol(compiler, ®_symbol); vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg); @@ -4047,7 +4078,8 @@ static void vkd3d_dxbc_compiler_emit_shader_phase_output(struct vkd3d_dxbc_compi static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_signature_element *output, - const struct vkd3d_shader_output_info *output_info, uint32_t val_id, unsigned int write_mask) + const struct vkd3d_shader_output_info *output_info, + uint32_t output_index_id, uint32_t val_id, unsigned int write_mask) { unsigned int dst_write_mask, use_mask, uninit_mask, swizzle, mask; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; @@ -4084,6 +4116,13 @@ static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compi } output_id = output_info->id; + if (output_index_id) + { + type_id = vkd3d_spirv_get_type_id(builder, + output_info->component_type, vkd3d_write_mask_component_count(dst_write_mask)); + ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, SpvStorageClassOutput, type_id); + output_id = vkd3d_spirv_build_op_access_chain1(builder, ptr_type_id, output_id, output_index_id); + } if (!output_info->array_element_mask) { @@ -4117,6 +4156,8 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ const struct vkd3d_shader_signature *signature = compiler->output_signature; uint32_t void_id, type_id, ptr_type_id, function_type_id, function_id; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; + const struct vkd3d_shader_phase *phase; + uint32_t output_index_id = 0; unsigned int i, count; DWORD variable_idx; @@ -4124,6 +4165,8 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ STATIC_ASSERT(ARRAY_SIZE(compiler->private_output_variable) == ARRAY_SIZE(param_type_id)); STATIC_ASSERT(ARRAY_SIZE(compiler->private_output_variable) == ARRAY_SIZE(compiler->private_output_variable_write_mask)); + phase = vkd3d_dxbc_compiler_get_current_shader_phase(compiler); + function_id = compiler->epilogue_function_id; void_id = vkd3d_spirv_get_op_type_void(builder); @@ -4153,6 +4196,21 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ param_id[i] = vkd3d_spirv_build_op_load(builder, type_id, param_id[i], SpvMemoryAccessMaskNone); } + if (phase && phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + { + struct vkd3d_shader_register r; + uint32_t invocation_id; + + memset(&r, 0, sizeof(r)); + r.type = VKD3DSPR_OUTPOINTID; + r.idx[0].offset = ~0u; + r.idx[1].offset = ~0u; + + type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_INT, 1); + invocation_id = vkd3d_dxbc_compiler_get_register_id(compiler, &r); + output_index_id = vkd3d_spirv_build_op_load(builder, type_id, invocation_id, SpvMemoryAccessMaskNone); + } + for (i = 0; i < signature->element_count; ++i) { variable_idx = vkd3d_dxbc_compiler_get_output_variable_index(compiler, @@ -4162,7 +4220,7 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ continue; vkd3d_dxbc_compiler_emit_store_shader_output(compiler, - &signature->elements[i], &compiler->output_info[i], + &signature->elements[i], &compiler->output_info[i], output_index_id, param_id[variable_idx], compiler->private_output_variable_write_mask[variable_idx]); }
1
0
0
0
Józef Kucia : vkd3d-shader: Handle partial shader output updates in epilogue functions.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: 0328118947c8d717604b02264a58e3bc5bfa771e URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=0328118947c8d717604b022…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:27:56 2019 +0100 vkd3d-shader: Handle partial shader output updates in epilogue functions. Fork and join phases quite often write only a few components of an output variable. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index 9aee692..0e6df47 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -1980,6 +1980,7 @@ struct vkd3d_dxbc_compiler uint32_t array_element_mask; } *output_info; uint32_t private_output_variable[MAX_REG_OUTPUT + 1]; /* 1 entry for oDepth */ + uint32_t private_output_variable_write_mask[MAX_REG_OUTPUT + 1]; /* 1 entry for oDepth */ uint32_t epilogue_function_id; uint32_t dummy_sampler_id; @@ -3998,6 +3999,7 @@ static void vkd3d_dxbc_compiler_emit_output(struct vkd3d_dxbc_compiler *compiler { unsigned int idx = vkd3d_dxbc_compiler_get_output_variable_index(compiler, reg->idx[0].offset); compiler->private_output_variable[idx] = var_id; + compiler->private_output_variable_write_mask[idx] |= dst->write_mask; if (!compiler->epilogue_function_id) compiler->epilogue_function_id = vkd3d_spirv_alloc_id(builder); } @@ -4045,15 +4047,16 @@ static void vkd3d_dxbc_compiler_emit_shader_phase_output(struct vkd3d_dxbc_compi static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_signature_element *output, - const struct vkd3d_shader_output_info *output_info, uint32_t val_id) + const struct vkd3d_shader_output_info *output_info, uint32_t val_id, unsigned int write_mask) { + unsigned int dst_write_mask, use_mask, uninit_mask, swizzle, mask; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; uint32_t type_id, zero_id, ptr_type_id, chain_id, object_id; - uint32_t write_mask, use_mask, uninit_mask, swizzle, mask; - uint32_t output_id, indexes[1]; unsigned int i, index; + uint32_t output_id; - write_mask = output->mask & 0xff; + dst_write_mask = output->mask & 0xff; + write_mask &= dst_write_mask; use_mask = (output->mask >> 8) & 0xff; if (output_info->component_type != VKD3D_TYPE_FLOAT) @@ -4063,10 +4066,11 @@ static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compi } swizzle = get_shader_output_swizzle(compiler, output->register_index); - uninit_mask = write_mask & use_mask; + uninit_mask = dst_write_mask & use_mask; if (uninit_mask) { /* Set values to 0 for not initialized shader output components. */ + write_mask |= uninit_mask; zero_id = vkd3d_dxbc_compiler_get_constant_vector(compiler, output_info->component_type, VKD3D_VEC4_SIZE, 0); val_id = vkd3d_dxbc_compiler_emit_vector_shuffle(compiler, @@ -4083,7 +4087,8 @@ static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compi if (!output_info->array_element_mask) { - vkd3d_spirv_build_op_store(builder, output_id, val_id, SpvMemoryAccessMaskNone); + vkd3d_dxbc_compiler_emit_store(compiler, + output_id, dst_write_mask, output_info->component_type, SpvStorageClassOutput, write_mask, val_id); return; } @@ -4096,12 +4101,13 @@ static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compi if (!(write_mask & (VKD3DSP_WRITEMASK_0 << i))) continue; - indexes[0] = vkd3d_dxbc_compiler_get_constant_uint(compiler, index++); - chain_id = vkd3d_spirv_build_op_access_chain(builder, ptr_type_id, - output_id, indexes, ARRAY_SIZE(indexes)); + chain_id = vkd3d_spirv_build_op_access_chain1(builder, + ptr_type_id, output_id, vkd3d_dxbc_compiler_get_constant_uint(compiler, index)); object_id = vkd3d_dxbc_compiler_emit_swizzle(compiler, val_id, write_mask, output_info->component_type, VKD3D_NO_SWIZZLE, VKD3DSP_WRITEMASK_0 << i); - vkd3d_spirv_build_op_store(builder, chain_id, object_id, SpvMemoryAccessMaskNone); + vkd3d_dxbc_compiler_emit_store(compiler, chain_id, VKD3DSP_WRITEMASK_0 << index, + output_info->component_type, SpvStorageClassOutput, VKD3DSP_WRITEMASK_0 << i, object_id); + ++index; } } @@ -4116,6 +4122,7 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ STATIC_ASSERT(ARRAY_SIZE(compiler->private_output_variable) == ARRAY_SIZE(param_id)); STATIC_ASSERT(ARRAY_SIZE(compiler->private_output_variable) == ARRAY_SIZE(param_type_id)); + STATIC_ASSERT(ARRAY_SIZE(compiler->private_output_variable) == ARRAY_SIZE(compiler->private_output_variable_write_mask)); function_id = compiler->epilogue_function_id; @@ -4155,7 +4162,8 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ continue; vkd3d_dxbc_compiler_emit_store_shader_output(compiler, - &signature->elements[i], &compiler->output_info[i], param_id[variable_idx]); + &signature->elements[i], &compiler->output_info[i], + param_id[variable_idx], compiler->private_output_variable_write_mask[variable_idx]); } vkd3d_spirv_build_op_return(&compiler->spirv_builder); @@ -4163,6 +4171,7 @@ static void vkd3d_dxbc_compiler_emit_shader_epilogue_function(struct vkd3d_dxbc_ memset(compiler->output_info, 0, signature->element_count * sizeof(*compiler->output_info)); memset(compiler->private_output_variable, 0, sizeof(compiler->private_output_variable)); + memset(compiler->private_output_variable_write_mask, 0, sizeof(compiler->private_output_variable_write_mask)); compiler->epilogue_function_id = 0; }
1
0
0
0
Józef Kucia : vkd3d-shader: Add more advanced helper for vector shuffle.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: bc441fd6c6535a045914236969ec111ac886157d URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=bc441fd6c6535a045914236…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:27:55 2019 +0100 vkd3d-shader: Add more advanced helper for vector shuffle. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 43 ++++++++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index a925d68..9aee692 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -2669,22 +2669,22 @@ static uint32_t vkd3d_dxbc_compiler_emit_swizzle(struct vkd3d_dxbc_compiler *com } static uint32_t vkd3d_dxbc_compiler_emit_vector_shuffle(struct vkd3d_dxbc_compiler *compiler, - uint32_t vector1_id, uint32_t vector2_id, uint32_t write_mask, + uint32_t vector1_id, uint32_t vector2_id, unsigned int swizzle, unsigned int write_mask, enum vkd3d_component_type component_type, unsigned int component_count) { struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; uint32_t components[VKD3D_VEC4_SIZE]; - unsigned int i, component_idx; uint32_t type_id; + unsigned int i; assert(component_count <= ARRAY_SIZE(components)); - for (i = 0, component_idx = 0; i < component_count; ++i) + for (i = 0; i < component_count; ++i) { if (write_mask & (VKD3DSP_WRITEMASK_0 << i)) - components[i] = VKD3D_VEC4_SIZE + component_idx++; + components[i] = vkd3d_swizzle_get_component(swizzle, i); else - components[i] = i; + components[i] = VKD3D_VEC4_SIZE + vkd3d_swizzle_get_component(swizzle, i); } type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count); @@ -2926,6 +2926,8 @@ static void vkd3d_dxbc_compiler_emit_store(struct vkd3d_dxbc_compiler *compiler, { struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; unsigned int component_count, dst_component_count; + uint32_t components[VKD3D_VEC4_SIZE]; + unsigned int i, component_idx; uint32_t type_id, dst_val_id; assert(write_mask); @@ -2944,8 +2946,18 @@ static void vkd3d_dxbc_compiler_emit_store(struct vkd3d_dxbc_compiler *compiler, type_id = vkd3d_spirv_get_type_id(builder, component_type, dst_component_count); dst_val_id = vkd3d_spirv_build_op_load(builder, type_id, dst_id, SpvMemoryAccessMaskNone); - val_id = vkd3d_dxbc_compiler_emit_vector_shuffle(compiler, - dst_val_id, val_id, write_mask, component_type, dst_component_count); + assert(component_count <= ARRAY_SIZE(components)); + + for (i = 0, component_idx = 0; i < dst_component_count; ++i) + { + if (write_mask & (VKD3DSP_WRITEMASK_0 << i)) + components[i] = VKD3D_VEC4_SIZE + component_idx++; + else + components[i] = i; + } + + val_id = vkd3d_spirv_build_op_vector_shuffle(builder, + type_id, dst_val_id, val_id, components, dst_component_count); } vkd3d_spirv_build_op_store(builder, dst_id, val_id, SpvMemoryAccessMaskNone); @@ -4039,23 +4051,18 @@ static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compi uint32_t type_id, zero_id, ptr_type_id, chain_id, object_id; uint32_t write_mask, use_mask, uninit_mask, swizzle, mask; uint32_t output_id, indexes[1]; - unsigned int component_count; unsigned int i, index; write_mask = output->mask & 0xff; use_mask = (output->mask >> 8) & 0xff; - swizzle = get_shader_output_swizzle(compiler, output->register_index); - val_id = vkd3d_dxbc_compiler_emit_swizzle(compiler, - val_id, VKD3DSP_WRITEMASK_ALL, VKD3D_TYPE_FLOAT, swizzle, write_mask); - - component_count = vkd3d_write_mask_component_count(write_mask); if (output_info->component_type != VKD3D_TYPE_FLOAT) { - type_id = vkd3d_spirv_get_type_id(builder, output_info->component_type, component_count); + type_id = vkd3d_spirv_get_type_id(builder, output_info->component_type, VKD3D_VEC4_SIZE); val_id = vkd3d_spirv_build_op_bitcast(builder, type_id, val_id); } + swizzle = get_shader_output_swizzle(compiler, output->register_index); uninit_mask = write_mask & use_mask; if (uninit_mask) { @@ -4063,7 +4070,13 @@ static void vkd3d_dxbc_compiler_emit_store_shader_output(struct vkd3d_dxbc_compi zero_id = vkd3d_dxbc_compiler_get_constant_vector(compiler, output_info->component_type, VKD3D_VEC4_SIZE, 0); val_id = vkd3d_dxbc_compiler_emit_vector_shuffle(compiler, - val_id, zero_id, uninit_mask, output_info->component_type, component_count); + zero_id, val_id, swizzle, uninit_mask, output_info->component_type, + vkd3d_write_mask_component_count(write_mask)); + } + else + { + val_id = vkd3d_dxbc_compiler_emit_swizzle(compiler, + val_id, VKD3DSP_WRITEMASK_ALL, output_info->component_type, swizzle, write_mask); } output_id = output_info->id;
1
0
0
0
Józef Kucia : vkd3d-shader: Remove output register symbols while leaving control point phase.
by Alexandre Julliard
26 Feb '19
26 Feb '19
Module: vkd3d Branch: master Commit: 6c70edf511c17ab6ee538d9cf3852868a90dea7f URL:
https://source.winehq.org/git/vkd3d.git/?a=commit;h=6c70edf511c17ab6ee538d9…
Author: Józef Kucia <jkucia(a)codeweavers.com> Date: Tue Feb 26 12:27:54 2019 +0100 vkd3d-shader: Remove output register symbols while leaving control point phase. Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com> Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- libs/vkd3d-shader/spirv.c | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c index e169aa0..a925d68 100644 --- a/libs/vkd3d-shader/spirv.c +++ b/libs/vkd3d-shader/spirv.c @@ -5124,9 +5124,12 @@ static void vkd3d_dxbc_compiler_emit_dcl_thread_group(struct vkd3d_dxbc_compiler static void vkd3d_dxbc_compiler_leave_shader_phase(struct vkd3d_dxbc_compiler *compiler, const struct vkd3d_shader_phase *phase) { + const struct vkd3d_shader_signature *signature = compiler->output_signature; struct vkd3d_spirv_builder *builder = &compiler->spirv_builder; struct vkd3d_shader_register reg; struct vkd3d_symbol reg_symbol; + struct rb_entry *entry; + unsigned int i; vkd3d_spirv_build_op_function_end(builder); @@ -5139,12 +5142,41 @@ static void vkd3d_dxbc_compiler_leave_shader_phase(struct vkd3d_dxbc_compiler *c compiler->temp_id = 0; compiler->temp_count = 0; + /* + * Output regsiters have a different purpose in the control point phase and + * in fork/join phases. We have to remove all output registers' symbols + * when leaving the control point phase. + */ + if (phase->type == VKD3DSIH_HS_CONTROL_POINT_PHASE) + { + memset(®, 0, sizeof(reg)); + reg.type = VKD3DSPR_OUTPUT; + reg.idx[1].offset = ~0u; + + for (i = 0; i < signature->element_count; ++i) + { + const struct vkd3d_shader_signature_element *e = &signature->elements[i]; + + reg.idx[0].offset = e->register_index; + vkd3d_symbol_make_register(®_symbol, ®); + if ((entry = rb_get(&compiler->symbol_table, ®_symbol))) + { + rb_remove(&compiler->symbol_table, entry); + vkd3d_symbol_free(entry, NULL); + } + } + } + if (phase->instance_count) { reg.type = phase->type == VKD3DSIH_HS_FORK_PHASE ? VKD3DSPR_FORKINSTID : VKD3DSPR_JOININSTID; reg.idx[0].offset = ~0u; vkd3d_symbol_make_register(®_symbol, ®); - rb_remove_key(&compiler->symbol_table, ®_symbol); + if ((entry = rb_get(&compiler->symbol_table, ®_symbol))) + { + rb_remove(&compiler->symbol_table, entry); + vkd3d_symbol_free(entry, NULL); + } } }
1
0
0
0
← Newer
1
...
7
8
9
10
11
12
13
...
68
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
Results per page:
10
25
50
100
200