Wine-Devel
By thread
wine-devel@list.winehq.org
By month
Messages by month
- ----- 2026 -----
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2006 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2005 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2004 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2003 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2002 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2001 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
October 2018
- 60 participants
- 1315 messages
Re: [PATCH 1/3 v2] ntdll/tests: Add more I/O blocking and completion tests.
by Jacek Caban
On 10/31/2018 03:45 PM, Marvin wrote:
> Hi,
>
> While running your changed tests on Windows, I think I found new failures.
> Being a bot and all I'm not very good at pattern recognition, so I might be
> wrong, but could you please double-check?
>
> Full results can be found at:
> https://testbot.winehq.org/JobDetails.pl?Key=43740
>
> Your paranoid android.
>
>
> === debian9 (32 bit Wine report) ===
>
> ntdll:
> pipe.c:1612: Test failed: pipe is not signaled
That's a race, I will send a better version.
Jacek
Oct. 31, 2018
Re: [PATCH 2/6] webservices: Try to receive the whole message at once.
by Jacek Caban
Hi Hans,
On 10/31/2018 02:21 PM, Hans Leidekker wrote:
> +static void set_blocking( SOCKET socket, BOOL blocking )
> +{
> + ULONG state = !blocking;
> + ioctlsocket( socket, FIONBIO, &state );
> +}
> +
> +static int sock_peek( SOCKET socket )
> +{
> + int ret;
> + char byte;
> +
> + set_blocking( socket, FALSE );
> + ret = recv( socket, &byte, 1, MSG_PEEK );
> + set_blocking( socket, TRUE );
> + return ret;
> +}
> +
> +static int sock_recv( SOCKET socket, char *buf, int len )
> +{
> + int count, ret = 0;
> + for (;;)
> + {
> + if ((count = recv( socket, buf + ret, len, 0 )) <= 0) break;
> + ret += count;
> + len -= count;
> + if (sock_peek( socket ) != 1) break;
It seems to me that you don't really need sock_peek. You could just set
socket to non-blocking mode after the first successful recv.
Jacek
Oct. 31, 2018
Re: [PATCH 1/3 v2] ntdll/tests: Add more I/O blocking and completion tests.
by Marvin
Hi,
While running your changed tests on Windows, I think I found new failures.
Being a bot and all I'm not very good at pattern recognition, so I might be
wrong, but could you please double-check?
Full results can be found at:
https://testbot.winehq.org/JobDetails.pl?Key=43740
Your paranoid android.
=== debian9 (32 bit Wine report) ===
ntdll:
pipe.c:1612: Test failed: pipe is not signaled
=== debian9 (build log) ===
Oct. 31, 2018
[PATCH vkd3d 5/5] tests: Add test for shader input/output components.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
tests/d3d12.c | 260 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 260 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 47591948ce4d..9832cd8cabda 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -8356,6 +8356,265 @@ static void test_shader_interstage_interface(void)
destroy_test_context(&context);
}
+static void test_shader_input_output_components(void)
+{
+ D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
+ ID3D12GraphicsCommandList *command_list;
+ D3D12_INPUT_LAYOUT_DESC input_layout;
+ D3D12_CPU_DESCRIPTOR_HANDLE rtvs[2];
+ ID3D12Resource *uint_render_target;
+ struct test_context_desc desc;
+ D3D12_VERTEX_BUFFER_VIEW vbv;
+ struct test_context context;
+ ID3D12CommandQueue *queue;
+ ID3D12Resource *vb;
+ HRESULT hr;
+
+ static const DWORD vs1_code[] =
+ {
+#if 0
+ void main(float4 in_position : POSITION, uint4 in_uint : UINT,
+ out float4 out_position : SV_POSITION, out uint out_uint : UINT,
+ out float3 out_float : FLOAT)
+ {
+ out_position = in_position;
+ out_uint = in_uint.y;
+ out_float = float3(1, 2, 3);
+ }
+#endif
+ 0x43425844, 0x0521bc60, 0xd39733a4, 0x1522eea3, 0x0c741ea3, 0x00000001, 0x0000018c, 0x00000003,
+ 0x0000002c, 0x0000007c, 0x000000ec, 0x4e475349, 0x00000048, 0x00000002, 0x00000008, 0x00000038,
+ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000041, 0x00000000, 0x00000000,
+ 0x00000001, 0x00000001, 0x0000020f, 0x49534f50, 0x4e4f4954, 0x4e495500, 0xabab0054, 0x4e47534f,
+ 0x00000068, 0x00000003, 0x00000008, 0x00000050, 0x00000000, 0x00000001, 0x00000003, 0x00000000,
+ 0x0000000f, 0x0000005c, 0x00000000, 0x00000000, 0x00000001, 0x00000001, 0x00000e01, 0x00000061,
+ 0x00000000, 0x00000000, 0x00000003, 0x00000002, 0x00000807, 0x505f5653, 0x5449534f, 0x004e4f49,
+ 0x544e4955, 0x4f4c4600, 0xab005441, 0x58454853, 0x00000098, 0x00010050, 0x00000026, 0x0100086a,
+ 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x00101022, 0x00000001, 0x04000067, 0x001020f2,
+ 0x00000000, 0x00000001, 0x03000065, 0x00102012, 0x00000001, 0x03000065, 0x00102072, 0x00000002,
+ 0x05000036, 0x001020f2, 0x00000000, 0x00101e46, 0x00000000, 0x05000036, 0x00102012, 0x00000001,
+ 0x0010101a, 0x00000001, 0x08000036, 0x00102072, 0x00000002, 0x00004002, 0x3f800000, 0x40000000,
+ 0x40400000, 0x00000000, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE vs1 = {vs1_code, sizeof(vs1_code)};
+ static const DWORD ps1_code[] =
+ {
+#if 0
+ void main(float4 position : SV_POSITION, uint in_uint : UINT,
+ float3 in_float : FLOAT, out float4 out_float : SV_TARGET0,
+ out uint4 out_uint : SV_TARGET1)
+ {
+ out_float.x = position.w;
+ out_float.y = in_uint;
+ out_float.z = in_float.z;
+ out_float.w = 0;
+ out_uint.x = 0xdeadbeef;
+ out_uint.y = 0;
+ out_uint.z = in_uint;
+ out_uint.w = in_float.z;
+ }
+#endif
+ 0x43425844, 0x762dbf5e, 0x2cc83972, 0x60c7aa48, 0xbca6118a, 0x00000001, 0x000001d4, 0x00000003,
+ 0x0000002c, 0x0000009c, 0x000000e8, 0x4e475349, 0x00000068, 0x00000003, 0x00000008, 0x00000050,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000080f, 0x0000005c, 0x00000000, 0x00000000,
+ 0x00000001, 0x00000001, 0x00000101, 0x00000061, 0x00000000, 0x00000000, 0x00000003, 0x00000002,
+ 0x00000407, 0x505f5653, 0x5449534f, 0x004e4f49, 0x544e4955, 0x4f4c4600, 0xab005441, 0x4e47534f,
+ 0x00000044, 0x00000002, 0x00000008, 0x00000038, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
+ 0x0000000f, 0x00000038, 0x00000001, 0x00000000, 0x00000001, 0x00000001, 0x0000000f, 0x545f5653,
+ 0x45475241, 0xabab0054, 0x52444853, 0x000000e4, 0x00000040, 0x00000039, 0x04002064, 0x00101082,
+ 0x00000000, 0x00000001, 0x03000862, 0x00101012, 0x00000001, 0x03001062, 0x00101042, 0x00000002,
+ 0x03000065, 0x001020f2, 0x00000000, 0x03000065, 0x001020f2, 0x00000001, 0x05000056, 0x00102022,
+ 0x00000000, 0x0010100a, 0x00000001, 0x05000036, 0x00102012, 0x00000000, 0x0010103a, 0x00000000,
+ 0x05000036, 0x00102042, 0x00000000, 0x0010102a, 0x00000002, 0x05000036, 0x00102082, 0x00000000,
+ 0x00004001, 0x00000000, 0x0500001c, 0x00102082, 0x00000001, 0x0010102a, 0x00000002, 0x08000036,
+ 0x00102032, 0x00000001, 0x00004002, 0xdeadbeef, 0x00000000, 0x00000000, 0x00000000, 0x05000036,
+ 0x00102042, 0x00000001, 0x0010100a, 0x00000001, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps1 = {ps1_code, sizeof(ps1_code)};
+ static const DWORD vs2_code[] =
+ {
+#if 0
+ void main(float4 in_position : POSITION,
+ float4 in_texcoord0 : TEXCOORD0, float4 in_texcoord1 : TEXCOORD1,
+ float4 in_texcoord2 : TEXCOORD2,
+ out float4 position : Sv_Position,
+ out float2 texcoord0 : TEXCOORD0, out float2 texcoord1 : TEXCOORD1,
+ out float4 texcoord2 : TEXCOORD2, out float3 texcoord3 : TEXCOORD3)
+ {
+ position = in_position;
+ texcoord0 = in_texcoord0.yx;
+ texcoord1 = in_texcoord0.wz;
+ texcoord2 = in_texcoord1;
+ texcoord3 = in_texcoord2.yzx;
+ }
+#endif
+ 0x43425844, 0x6721613b, 0xb997c7e4, 0x8bc3df4d, 0x813c93b9, 0x00000001, 0x00000224, 0x00000003,
+ 0x0000002c, 0x000000b0, 0x00000150, 0x4e475349, 0x0000007c, 0x00000004, 0x00000008, 0x00000068,
+ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x00000f0f, 0x00000071, 0x00000000, 0x00000000,
+ 0x00000003, 0x00000001, 0x00000f0f, 0x00000071, 0x00000001, 0x00000000, 0x00000003, 0x00000002,
+ 0x00000f0f, 0x00000071, 0x00000002, 0x00000000, 0x00000003, 0x00000003, 0x0000070f, 0x49534f50,
+ 0x4e4f4954, 0x58455400, 0x524f4f43, 0xabab0044, 0x4e47534f, 0x00000098, 0x00000005, 0x00000008,
+ 0x00000080, 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000008c, 0x00000000,
+ 0x00000000, 0x00000003, 0x00000001, 0x00000c03, 0x0000008c, 0x00000001, 0x00000000, 0x00000003,
+ 0x00000001, 0x0000030c, 0x0000008c, 0x00000002, 0x00000000, 0x00000003, 0x00000002, 0x0000000f,
+ 0x0000008c, 0x00000003, 0x00000000, 0x00000003, 0x00000003, 0x00000807, 0x505f7653, 0x7469736f,
+ 0x006e6f69, 0x43584554, 0x44524f4f, 0xababab00, 0x52444853, 0x000000cc, 0x00010040, 0x00000033,
+ 0x0300005f, 0x001010f2, 0x00000000, 0x0300005f, 0x001010f2, 0x00000001, 0x0300005f, 0x001010f2,
+ 0x00000002, 0x0300005f, 0x00101072, 0x00000003, 0x04000067, 0x001020f2, 0x00000000, 0x00000001,
+ 0x03000065, 0x00102032, 0x00000001, 0x03000065, 0x001020c2, 0x00000001, 0x03000065, 0x001020f2,
+ 0x00000002, 0x03000065, 0x00102072, 0x00000003, 0x05000036, 0x001020f2, 0x00000000, 0x00101e46,
+ 0x00000000, 0x05000036, 0x001020f2, 0x00000001, 0x00101b16, 0x00000001, 0x05000036, 0x001020f2,
+ 0x00000002, 0x00101e46, 0x00000002, 0x05000036, 0x00102072, 0x00000003, 0x00101496, 0x00000003,
+ 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE vs2 = {vs2_code, sizeof(vs2_code)};
+ static const DWORD ps2_code[] =
+ {
+#if 0
+ void main(float4 position : Sv_Position,
+ float2 texcoord0 : TEXCOORD0, float2 texcoord1 : TEXCOORD1,
+ float4 texcoord2 : TEXCOORD2, float3 texcoord3 : TEXCOORD3,
+ out float4 target0 : Sv_Target0, out uint4 target1 : SV_Target1)
+ {
+ target0.x = texcoord0.x + texcoord0.y;
+ target0.y = texcoord1.x;
+ target0.z = texcoord3.z;
+ target0.w = texcoord1.y;
+
+ target1.x = texcoord2.x;
+ target1.y = texcoord2.y;
+ target1.w = texcoord2.w;
+ target1.z = 0;
+ }
+#endif
+ 0x43425844, 0xa6c0df60, 0x5bf34683, 0xa0093595, 0x98cca724, 0x00000001, 0x000001e8, 0x00000003,
+ 0x0000002c, 0x000000cc, 0x00000120, 0x4e475349, 0x00000098, 0x00000005, 0x00000008, 0x00000080,
+ 0x00000000, 0x00000001, 0x00000003, 0x00000000, 0x0000000f, 0x0000008c, 0x00000000, 0x00000000,
+ 0x00000003, 0x00000001, 0x00000303, 0x0000008c, 0x00000001, 0x00000000, 0x00000003, 0x00000001,
+ 0x00000c0c, 0x0000008c, 0x00000002, 0x00000000, 0x00000003, 0x00000002, 0x00000b0f, 0x0000008c,
+ 0x00000003, 0x00000000, 0x00000003, 0x00000003, 0x00000407, 0x505f7653, 0x7469736f, 0x006e6f69,
+ 0x43584554, 0x44524f4f, 0xababab00, 0x4e47534f, 0x0000004c, 0x00000002, 0x00000008, 0x00000038,
+ 0x00000000, 0x00000000, 0x00000003, 0x00000000, 0x0000000f, 0x00000042, 0x00000001, 0x00000000,
+ 0x00000001, 0x00000001, 0x0000000f, 0x545f7653, 0x65677261, 0x56530074, 0x7261545f, 0x00746567,
+ 0x52444853, 0x000000c0, 0x00000040, 0x00000030, 0x03001062, 0x00101032, 0x00000001, 0x03001062,
+ 0x001010c2, 0x00000001, 0x03001062, 0x001010b2, 0x00000002, 0x03001062, 0x00101042, 0x00000003,
+ 0x03000065, 0x001020f2, 0x00000000, 0x03000065, 0x001020f2, 0x00000001, 0x07000000, 0x00102012,
+ 0x00000000, 0x0010101a, 0x00000001, 0x0010100a, 0x00000001, 0x05000036, 0x001020a2, 0x00000000,
+ 0x00101ea6, 0x00000001, 0x05000036, 0x00102042, 0x00000000, 0x0010102a, 0x00000003, 0x0500001c,
+ 0x001020b2, 0x00000001, 0x00101c46, 0x00000002, 0x05000036, 0x00102042, 0x00000001, 0x00004001,
+ 0x00000000, 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps2 = {ps2_code, sizeof(ps2_code)};
+ static const D3D12_INPUT_ELEMENT_DESC layout_desc[] =
+ {
+ {"POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
+ {"UINT", 0, DXGI_FORMAT_R32G32B32A32_UINT, 0, 16, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
+ {"TEXCOORD", 0, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 32, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
+ {"TEXCOORD", 1, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 48, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
+ {"TEXCOORD", 2, DXGI_FORMAT_R32G32B32A32_FLOAT, 0, 64, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0},
+ };
+ static const struct
+ {
+ struct vec4 position;
+ struct uvec4 u;
+ struct vec4 t0;
+ struct vec4 t1;
+ struct vec4 t2;
+ }
+ quad[] =
+ {
+ {{-1.0f, -1.0f}, {1, 2, 3, 4}, {3.0f, 3.0f, 8.0f, 4.0f}, {9.0f, 5.0f, 3.0f, 1.0f}, {7.0f, 2.0f}},
+ {{-1.0f, 1.0f}, {1, 2, 3, 4}, {3.0f, 3.0f, 8.0f, 4.0f}, {9.0f, 5.0f, 3.0f, 1.0f}, {7.0f, 2.0f}},
+ {{ 1.0f, -1.0f}, {1, 2, 3, 4}, {3.0f, 3.0f, 8.0f, 4.0f}, {9.0f, 5.0f, 3.0f, 1.0f}, {7.0f, 2.0f}},
+ {{ 1.0f, 1.0f}, {1, 2, 3, 4}, {3.0f, 3.0f, 8.0f, 4.0f}, {9.0f, 5.0f, 3.0f, 1.0f}, {7.0f, 2.0f}},
+ };
+ static const struct vec4 expected_vec4[] = {{1.0f, 2.0f, 3.0f, 0.0f}, {6.0f, 4.0f, 7.0f, 8.0f}};
+ static const struct uvec4 expected_uvec4[] = {{0xdeadbeef, 0, 2, 3}, {9, 5, 0, 1}};
+
+ memset(&desc, 0, sizeof(desc));
+ desc.rt_format = DXGI_FORMAT_R32G32B32A32_FLOAT;
+ desc.rt_descriptor_count = 2;
+ desc.no_root_signature = true;
+ if (!init_test_context(&context, &desc))
+ return;
+ command_list = context.list;
+ queue = context.queue;
+
+ context.root_signature = create_empty_root_signature(context.device,
+ D3D12_ROOT_SIGNATURE_FLAG_ALLOW_INPUT_ASSEMBLER_INPUT_LAYOUT);
+
+ input_layout.pInputElementDescs = layout_desc;
+ input_layout.NumElements = ARRAY_SIZE(layout_desc);
+ init_pipeline_state_desc(&pso_desc, context.root_signature, desc.rt_format, &vs1, &ps1, &input_layout);
+ pso_desc.NumRenderTargets = 2;
+ pso_desc.RTVFormats[1] = DXGI_FORMAT_R32G32B32A32_UINT;
+ hr = ID3D12Device_CreateGraphicsPipelineState(context.device, &pso_desc,
+ &IID_ID3D12PipelineState, (void **)&context.pipeline_state);
+ ok(hr == S_OK, "Failed to create graphics pipeline state, hr %#x.\n", hr);
+
+ rtvs[0] = context.rtv;
+ rtvs[1] = get_cpu_rtv_handle(&context, context.rtv_heap, 1);
+ desc.rt_format = pso_desc.RTVFormats[1];
+ create_render_target(&context, &desc, &uint_render_target, &rtvs[1]);
+
+ vb = create_upload_buffer(context.device, sizeof(quad), quad);
+
+ vbv.BufferLocation = ID3D12Resource_GetGPUVirtualAddress(vb);
+ vbv.StrideInBytes = sizeof(*quad);
+ vbv.SizeInBytes = sizeof(quad);
+
+ ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 2, &context.rtv, TRUE, NULL);
+ ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+ ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, 1, &vbv);
+ ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport);
+ ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);
+ ID3D12GraphicsCommandList_DrawInstanced(command_list, 4, 1, 0, 0);
+
+ transition_resource_state(command_list, context.render_target,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_sub_resource_vec4(context.render_target, 0, queue, command_list, &expected_vec4[0], 0);
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, uint_render_target,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_sub_resource_uvec4(uint_render_target, 0, queue, command_list, &expected_uvec4[0]);
+
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, context.render_target,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+ transition_resource_state(command_list, uint_render_target,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+
+ ID3D12PipelineState_Release(context.pipeline_state);
+ pso_desc.VS = vs2;
+ pso_desc.PS = ps2;
+ hr = ID3D12Device_CreateGraphicsPipelineState(context.device, &pso_desc,
+ &IID_ID3D12PipelineState, (void **)&context.pipeline_state);
+ ok(hr == S_OK, "Failed to create graphics pipeline state, hr %#x.\n", hr);
+
+ ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 2, &context.rtv, TRUE, NULL);
+ ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, context.root_signature);
+ ID3D12GraphicsCommandList_SetPipelineState(command_list, context.pipeline_state);
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+ ID3D12GraphicsCommandList_IASetVertexBuffers(command_list, 0, 1, &vbv);
+ ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport);
+ ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);
+ ID3D12GraphicsCommandList_DrawInstanced(command_list, 4, 1, 0, 0);
+
+ transition_resource_state(command_list, context.render_target,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_sub_resource_vec4(context.render_target, 0, queue, command_list, &expected_vec4[1], 0);
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, uint_render_target,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ check_sub_resource_uvec4(uint_render_target, 0, queue, command_list, &expected_uvec4[1]);
+
+ ID3D12Resource_Release(vb);
+ ID3D12Resource_Release(uint_render_target);
+ destroy_test_context(&context);
+}
+
static void test_incompletely_initialized_shader_outputs(void)
{
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
@@ -20914,6 +21173,7 @@ START_TEST(d3d12)
run_test(test_compute_shader_instructions);
run_test(test_discard_instruction);
run_test(test_shader_interstage_interface);
+ run_test(test_shader_input_output_components);
run_test(test_incompletely_initialized_shader_outputs);
run_test(test_root_signature_byte_code);
run_test(test_cs_constant_buffer);
--
2.18.1
Oct. 31, 2018
[PATCH vkd3d 4/5] tests: Introduce check_sub_resource_uvec4().
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
tests/d3d12.c | 51 +++++++++++++++++++++++++++++++++++----------------
1 file changed, 35 insertions(+), 16 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 25c2fdf80439..47591948ce4d 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -826,6 +826,39 @@ static void check_sub_resource_vec4_(unsigned int line, ID3D12Resource *texture,
got.x, got.y, got.z, got.w, expected->x, expected->y, expected->z, expected->w, x, y);
}
+#define check_sub_resource_uvec4(a, b, c, d, e) check_sub_resource_uvec4_(__LINE__, a, b, c, d, e)
+static void check_sub_resource_uvec4_(unsigned int line, ID3D12Resource *texture,
+ unsigned int sub_resource_idx, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list,
+ const struct uvec4 *expected_value)
+{
+ struct resource_readback rb;
+ struct uvec4 value = {};
+ unsigned int x = 0, y;
+ bool all_match = true;
+
+ get_texture_readback_with_command_list(texture, 0, &rb, queue, command_list);
+ for (y = 0; y < rb.height; ++y)
+ {
+ for (x = 0; x < rb.width; ++x)
+ {
+ value = *get_readback_uvec4(&rb, x, y);
+ if (!compare_uvec4(&value, expected_value))
+ {
+ all_match = false;
+ break;
+ }
+ }
+ if (!all_match)
+ break;
+ }
+ release_resource_readback(&rb);
+
+ ok_(line)(all_match,
+ "Got {0x%08x, 0x%08x, 0x%08x, 0x%08x}, expected {0x%08x, 0x%08x, 0x%08x, 0x%08x} at (%u, %u).\n",
+ value.x, value.y, value.z, value.w,
+ expected_value->x, expected_value->y, expected_value->z, expected_value->w, x, y);
+}
+
static bool use_warp_device;
static unsigned int use_adapter_idx;
@@ -5459,10 +5492,9 @@ static void test_shader_instructions(void)
ID3D12GraphicsCommandList *command_list;
struct test_context_desc desc;
struct test_context context;
- struct resource_readback rb;
ID3D12CommandQueue *queue;
- unsigned int i, x, y;
ID3D12Resource *cb;
+ unsigned int i;
HRESULT hr;
static const DWORD ps_div_code[] =
@@ -7850,20 +7882,7 @@ static void test_shader_instructions(void)
transition_resource_state(command_list, context.render_target,
D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
-
- get_texture_readback_with_command_list(context.render_target, 0, &rb, queue, command_list);
- for (y = 0; y < rb.height; ++y)
- {
- for (x = 0; x < rb.width; ++x)
- {
- const struct uvec4 *v = get_readback_uvec4(&rb, x, y);
- ok(compare_uvec4(v, &uint_tests[i].output.u),
- "Got 0x%08x, 0x%08x, 0x%08x, 0x%08x expected 0x%08x, 0x%08x, 0x%08x, 0x%08x.\n",
- v->x, v->y, v->z, v->w, uint_tests[i].output.u.x, uint_tests[i].output.u.y,
- uint_tests[i].output.u.z, uint_tests[i].output.u.w);
- }
- }
- release_resource_readback(&rb);
+ check_sub_resource_uvec4(context.render_target, 0, queue, command_list, &uint_tests[i].output.u);
reset_command_list(command_list, context.allocator);
transition_resource_state(command_list, context.render_target,
--
2.18.1
Oct. 31, 2018
[PATCH vkd3d 3/5] vkd3d-shader: Try harder to avoid using private variables for inputs.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/spirv.c | 43 ++++++++++++++++++++++++++++++---------
1 file changed, 33 insertions(+), 10 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index a754489c060d..e70c2d62be8b 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2442,8 +2442,8 @@ static void vkd3d_dxbc_compiler_emit_dereference_register(struct vkd3d_dxbc_comp
const struct vkd3d_shader_register *reg, struct vkd3d_shader_register_info *register_info)
{
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
+ unsigned int component_count, index_count = 0;
uint32_t type_id, ptr_type_id;
- unsigned int index_count = 0;
uint32_t indexes[2];
if (reg->type == VKD3DSPR_CONSTBUFFER)
@@ -2472,7 +2472,8 @@ static void vkd3d_dxbc_compiler_emit_dereference_register(struct vkd3d_dxbc_comp
if (index_count)
{
- type_id = vkd3d_spirv_get_type_id(builder, VKD3D_TYPE_FLOAT, VKD3D_VEC4_SIZE);
+ component_count = vkd3d_write_mask_component_count(register_info->write_mask);
+ type_id = vkd3d_spirv_get_type_id(builder, register_info->component_type, component_count);
ptr_type_id = vkd3d_spirv_get_op_type_pointer(builder, register_info->storage_class, type_id);
register_info->id = vkd3d_spirv_build_op_access_chain(builder, ptr_type_id,
register_info->id, indexes, index_count);
@@ -2642,8 +2643,9 @@ static uint32_t vkd3d_dxbc_compiler_emit_load_scalar(struct vkd3d_dxbc_compiler
reg_component_count = vkd3d_write_mask_component_count(reg_info->write_mask);
- if (component_idx > reg_component_count)
- ERR("Invalid component_idx for register %#x, %u.\n", reg->type, reg->idx[0].offset);
+ if (!(reg_info->write_mask & (VKD3DSP_WRITEMASK_0 << component_idx)))
+ ERR("Invalid component_idx for register %#x, %u (write_mask %#x).\n",
+ reg->type, reg->idx[0].offset, reg_info->write_mask);
type_id = vkd3d_spirv_get_type_id(builder, reg_info->component_type, 1);
reg_id = reg_info->id;
@@ -3175,6 +3177,20 @@ static const struct vkd3d_shader_signature_element *vkd3d_find_signature_element
return NULL;
}
+static unsigned int vkd3d_count_signature_elements_for_reg(
+ const struct vkd3d_shader_signature *signature, unsigned int reg_idx)
+{
+ unsigned int i, count;
+
+ count = 0;
+ for (i = 0; i < signature->element_count; ++i)
+ {
+ if (signature->elements[i].register_index == reg_idx)
+ ++count;
+ }
+ return count;
+}
+
static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_dst_param *dst, enum vkd3d_shader_input_sysval_semantic sysval)
{
@@ -3228,9 +3244,17 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
else
{
component_type = signature_element->component_type;
- input_component_count = component_count;
+ input_component_count = vkd3d_write_mask_component_count(signature_element->mask & 0xff);
+ component_idx = vkd3d_write_mask_get_component_idx(signature_element->mask & 0xff);
+ }
+
+ use_private_var = builtin && builtin->fixup_pfn;
+ if (input_component_count != VKD3D_VEC4_SIZE
+ && vkd3d_count_signature_elements_for_reg(compiler->input_signature, reg_idx) > 1)
+ {
+ use_private_var = true;
+ component_count = VKD3D_VEC4_SIZE;
}
- assert(component_count <= input_component_count);
storage_class = SpvStorageClassInput;
input_id = vkd3d_dxbc_compiler_emit_array_variable(compiler, &builder->global_stream,
@@ -3247,8 +3271,6 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
vkd3d_spirv_build_op_decorate1(builder, input_id, SpvDecorationComponent, component_idx);
}
- use_private_var = component_count != VKD3D_VEC4_SIZE || (builtin && builtin->fixup_pfn);
-
vkd3d_symbol_make_register(®_symbol, reg);
if (!use_private_var)
@@ -3259,14 +3281,15 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
{
storage_class = SpvStorageClassPrivate;
var_id = vkd3d_dxbc_compiler_emit_array_variable(compiler, &builder->global_stream,
- storage_class, VKD3D_TYPE_FLOAT, VKD3D_VEC4_SIZE, array_size);
+ storage_class, VKD3D_TYPE_FLOAT, component_count, array_size);
}
if (!entry)
{
reg_symbol.id = var_id;
reg_symbol.info.reg.storage_class = storage_class;
reg_symbol.info.reg.component_type = use_private_var ? VKD3D_TYPE_FLOAT : component_type;
- reg_symbol.info.reg.write_mask = VKD3DSP_WRITEMASK_ALL;
+ reg_symbol.info.reg.write_mask = use_private_var
+ ? vkd3d_write_mask_from_component_count(component_count) : signature_element->mask & 0xff;
vkd3d_dxbc_compiler_put_symbol(compiler, ®_symbol);
vkd3d_dxbc_compiler_emit_register_debug_name(builder, var_id, reg);
--
2.18.1
Oct. 31, 2018
[PATCH vkd3d 2/5] vkd3d-shader: Use vkd3d_dxbc_compiler_emit_swizzle_ext() in vkd3d_dxbc_compiler_emit_input().
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/spirv.c | 9 ++++-----
1 file changed, 4 insertions(+), 5 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 9493d53591bb..a754489c060d 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -3223,6 +3223,7 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
{
component_type = builtin->component_type;
input_component_count = builtin->component_count;
+ component_idx = 0;
}
else
{
@@ -3238,8 +3239,6 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
if (builtin)
{
vkd3d_dxbc_compiler_decorate_builtin(compiler, input_id, builtin->spirv_builtin);
- if (component_idx)
- FIXME("Unhandled component index %u.\n", component_idx);
}
else
{
@@ -3301,9 +3300,9 @@ static uint32_t vkd3d_dxbc_compiler_emit_input(struct vkd3d_dxbc_compiler *compi
val_id = vkd3d_spirv_build_op_bitcast(builder, float_type_id, val_id);
}
- if (input_component_count != component_count)
- val_id = vkd3d_dxbc_compiler_emit_swizzle(compiler,
- val_id, VKD3D_TYPE_FLOAT, VKD3D_NO_SWIZZLE, dst->write_mask);
+ val_id = vkd3d_dxbc_compiler_emit_swizzle_ext(compiler, val_id,
+ vkd3d_write_mask_from_component_count(input_component_count) << component_idx,
+ VKD3D_TYPE_FLOAT, VKD3D_NO_SWIZZLE, dst->write_mask);
vkd3d_dxbc_compiler_emit_store_reg(compiler, &dst_reg, dst->write_mask, val_id);
}
--
2.18.1
Oct. 31, 2018
[PATCH vkd3d 1/5] vkd3d-shader: Check more accurately if swizzle is required.
by Józef Kucia
From: Józef Kucia <jkucia(a)codeweavers.com>
Eliminates redundant OpVectorShuffle instructions.
Signed-off-by: Józef Kucia <jkucia(a)codeweavers.com>
---
libs/vkd3d-shader/spirv.c | 8 +++++---
libs/vkd3d-shader/vkd3d_shader_private.h | 16 ++++++++++++++++
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index dee561ac033c..9493d53591bb 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -2528,10 +2528,13 @@ static uint32_t vkd3d_dxbc_compiler_emit_swizzle_ext(struct vkd3d_dxbc_compiler
struct vkd3d_spirv_builder *builder = &compiler->spirv_builder;
uint32_t type_id, components[VKD3D_VEC4_SIZE];
- if (swizzle == VKD3D_NO_SWIZZLE && write_mask == val_write_mask)
+ component_count = vkd3d_write_mask_component_count(write_mask);
+ val_component_count = vkd3d_write_mask_component_count(val_write_mask);
+
+ if (component_count == val_component_count
+ && vkd3d_compact_swizzle(swizzle, write_mask) == vkd3d_compact_swizzle(VKD3D_NO_SWIZZLE, val_write_mask))
return val_id;
- component_count = vkd3d_write_mask_component_count(write_mask);
type_id = vkd3d_spirv_get_type_id(builder, component_type, component_count);
if (component_count == 1)
@@ -2541,7 +2544,6 @@ static uint32_t vkd3d_dxbc_compiler_emit_swizzle_ext(struct vkd3d_dxbc_compiler
return vkd3d_spirv_build_op_composite_extract1(builder, type_id, val_id, component_idx);
}
- val_component_count = vkd3d_write_mask_component_count(val_write_mask);
if (val_component_count == 1)
{
for (i = 0, component_idx = 0; i < VKD3D_VEC4_SIZE; ++i)
diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h
index dd3650b2d828..651a5959f1d1 100644
--- a/libs/vkd3d-shader/vkd3d_shader_private.h
+++ b/libs/vkd3d-shader/vkd3d_shader_private.h
@@ -882,6 +882,22 @@ static inline unsigned int vkd3d_swizzle_get_component(DWORD swizzle,
return (swizzle >> VKD3D_SWIZZLE_SHIFT(idx)) & VKD3D_SWIZZLE_MASK;
}
+static inline unsigned int vkd3d_compact_swizzle(unsigned int swizzle, unsigned int write_mask)
+{
+ unsigned int i, compacted_swizzle = 0;
+
+ for (i = 0; i < VKD3D_VEC4_SIZE; ++i)
+ {
+ if (write_mask & (VKD3DSP_WRITEMASK_0 << i))
+ {
+ compacted_swizzle <<= VKD3D_SWIZZLE_SHIFT(1);
+ compacted_swizzle |= vkd3d_swizzle_get_component(swizzle, i);
+ }
+ }
+
+ return compacted_swizzle;
+}
+
#define VKD3D_DXBC_MAX_SOURCE_COUNT 6
#define VKD3D_DXBC_HEADER_SIZE (8 * sizeof(uint32_t))
--
2.18.1
Oct. 31, 2018
[PATCH 3/3] server: Use file mode flags in async_handoff to decide if request is blocking.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
dlls/ntdll/tests/pipe.c | 20 +++++++-------------
server/async.c | 4 ++--
server/fd.c | 8 ++++----
server/file.h | 2 +-
4 files changed, 14 insertions(+), 20 deletions(-)
Oct. 31, 2018
[PATCH 2/3] server: Introduce is_fd_synchronous helper.
by Jacek Caban
Signed-off-by: Jacek Caban <jacek(a)codeweavers.com>
---
server/fd.c | 10 ++++++++--
server/file.c | 7 +------
server/file.h | 1 +
3 files changed, 10 insertions(+), 8 deletions(-)
Oct. 31, 2018