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
September 2018
- 70 participants
- 1549 messages
[PATCH vkd3d 4/8] tests: Add test for ld instruction with texel offsets.
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 | 219 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 219 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 221157faa53f..659a5c6a2208 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -9209,6 +9209,224 @@ static void test_texture(void)
destroy_test_context(&context);
}
+static void test_texture_ld(void)
+{
+ ID3D12GraphicsCommandList *command_list;
+ D3D12_GPU_DESCRIPTOR_HANDLE gpu_handle;
+ struct test_context_desc desc;
+ struct test_context context;
+ ID3D12DescriptorHeap *heap;
+ ID3D12CommandQueue *queue;
+ ID3D12Resource *texture;
+ unsigned int i;
+
+ static const DWORD ps_ld_code[] =
+ {
+#if 0
+ Texture2D t;
+
+ int2 offset;
+ uint2 location;
+
+ float4 main() : SV_Target
+ {
+ switch (offset.x)
+ {
+ case -1:
+ switch (offset.y)
+ {
+ case -2: return t.Load(uint3(location, 0), int2(-1, -2));
+ case -1: return t.Load(uint3(location, 0), int2(-1, -1));
+ case 0: return t.Load(uint3(location, 0), int2(-1, 0));
+ case 1: return t.Load(uint3(location, 0), int2(-1, 1));
+ case 2: return t.Load(uint3(location, 0), int2(-1, 2));
+ }
+ break;
+ case 0:
+ switch (offset.y)
+ {
+ case -2: return t.Load(uint3(location, 0), int2(0, -2));
+ case -1: return t.Load(uint3(location, 0), int2(0, -1));
+ case 0: return t.Load(uint3(location, 0), int2(0, 0));
+ case 1: return t.Load(uint3(location, 0), int2(0, 1));
+ case 2: return t.Load(uint3(location, 0), int2(0, 2));
+ }
+ break;
+ case 1:
+ switch (offset.y)
+ {
+ case -2: return t.Load(uint3(location, 0), int2(1, -2));
+ case -1: return t.Load(uint3(location, 0), int2(1, -1));
+ case 0: return t.Load(uint3(location, 0), int2(1, 0));
+ case 1: return t.Load(uint3(location, 0), int2(1, 1));
+ case 2: return t.Load(uint3(location, 0), int2(1, 2));
+ }
+ break;
+ }
+
+ return t.Load(uint3(location, 0));
+ }
+#endif
+ 0x43425844, 0xe925cc02, 0x43ea9623, 0xb67c6425, 0xb4503305, 0x00000001, 0x00000844, 0x00000003,
+ 0x0000002c, 0x0000003c, 0x00000070, 0x4e475349, 0x00000008, 0x00000000, 0x00000008, 0x4e47534f,
+ 0x0000002c, 0x00000001, 0x00000008, 0x00000020, 0x00000000, 0x00000000, 0x00000003, 0x00000000,
+ 0x0000000f, 0x545f5653, 0x65677261, 0xabab0074, 0x58454853, 0x000007cc, 0x00000050, 0x000001f3,
+ 0x0100086a, 0x04000059, 0x00208e46, 0x00000000, 0x00000001, 0x04001858, 0x00107000, 0x00000000,
+ 0x00005555, 0x03000065, 0x001020f2, 0x00000000, 0x02000068, 0x00000001, 0x0400004c, 0x0020800a,
+ 0x00000000, 0x00000000, 0x03000006, 0x00004001, 0xffffffff, 0x0400004c, 0x0020801a, 0x00000000,
+ 0x00000000, 0x03000006, 0x00004001, 0xfffffffe, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6,
+ 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x8a00002d, 0x8001de01, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000,
+ 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x03000006, 0x00004001, 0xffffffff,
+ 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036, 0x001000c2,
+ 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d, 0x8001fe01,
+ 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000,
+ 0x0100003e, 0x03000006, 0x00004001, 0x00000000, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6,
+ 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x8a00002d, 0x80001e01, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000,
+ 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x03000006, 0x00004001, 0x00000001,
+ 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036, 0x001000c2,
+ 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d, 0x80003e01,
+ 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000,
+ 0x0100003e, 0x03000006, 0x00004001, 0x00000002, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6,
+ 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000,
+ 0x00000000, 0x00000000, 0x8a00002d, 0x80005e01, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000,
+ 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x0100000a, 0x01000002, 0x01000017,
+ 0x01000002, 0x03000006, 0x00004001, 0x00000000, 0x0400004c, 0x0020801a, 0x00000000, 0x00000000,
+ 0x03000006, 0x00004001, 0xfffffffe, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000,
+ 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x8a00002d, 0x8001c001, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46,
+ 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x03000006, 0x00004001, 0xffffffff, 0x06000036,
+ 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000,
+ 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d, 0x8001e001, 0x800000c2,
+ 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e,
+ 0x03000006, 0x00004001, 0x00000000, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000,
+ 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000,
+ 0x00000000, 0x8900002d, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000,
+ 0x00107e46, 0x00000000, 0x0100003e, 0x03000006, 0x00004001, 0x00000001, 0x06000036, 0x00100032,
+ 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002,
+ 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d, 0x80002001, 0x800000c2, 0x00155543,
+ 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x03000006,
+ 0x00004001, 0x00000002, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000,
+ 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000,
+ 0x8a00002d, 0x80004001, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000,
+ 0x00107e46, 0x00000000, 0x0100003e, 0x0100000a, 0x01000002, 0x01000017, 0x01000002, 0x03000006,
+ 0x00004001, 0x00000001, 0x0400004c, 0x0020801a, 0x00000000, 0x00000000, 0x03000006, 0x00004001,
+ 0xfffffffe, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036,
+ 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d,
+ 0x8001c201, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46,
+ 0x00000000, 0x0100003e, 0x03000006, 0x00004001, 0xffffffff, 0x06000036, 0x00100032, 0x00000000,
+ 0x00208ae6, 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x8a00002d, 0x8001e201, 0x800000c2, 0x00155543, 0x001020f2,
+ 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x03000006, 0x00004001,
+ 0x00000000, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036,
+ 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d,
+ 0x80000201, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46,
+ 0x00000000, 0x0100003e, 0x03000006, 0x00004001, 0x00000001, 0x06000036, 0x00100032, 0x00000000,
+ 0x00208ae6, 0x00000000, 0x00000000, 0x08000036, 0x001000c2, 0x00000000, 0x00004002, 0x00000000,
+ 0x00000000, 0x00000000, 0x00000000, 0x8a00002d, 0x80002201, 0x800000c2, 0x00155543, 0x001020f2,
+ 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000, 0x0100003e, 0x03000006, 0x00004001,
+ 0x00000002, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036,
+ 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8a00002d,
+ 0x80004201, 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46,
+ 0x00000000, 0x0100003e, 0x0100000a, 0x01000002, 0x01000017, 0x01000002, 0x0100000a, 0x01000002,
+ 0x01000017, 0x06000036, 0x00100032, 0x00000000, 0x00208ae6, 0x00000000, 0x00000000, 0x08000036,
+ 0x001000c2, 0x00000000, 0x00004002, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x8900002d,
+ 0x800000c2, 0x00155543, 0x001020f2, 0x00000000, 0x00100e46, 0x00000000, 0x00107e46, 0x00000000,
+ 0x0100003e,
+ };
+ static const D3D12_SHADER_BYTECODE ps_ld = {ps_ld_code, sizeof(ps_ld_code)};
+ static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
+ static const unsigned int texture_data[] =
+ {
+ 0xff0008ff, 0xff00ffff, 0xff00ff05, 0xffffff01,
+ 0xffff0007, 0xffff00ff, 0x11111101, 0xff7f7f7f,
+ 0x44444f44, 0x88888888, 0x22222222, 0xff000002,
+ 0x66f66666, 0xff000000, 0xff000003, 0x55555555,
+ };
+ static const D3D12_SUBRESOURCE_DATA resource_data = {&texture_data, sizeof(texture_data) / 4};
+ static const struct
+ {
+ int32_t constants[4];
+ unsigned int expected_color;
+ }
+ tests[] =
+ {
+ {{ 0, 0, 0, 0}, 0xff0008ff},
+ {{ 1, 0, 0, 0}, 0xff00ffff},
+ {{ 0, 1, 0, 0}, 0xffff0007},
+ {{ 1, 1, 0, 0}, 0xffff00ff},
+ {{ 3, 3, 0, 0}, 0xff0008ff},
+ {{ 3, 3, 1, 1}, 0xffff00ff},
+ {{ 0, 0, 3, 3}, 0x55555555},
+ {{-1, -1, 3, 3}, 0x22222222},
+ {{-1, -2, 3, 3}, 0x11111101},
+ {{ 0, -1, 3, 3}, 0xff000002},
+ {{ 0, -2, 3, 3}, 0xff7f7f7f},
+ {{ 3, 3, 3, 3}, 0x55555555},
+ };
+
+ if (use_warp_device)
+ {
+ skip("WARP device is removed when ps_ld is used.\n");
+ return;
+ }
+
+ memset(&desc, 0, sizeof(desc));
+ desc.rt_width = desc.rt_height = 32;
+ desc.no_root_signature = true;
+ if (!init_test_context(&context, &desc))
+ return;
+ command_list = context.list;
+ queue = context.queue;
+
+ context.root_signature = create_texture_root_signature(context.device,
+ D3D12_SHADER_VISIBILITY_PIXEL, 4, 0);
+ context.pipeline_state = create_pipeline_state(context.device,
+ context.root_signature, context.render_target_desc.Format, NULL, &ps_ld, NULL);
+
+ heap = create_gpu_descriptor_heap(context.device, D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV, 1);
+ gpu_handle = ID3D12DescriptorHeap_GetGPUDescriptorHandleForHeapStart(heap);
+
+ texture = create_default_texture(context.device,
+ 4, 4, DXGI_FORMAT_R8G8B8A8_UNORM, 0, D3D12_RESOURCE_STATE_COPY_DEST);
+ upload_texture_data(texture, &resource_data, 1, queue, command_list);
+ reset_command_list(command_list, context.allocator);
+ transition_resource_state(command_list, texture,
+ D3D12_RESOURCE_STATE_COPY_DEST, D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE);
+ ID3D12Device_CreateShaderResourceView(context.device, texture, NULL,
+ ID3D12DescriptorHeap_GetCPUDescriptorHandleForHeapStart(heap));
+
+ for (i = 0; i < ARRAY_SIZE(tests); ++i)
+ {
+ 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_SetDescriptorHeaps(command_list, 1, &heap);
+ ID3D12GraphicsCommandList_SetGraphicsRootDescriptorTable(command_list, 0, gpu_handle);
+ ID3D12GraphicsCommandList_IASetPrimitiveTopology(command_list, D3D_PRIMITIVE_TOPOLOGY_TRIANGLELIST);
+ ID3D12GraphicsCommandList_RSSetViewports(command_list, 1, &context.viewport);
+ ID3D12GraphicsCommandList_RSSetScissorRects(command_list, 1, &context.scissor_rect);
+ ID3D12GraphicsCommandList_SetGraphicsRoot32BitConstants(command_list, 1,
+ ARRAY_SIZE(tests[i].constants), &tests[i].constants, 0);
+ 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, tests[i].expected_color, 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);
+ }
+
+ ID3D12Resource_Release(texture);
+ ID3D12DescriptorHeap_Release(heap);
+ destroy_test_context(&context);
+}
+
static void test_gather(void)
{
struct
@@ -19285,6 +19503,7 @@ START_TEST(d3d12)
run_test(test_immediate_constant_buffer);
run_test(test_root_constants);
run_test(test_texture);
+ run_test(test_texture_ld);
run_test(test_gather);
run_test(test_cube_maps);
run_test(test_descriptor_tables);
--
2.16.4
Sept. 13, 2018
[PATCH vkd3d 3/8] vkd3d-shader: Implement texel offset for sample instructions.
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 | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index f0e2491a68bd..964bc49b3179 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -5322,7 +5322,7 @@ static void vkd3d_dxbc_compiler_emit_sample(struct vkd3d_dxbc_compiler *compiler
SpvImageOperandsMask operands_mask = 0;
unsigned int image_operand_count = 0;
struct vkd3d_shader_image image;
- uint32_t image_operands[1];
+ uint32_t image_operands[2];
SpvOp op;
switch (instruction->handler_idx)
@@ -5341,11 +5341,16 @@ static void vkd3d_dxbc_compiler_emit_sample(struct vkd3d_dxbc_compiler *compiler
return;
}
- if (vkd3d_shader_instruction_has_texel_offset(instruction))
- FIXME("Texel offset not supported.\n");
-
vkd3d_dxbc_compiler_prepare_sampled_image(compiler, &image,
&src[1].reg, &src[2].reg, VKD3D_IMAGE_FLAG_NONE);
+
+ if (vkd3d_shader_instruction_has_texel_offset(instruction))
+ {
+ operands_mask |= SpvImageOperandsConstOffsetMask;
+ image_operands[image_operand_count++] = vkd3d_dxbc_compiler_emit_texel_offset(compiler,
+ instruction, image.resource_type_info);
+ }
+
sampled_type_id = vkd3d_spirv_get_type_id(builder, image.sampled_type, VKD3D_VEC4_SIZE);
coordinate_id = vkd3d_dxbc_compiler_emit_load_src(compiler, &src[0], VKD3DSP_WRITEMASK_ALL);
val_id = vkd3d_spirv_build_op_image_sample(builder, op, sampled_type_id,
--
2.16.4
Sept. 13, 2018
[PATCH vkd3d 2/8] vkd3d-shader: Implement texel offsets for ld instructions.
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 | 31 +++++++++++++++++--------------
1 file changed, 17 insertions(+), 14 deletions(-)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 10134bf97369..f0e2491a68bd 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -5262,6 +5262,17 @@ static void vkd3d_dxbc_compiler_prepare_sampled_image(struct vkd3d_dxbc_compiler
vkd3d_dxbc_compiler_get_register_id(compiler, sampler_reg), depth_comparison);
}
+static uint32_t vkd3d_dxbc_compiler_emit_texel_offset(struct vkd3d_dxbc_compiler *compiler,
+ const struct vkd3d_shader_instruction *instruction,
+ const struct vkd3d_spirv_resource_type *resource_type_info)
+{
+ const struct vkd3d_shader_texel_offset *offset = &instruction->texel_offset;
+ unsigned int component_count = resource_type_info->offset_component_count;
+ int32_t data[4] = {offset->u, offset->v, offset->w, 0};
+ return vkd3d_dxbc_compiler_get_constant(compiler,
+ VKD3D_TYPE_INT, component_count, (const uint32_t *)data);
+}
+
static void vkd3d_dxbc_compiler_emit_ld(struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_instruction *instruction)
{
@@ -5275,9 +5286,6 @@ static void vkd3d_dxbc_compiler_emit_ld(struct vkd3d_dxbc_compiler *compiler,
uint32_t image_operands[2];
DWORD coordinate_mask;
- if (vkd3d_shader_instruction_has_texel_offset(instruction))
- FIXME("Texel offset not supported.\n");
-
/* OpImageFetch must be used with a sampled image. */
vkd3d_dxbc_compiler_prepare_dummy_sampled_image(compiler, &image, &src[1].reg);
image_id = vkd3d_spirv_build_op_image(builder, image.image_type_id, image.sampled_image_id);
@@ -5291,6 +5299,12 @@ static void vkd3d_dxbc_compiler_emit_ld(struct vkd3d_dxbc_compiler *compiler,
image_operands[image_operand_count++] = vkd3d_dxbc_compiler_emit_load_src(compiler,
&src[0], VKD3DSP_WRITEMASK_3);
}
+ if (vkd3d_shader_instruction_has_texel_offset(instruction))
+ {
+ operands_mask |= SpvImageOperandsConstOffsetMask;
+ image_operands[image_operand_count++] = vkd3d_dxbc_compiler_emit_texel_offset(compiler,
+ instruction, image.resource_type_info);
+ }
val_id = vkd3d_spirv_build_op_image_fetch(builder, type_id,
image_id, coordinate_id, operands_mask, image_operands, image_operand_count);
@@ -5386,17 +5400,6 @@ static void vkd3d_dxbc_compiler_emit_sample_c(struct vkd3d_dxbc_compiler *compil
dst, val_id, image.sampled_type, src[1].swizzle);
}
-static uint32_t vkd3d_dxbc_compiler_emit_texel_offset(struct vkd3d_dxbc_compiler *compiler,
- const struct vkd3d_shader_instruction *instruction,
- const struct vkd3d_spirv_resource_type *resource_type_info)
-{
- const struct vkd3d_shader_texel_offset *offset = &instruction->texel_offset;
- unsigned int component_count = resource_type_info->offset_component_count;
- int32_t data[4] = {offset->u, offset->v, offset->w, 0};
- return vkd3d_dxbc_compiler_get_constant(compiler,
- VKD3D_TYPE_INT, component_count, (const uint32_t *)data);
-}
-
static void vkd3d_dxbc_compiler_emit_gather4(struct vkd3d_dxbc_compiler *compiler,
const struct vkd3d_shader_instruction *instruction)
{
--
2.16.4
Sept. 13, 2018
[PATCH vkd3d 1/8] vkd3d-shader: Add support for more interpolation modifiers.
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 | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/libs/vkd3d-shader/spirv.c b/libs/vkd3d-shader/spirv.c
index 1181c8404f35..10134bf97369 100644
--- a/libs/vkd3d-shader/spirv.c
+++ b/libs/vkd3d-shader/spirv.c
@@ -3973,6 +3973,12 @@ static void vkd3d_dxbc_compiler_emit_interpolation_decorations(struct vkd3d_dxbc
break;
case VKD3DSIM_LINEAR:
break;
+ case VKD3DSIM_LINEAR_CENTROID:
+ vkd3d_spirv_build_op_decorate(builder, id, SpvDecorationCentroid, NULL, 0);
+ break;
+ case VKD3DSIM_LINEAR_NOPERSPECTIVE:
+ vkd3d_spirv_build_op_decorate(builder, id, SpvDecorationNoPerspective, NULL, 0);
+ break;
case VKD3DSIM_LINEAR_SAMPLE:
vkd3d_spirv_enable_capability(builder, SpvCapabilitySampleRateShading);
vkd3d_spirv_build_op_decorate(builder, id, SpvDecorationSample, NULL, 0);
--
2.16.4
Sept. 13, 2018
Re: [PATCH v2 1/3] comctl32/pager: Support toolbar notification conversion.
by Zhiyi Zhang
On 09/13/2018 04:57 PM, Nikolay Sivov wrote:
> On 09/11/2018 03:26 PM, Zhiyi Zhang wrote:
>
>> +/* Text field conversion test behavior flags. */
>> +enum test_conversion_flags
>> +{
>> + CONVERT_SEND = 0x01,
>> + NOT_CONVERT_SEND = 0x02,
>> + CONVERT_RECEIVE = 0x04,
>> + NOT_CONVERT_RECEIVE = 0x08,
>> + NULL_SEND_EMPTY = 0x10,
>> + NOT_NULL_SEND_EMPTY = 0x20
>> +};
> I think those should be called DONT_*, or changed to SEND_NOT_CONVERTED, or DONT_CONVERT_ON_SEND. or similar. And null case something like SEND_EMPTY_IF_NULL,
> otherwise it's hard to understand without looking at what it does. By the way, why is it necessary to have both flags in tests and not in implementation?
Because there are some cases where I don't want to test it at all, for example, notification that have a constant text fields.
If no CONVERT_RECEIVE and NOT_CONVERT_RECEIVE, we can just skip the such tests to avoid writing such constant text fields.
As for implementation, if it's NOT_*, we just skip the process.
>
>> +/* Send notify to test text field conversion. In parent proc notify_generic_text_handler() handles these messages */
>> +static void test_notify_generic_text_helper(HWND pager, void *ptr, size_t size, UINT *mask, UINT required_mask,
>> + WCHAR **text, INT *text_max, UINT code_unicode, UINT code_ansi, DWORD flags)
>> +{
>> + const struct notify_test_send_data *send_datas;
>> + const struct notify_test_receive_data *receive_datas;
> I don't think 'datas' is the word, you can drop _data from structure names, and use send_data for variable.
>
>> +static void _send_notify(HWND pager, UINT unicode, UINT ansi, LPARAM lParam, BOOL code_change)
>> +{
>> + NMHDR *hdr = (NMHDR *)lParam;
>> +
>> + notify_test_info.unicode = unicode;
>> + notify_test_info.id_from = 1;
>> + notify_test_info.hwnd_from = child1_wnd;
>> + notify_test_info.ansi = ansi;
>> + notify_test_info.received = FALSE;
>> +
>> + hdr->code = unicode;
>> + hdr->idFrom = 1;
>> + hdr->hwndFrom = child1_wnd;
>> +
>> + SendMessageW(pager, WM_NOTIFY, hdr->idFrom, lParam);
>> + ok(notify_test_info.received, "Expect notification received\n");
>> + ok(hdr->code == code_change ? ansi : unicode, "Expect 0x%08x, got 0x%08x\n", hdr->code,
>> + code_change ? ansi : unicode);
>> +}
>> +
>> +#define send_notify(a, b, c, d) _send_notify(pager, a, b, c, d)
>
> Saving one argument is not worth it, it's usually done like that if you want to pass line number to ok_(), otherwise I don't see a point.
>
>> + for (i = 0; i < ARRAY_SIZE(paras); i++)
>> + {
>> + const struct generic_text_helper_para *p = paras + i;
>> + test_notify_generic_text_helper(pager, p->ptr, p->size, p->mask, p->required_mask, p->text, p->text_max,
>> + p->code_unicode, p->code_ansi, p->flags);
>> + }
> Is it possible to pass structure pointer here?
>
>
Sept. 13, 2018
Re: [PATCH v2 1/3] comctl32/pager: Support toolbar notification conversion.
by Zhiyi Zhang
On 09/13/2018 04:57 PM, Nikolay Sivov wrote:
> On 09/11/2018 03:26 PM, Zhiyi Zhang wrote:
>
>> +/* Text field conversion test behavior flags. */
>> +enum test_conversion_flags
>> +{
>> + CONVERT_SEND = 0x01,
>> + NOT_CONVERT_SEND = 0x02,
>> + CONVERT_RECEIVE = 0x04,
>> + NOT_CONVERT_RECEIVE = 0x08,
>> + NULL_SEND_EMPTY = 0x10,
>> + NOT_NULL_SEND_EMPTY = 0x20
>> +};
> I think those should be called DONT_*, or changed to SEND_NOT_CONVERTED, or DONT_CONVERT_ON_SEND. or similar. And null case something like SEND_EMPTY_IF_NULL,
> otherwise it's hard to understand without looking at what it does. By the way, why is it necessary to have both flags in tests and not in implementation?
Because there are some cases where I don't want to test it at all, for example, notification that have a constant text fields.
If no CONVERT_RECEIVE and NOT_CONVERT_RECEIVE, we can just skip the such tests to avoid writing such constant text fields.
As for implementation, if it's NOT_*, we just skip the process.
>
>> +/* Send notify to test text field conversion. In parent proc notify_generic_text_handler() handles these messages */
>> +static void test_notify_generic_text_helper(HWND pager, void *ptr, size_t size, UINT *mask, UINT required_mask,
>> + WCHAR **text, INT *text_max, UINT code_unicode, UINT code_ansi, DWORD flags)
>> +{
>> + const struct notify_test_send_data *send_datas;
>> + const struct notify_test_receive_data *receive_datas;
> I don't think 'datas' is the word, you can drop _data from structure names, and use send_data for variable.
>
>> +static void _send_notify(HWND pager, UINT unicode, UINT ansi, LPARAM lParam, BOOL code_change)
>> +{
>> + NMHDR *hdr = (NMHDR *)lParam;
>> +
>> + notify_test_info.unicode = unicode;
>> + notify_test_info.id_from = 1;
>> + notify_test_info.hwnd_from = child1_wnd;
>> + notify_test_info.ansi = ansi;
>> + notify_test_info.received = FALSE;
>> +
>> + hdr->code = unicode;
>> + hdr->idFrom = 1;
>> + hdr->hwndFrom = child1_wnd;
>> +
>> + SendMessageW(pager, WM_NOTIFY, hdr->idFrom, lParam);
>> + ok(notify_test_info.received, "Expect notification received\n");
>> + ok(hdr->code == code_change ? ansi : unicode, "Expect 0x%08x, got 0x%08x\n", hdr->code,
>> + code_change ? ansi : unicode);
>> +}
>> +
>> +#define send_notify(a, b, c, d) _send_notify(pager, a, b, c, d)
>
> Saving one argument is not worth it, it's usually done like that if you want to pass line number to ok_(), otherwise I don't see a point.
>
>> + for (i = 0; i < ARRAY_SIZE(paras); i++)
>> + {
>> + const struct generic_text_helper_para *p = paras + i;
>> + test_notify_generic_text_helper(pager, p->ptr, p->size, p->mask, p->required_mask, p->text, p->text_max,
>> + p->code_unicode, p->code_ansi, p->flags);
>> + }
> Is it possible to pass structure pointer here?
>
>
Sept. 13, 2018
Re: [PATCH v2 1/3] comctl32/pager: Support toolbar notification conversion.
by Nikolay Sivov
On 09/11/2018 03:26 PM, Zhiyi Zhang wrote:
> +/* Text field conversion test behavior flags. */
> +enum test_conversion_flags
> +{
> + CONVERT_SEND = 0x01,
> + NOT_CONVERT_SEND = 0x02,
> + CONVERT_RECEIVE = 0x04,
> + NOT_CONVERT_RECEIVE = 0x08,
> + NULL_SEND_EMPTY = 0x10,
> + NOT_NULL_SEND_EMPTY = 0x20
> +};
I think those should be called DONT_*, or changed to SEND_NOT_CONVERTED,
or DONT_CONVERT_ON_SEND. or similar. And null case something like
SEND_EMPTY_IF_NULL,
otherwise it's hard to understand without looking at what it does. By
the way, why is it necessary to have both flags in tests and not in
implementation?
> +/* Send notify to test text field conversion. In parent proc notify_generic_text_handler() handles these messages */
> +static void test_notify_generic_text_helper(HWND pager, void *ptr, size_t size, UINT *mask, UINT required_mask,
> + WCHAR **text, INT *text_max, UINT code_unicode, UINT code_ansi, DWORD flags)
> +{
> + const struct notify_test_send_data *send_datas;
> + const struct notify_test_receive_data *receive_datas;
I don't think 'datas' is the word, you can drop _data from structure
names, and use send_data for variable.
> +static void _send_notify(HWND pager, UINT unicode, UINT ansi, LPARAM lParam, BOOL code_change)
> +{
> + NMHDR *hdr = (NMHDR *)lParam;
> +
> + notify_test_info.unicode = unicode;
> + notify_test_info.id_from = 1;
> + notify_test_info.hwnd_from = child1_wnd;
> + notify_test_info.ansi = ansi;
> + notify_test_info.received = FALSE;
> +
> + hdr->code = unicode;
> + hdr->idFrom = 1;
> + hdr->hwndFrom = child1_wnd;
> +
> + SendMessageW(pager, WM_NOTIFY, hdr->idFrom, lParam);
> + ok(notify_test_info.received, "Expect notification received\n");
> + ok(hdr->code == code_change ? ansi : unicode, "Expect 0x%08x, got 0x%08x\n", hdr->code,
> + code_change ? ansi : unicode);
> +}
> +
> +#define send_notify(a, b, c, d) _send_notify(pager, a, b, c, d)
Saving one argument is not worth it, it's usually done like that if you
want to pass line number to ok_(), otherwise I don't see a point.
> + for (i = 0; i < ARRAY_SIZE(paras); i++)
> + {
> + const struct generic_text_helper_para *p = paras + i;
> + test_notify_generic_text_helper(pager, p->ptr, p->size, p->mask, p->required_mask, p->text, p->text_max,
> + p->code_unicode, p->code_ansi, p->flags);
> + }
Is it possible to pass structure pointer here?
Sept. 13, 2018
[PATCH 8/8] wsdapi: Prefer Wine version.
by Owen Rudge
Signed-off-by: Owen Rudge <orudge(a)codeweavers.com>
---
dlls/wsdapi/main.c | 2 --
1 file changed, 2 deletions(-)
Sept. 13, 2018
[PATCH 7/8] wsdapi: Don't include null character at the end of sent messages.
by Owen Rudge
Signed-off-by: Owen Rudge <orudge(a)codeweavers.com>
---
dlls/wsdapi/soap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Sept. 13, 2018
[PATCH 6/8] wsdapi: Send Probe Matches message via UDP unicast.
by Owen Rudge
Signed-off-by: Owen Rudge <orudge(a)codeweavers.com>
---
dlls/wsdapi/network.c | 32 ++++++++++++++++++++++++++++++++
dlls/wsdapi/soap.c | 4 ++--
dlls/wsdapi/tests/discovery.c | 22 +++++++++++-----------
dlls/wsdapi/wsdapi_internal.h | 1 +
4 files changed, 46 insertions(+), 13 deletions(-)
Sept. 13, 2018