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
July 2019
- 65 participants
- 633 messages
[PATCH] wldap32: Use ldap_memvfree() to free array allocated by libldap.
by Conor McCarthy
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
dlls/wldap32/parse.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/wldap32/parse.c b/dlls/wldap32/parse.c
index 62ffdbab..e83e6d23 100644
--- a/dlls/wldap32/parse.c
+++ b/dlls/wldap32/parse.c
@@ -258,7 +258,7 @@ ULONG CDECL ldap_parse_resultW( WLDAP32_LDAP *ld, WLDAP32_LDAPMessage *result,
ldap_memfree( matchedU );
ldap_memfree( errorU );
- strarrayfreeU( referralsU );
+ ldap_memvfree( (void **)referralsU );
ldap_controls_free( serverctrlsU );
#endif
--
2.22.0
July 16, 2019
[PATCH 3/3] winex11.drv: Indicate whether the drop point is outside of the client area.
by Akihiro Sagawa
For instance, the menu bar is outside of the client area, so fNC is TRUE.
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
---
dlls/winex11.drv/xdnd.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
July 16, 2019
[PATCH 2/3] shell32: Fix return value for DragQueryPoint.
by Akihiro Sagawa
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47514
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
---
dlls/shell32/shellole.c | 2 +-
dlls/shell32/tests/shellole.c | 2 +-
dlls/winemac.drv/dragdrop.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
July 16, 2019
[PATCH 1/3] shell32/tests: Add DragQueryPoint tests.
by Akihiro Sagawa
Signed-off-by: Akihiro Sagawa <sagawa.aki(a)gmail.com>
---
dlls/shell32/tests/shellole.c | 6 ++++++
1 file changed, 6 insertions(+)
July 16, 2019
[PATCH 2/2] winex11.drv: Add DriverDateData registry property to display adapters.
by Zhiyi Zhang
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345.
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/winex11.drv/display.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/dlls/winex11.drv/display.c b/dlls/winex11.drv/display.c
index 7ddaf1c10d..435c0b878c 100644
--- a/dlls/winex11.drv/display.c
+++ b/dlls/winex11.drv/display.c
@@ -45,6 +45,7 @@ DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCMONITOR, 0x233a9ef3, 0xafc4, 0x4abd,
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_RCWORK, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 4);
DEFINE_DEVPROPKEY(WINE_DEVPROPKEY_MONITOR_ADAPTERNAME, 0x233a9ef3, 0xafc4, 0x4abd, 0xb5, 0x64, 0xc3, 0x2f, 0x21, 0xf1, 0x53, 0x5b, 5);
+static const WCHAR driver_date_dataW[] = {'D','r','i','v','e','r','D','a','t','e','D','a','t','a',0};
static const WCHAR driver_descW[] = {'D','r','i','v','e','r','D','e','s','c',0};
static const WCHAR displayW[] = {'D','I','S','P','L','A','Y',0};
static const WCHAR pciW[] = {'P','C','I',0};
@@ -126,6 +127,7 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g
INT written;
DWORD size;
BOOL ret = FALSE;
+ FILETIME filetime;
sprintfW(instanceW, gpu_instance_fmtW, gpu->vendor_id, gpu->device_id, gpu->subsys_id, gpu->revision_id, gpu_index);
if (!SetupDiOpenDeviceInfoW(devinfo, instanceW, NULL, 0, &device_data))
@@ -155,6 +157,11 @@ static BOOL X11DRV_InitGpu(HDEVINFO devinfo, const struct x11drv_gpu *gpu, INT g
if (RegSetValueExW(hkey, driver_descW, 0, REG_SZ, (const BYTE *)gpu->name,
(strlenW(gpu->name) + 1) * sizeof(WCHAR)))
goto done;
+ /* Write DriverDateData value, using current time as driver date, needed by Evoland */
+ GetSystemTimeAsFileTime(&filetime);
+ if (RegSetValueExW(hkey, driver_date_dataW, 0, REG_BINARY, (BYTE *)&filetime, sizeof(filetime)))
+ goto done;
+
RegCloseKey(hkey);
/* Retrieve driver value for adapters */
--
2.20.1
July 16, 2019
[PATCH 1/2] setupapi: Support full path enumerator in SetupDiGetClassDevs.
by Zhiyi Zhang
Based on a patch by Michael Müller.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=35345
Signed-off-by: Zhiyi Zhang <zzhang(a)codeweavers.com>
---
dlls/setupapi/devinst.c | 17 +++++++++++++++--
dlls/setupapi/tests/devinst.c | 6 ------
2 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/dlls/setupapi/devinst.c b/dlls/setupapi/devinst.c
index a69e826052..f0d75f90b8 100644
--- a/dlls/setupapi/devinst.c
+++ b/dlls/setupapi/devinst.c
@@ -2392,8 +2392,21 @@ static void SETUPDI_EnumerateDevices(HDEVINFO DeviceInfoSet, const GUID *class,
&enumStrKey);
if (!l)
{
- SETUPDI_EnumerateMatchingDevices(DeviceInfoSet, enumstr,
- enumStrKey, class, flags);
+ WCHAR *bus, *device;
+
+ if (!wcschr(enumstr, '\\'))
+ {
+ SETUPDI_EnumerateMatchingDevices(DeviceInfoSet, enumstr, enumStrKey, class, flags);
+ }
+ else if ((bus = strdupW(enumstr)))
+ {
+ device = wcschr(bus, '\\');
+ *device++ = 0;
+
+ SETUPDI_EnumerateMatchingDeviceInstances(DeviceInfoSet, bus, device, enumStrKey, class, flags);
+ HeapFree(GetProcessHeap(), 0, bus);
+ }
+
RegCloseKey(enumStrKey);
}
}
diff --git a/dlls/setupapi/tests/devinst.c b/dlls/setupapi/tests/devinst.c
index 430dede653..57adeeb27b 100644
--- a/dlls/setupapi/tests/devinst.c
+++ b/dlls/setupapi/tests/devinst.c
@@ -2823,11 +2823,9 @@ static void test_get_class_devs(void)
set = SetupDiGetClassDevsA(NULL, "ROOT\\LEGACY_BOGUS", NULL, DIGCF_ALLCLASSES);
ok(set != INVALID_HANDLE_VALUE, "Failed to create device list, error %#x.\n", GetLastError());
check_device_list(set, &GUID_NULL);
-todo_wine {
check_device_info(set, 0, &guid2, "ROOT\\LEGACY_BOGUS\\BAR");
check_device_info(set, 1, &guid, "ROOT\\LEGACY_BOGUS\\FOO");
check_device_info(set, 2, &guid, "ROOT\\LEGACY_BOGUS\\QUX");
-}
check_device_info(set, 3, NULL, NULL);
check_device_iface(set, NULL, &iface_guid, 0, 0, NULL);
ret = SetupDiDestroyDeviceInfoList(set);
@@ -2836,10 +2834,8 @@ todo_wine {
set = SetupDiGetClassDevsA(&guid, "ROOT\\LEGACY_BOGUS", NULL, 0);
ok(set != INVALID_HANDLE_VALUE, "Failed to create device list, error %#x.\n", GetLastError());
check_device_list(set, &guid);
-todo_wine {
check_device_info(set, 0, &guid, "ROOT\\LEGACY_BOGUS\\FOO");
check_device_info(set, 1, &guid, "ROOT\\LEGACY_BOGUS\\QUX");
-}
check_device_info(set, 2, NULL, NULL);
check_device_iface(set, NULL, &iface_guid, 0, 0, NULL);
ret = SetupDiDestroyDeviceInfoList(set);
@@ -2848,11 +2844,9 @@ todo_wine {
set = SetupDiGetClassDevsA(&guid, "ROOT\\LEGACY_BOGUS", NULL, DIGCF_ALLCLASSES);
ok(set != INVALID_HANDLE_VALUE, "Failed to create device list, error %#x.\n", GetLastError());
check_device_list(set, &GUID_NULL);
-todo_wine {
check_device_info(set, 0, &guid2, "ROOT\\LEGACY_BOGUS\\BAR");
check_device_info(set, 1, &guid, "ROOT\\LEGACY_BOGUS\\FOO");
check_device_info(set, 2, &guid, "ROOT\\LEGACY_BOGUS\\QUX");
-}
check_device_info(set, 3, NULL, NULL);
check_device_iface(set, NULL, &iface_guid, 0, 0, NULL);
ret = SetupDiDestroyDeviceInfoList(set);
--
2.20.1
July 16, 2019
[PATCH vkd3d 3/3] vkd3d: Handle SINT and UINT format in ClearRenderTargetView().
by Jactry Zeng
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
libs/vkd3d/command.c | 24 ++++++++++++++++++++++-
libs/vkd3d/utils.c | 40 ++++++++++++++++++++++++++++++++++++++
libs/vkd3d/vkd3d_private.h | 2 ++
tests/d3d12.c | 24 +++++++++++------------
4 files changed, 77 insertions(+), 13 deletions(-)
diff --git a/libs/vkd3d/command.c b/libs/vkd3d/command.c
index eeae9cf..12eea0e 100644
--- a/libs/vkd3d/command.c
+++ b/libs/vkd3d/command.c
@@ -4631,11 +4631,11 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearDepthStencilView(ID3D12Gra
static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12GraphicsCommandList1 *iface,
D3D12_CPU_DESCRIPTOR_HANDLE rtv, const FLOAT color[4], UINT rect_count, const D3D12_RECT *rects)
{
- const union VkClearValue clear_value = {{{color[0], color[1], color[2], color[3]}}};
struct d3d12_command_list *list = impl_from_ID3D12GraphicsCommandList1(iface);
const struct d3d12_rtv_desc *rtv_desc = d3d12_rtv_desc_from_cpu_handle(rtv);
struct VkAttachmentDescription attachment_desc;
struct VkAttachmentReference color_reference;
+ union VkClearValue clear_value;
TRACE("iface %p, rtv %#lx, color %p, rect_count %u, rects %p.\n",
iface, rtv.ptr, color, rect_count, rects);
@@ -4655,6 +4655,28 @@ static void STDMETHODCALLTYPE d3d12_command_list_ClearRenderTargetView(ID3D12Gra
color_reference.attachment = 0;
color_reference.layout = VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL;
+ if (vkd3d_format_is_signed_integer(rtv_desc->format))
+ {
+ clear_value.color.uint32[0] = color[0];
+ clear_value.color.uint32[1] = color[1];
+ clear_value.color.uint32[2] = color[2];
+ clear_value.color.uint32[3] = color[3];
+ }
+ else if (vkd3d_format_is_unsigned_integer(rtv_desc->format))
+ {
+ clear_value.color.uint32[0] = max(0, color[0]);
+ clear_value.color.uint32[1] = max(0, color[1]);
+ clear_value.color.uint32[2] = max(0, color[2]);
+ clear_value.color.uint32[3] = max(0, color[3]);
+ }
+ else
+ {
+ clear_value.color.float32[0] = color[0];
+ clear_value.color.float32[1] = color[1];
+ clear_value.color.float32[2] = color[2];
+ clear_value.color.float32[3] = color[3];
+ }
+
d3d12_command_list_clear(list, &attachment_desc, &color_reference, NULL,
rtv_desc->view, rtv_desc->width, rtv_desc->height, rtv_desc->layer_count,
&clear_value, rect_count, rects);
diff --git a/libs/vkd3d/utils.c b/libs/vkd3d/utils.c
index 5c8d363..f41d5bb 100644
--- a/libs/vkd3d/utils.c
+++ b/libs/vkd3d/utils.c
@@ -262,6 +262,46 @@ bool dxgi_format_is_typeless(DXGI_FORMAT dxgi_format)
}
}
+bool vkd3d_format_is_signed_integer(VkFormat format)
+{
+ switch (format)
+ {
+ case VK_FORMAT_R32G32B32A32_SINT:
+ case VK_FORMAT_R16G16B16A16_SINT:
+ case VK_FORMAT_R32G32B32_SINT:
+ case VK_FORMAT_R8G8B8A8_SINT:
+ case VK_FORMAT_R32G32_SINT:
+ case VK_FORMAT_R16G16_SINT:
+ case VK_FORMAT_R8G8_SINT:
+ case VK_FORMAT_R32_SINT:
+ case VK_FORMAT_R16_SINT:
+ case VK_FORMAT_R8_SINT:
+ return true;
+ default:
+ return false;
+ }
+}
+
+bool vkd3d_format_is_unsigned_integer(VkFormat format)
+{
+ switch (format)
+ {
+ case VK_FORMAT_R32G32B32A32_UINT:
+ case VK_FORMAT_R16G16B16A16_UINT:
+ case VK_FORMAT_R32G32B32_UINT:
+ case VK_FORMAT_R8G8B8A8_UINT:
+ case VK_FORMAT_R32G32_UINT:
+ case VK_FORMAT_R16G16_UINT:
+ case VK_FORMAT_R8G8_UINT:
+ case VK_FORMAT_R32_UINT:
+ case VK_FORMAT_R16_UINT:
+ case VK_FORMAT_R8_UINT:
+ return true;
+ default:
+ return false;
+ }
+}
+
DXGI_FORMAT vkd3d_get_dxgi_format(VkFormat format)
{
DXGI_FORMAT dxgi_format;
diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h
index 6e2dc2b..9fc3abb 100644
--- a/libs/vkd3d/vkd3d_private.h
+++ b/libs/vkd3d/vkd3d_private.h
@@ -1123,6 +1123,8 @@ HRESULT vkd3d_init_depth_stencil_formats(struct d3d12_device *device) DECLSPEC_H
void vkd3d_cleanup_depth_stencil_formats(struct d3d12_device *device) DECLSPEC_HIDDEN;
bool dxgi_format_is_typeless(DXGI_FORMAT dxgi_format) DECLSPEC_HIDDEN;
+bool vkd3d_format_is_signed_integer(VkFormat format) DECLSPEC_HIDDEN;
+bool vkd3d_format_is_unsigned_integer(VkFormat format) DECLSPEC_HIDDEN;
static inline const struct vkd3d_format *vkd3d_format_from_d3d12_resource_desc(
const struct d3d12_device *device, const D3D12_RESOURCE_DESC *desc, DXGI_FORMAT view_format)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index 09cd884..9837184 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -4406,15 +4406,15 @@ static void test_clear_render_target_view(void)
},
test_r8g8b8a8_uint[] =
{
- {green, 0, 0x01000100, true},
- {color, 0, 0x00000000, true},
- {negative_value, 0, 0x00000001, true},
+ {green, 0, 0x01000100, false},
+ {color, 0, 0x00000000, false},
+ {negative_value, 0, 0x00000001, false},
},
test_r8g8b8a8_sint[] =
{
- {green, 0, 0x01000100, true},
- {color, 0, 0x00000000, true},
- {negative_value, 0, 0xfe00ff01, true},
+ {green, 0, 0x01000100, false},
+ {color, 0, 0x00000000, false},
+ {negative_value, 0, 0xfe00ff01, false},
};
static const struct
{
@@ -4430,15 +4430,15 @@ static void test_clear_render_target_view(void)
},
test_r16g16b16a16_uint[] =
{
- {green, 0, 0x0010000, true},
- {color, 0, 0x00000000, true},
- {negative_value, 0, 0x00000001, true},
+ {green, 0, 0x0010000, false},
+ {color, 0, 0x00000000, false},
+ {negative_value, 0, 0x00000001, false},
},
test_r16g16b16a16_sint[] =
{
- {green, 0, 0x0010000, true},
- {color, 0, 0x00000000, true},
- {negative_value, 0, 0xfffe0000ffff0001, true},
+ {green, 0, 0x0010000, false},
+ {color, 0, 0x00000000, false},
+ {negative_value, 0, 0xfffe0000ffff0001, false},
};
STATIC_ASSERT(ARRAY_SIZE(array_colors) == ARRAY_SIZE(array_expected_colors));
--
2.20.1
July 16, 2019
[PATCH vkd3d 2/3] tests: Test ClearRenderTargetView() with R16G16B16A16 formats.
by Jactry Zeng
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
tests/d3d12.c | 137 +++++++++++++++++++++++++++++++++++++++
tests/d3d12_test_utils.h | 2 +
2 files changed, 139 insertions(+)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index bf063bf..09cd884 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -89,6 +89,11 @@ static bool compare_uint16(uint16_t a, uint16_t b, unsigned int max_diff)
return abs(a - b) <= max_diff;
}
+static bool compare_uint64(uint64_t a, uint64_t b, unsigned int max_diff)
+{
+ return abs(a - b) <= max_diff;
+}
+
static ULONG get_refcount(void *iface)
{
IUnknown *unk = iface;
@@ -531,6 +536,47 @@ static void check_sub_resource_uint16_(unsigned int line, ID3D12Resource *textur
release_resource_readback(&rb);
}
+#define check_readback_data_uint64(a, b, c, d) check_readback_data_uint64_(__LINE__, a, b, c, d)
+static void check_readback_data_uint64_(unsigned int line, struct resource_readback *rb,
+ const RECT *rect, uint64_t expected, unsigned int max_diff)
+{
+ RECT r = {0, 0, rb->width, rb->height};
+ unsigned int x = 0, y;
+ bool all_match = true;
+ uint64_t got = 0;
+
+ if (rect)
+ r = *rect;
+
+ for (y = r.top; y < r.bottom; ++y)
+ {
+ for (x = r.left; x < r.right; ++x)
+ {
+ got = get_readback_uint64(rb, x, y);
+ if (!compare_uint64(got, expected, max_diff))
+ {
+ all_match = false;
+ break;
+ }
+ }
+ if (!all_match)
+ break;
+ }
+ ok_(line)(all_match, "Got %#"PRIx64", expected %#"PRIx64" at (%u, %u).\n", got, expected, x, y);
+}
+
+#define check_sub_resource_uint64(a, b, c, d, e, f) check_sub_resource_uint64_(__LINE__, a, b, c, d, e, f)
+static void check_sub_resource_uint64_(unsigned int line, ID3D12Resource *texture,
+ unsigned int sub_resource_idx, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list,
+ uint64_t expected, unsigned int max_diff)
+{
+ struct resource_readback rb;
+
+ get_texture_readback_with_command_list(texture, sub_resource_idx, &rb, queue, command_list);
+ check_readback_data_uint64_(line, &rb, NULL, expected, max_diff);
+ release_resource_readback(&rb);
+}
+
#define check_sub_resource_vec4(a, b, c, d, e, f) check_sub_resource_vec4_(__LINE__, a, b, c, d, e, f)
static void check_sub_resource_vec4_(unsigned int line, ID3D12Resource *texture,
unsigned int sub_resource_idx, ID3D12CommandQueue *queue, ID3D12GraphicsCommandList *command_list,
@@ -4300,6 +4346,23 @@ static void test_clear_rtv_r8g8b8a8_2d_(unsigned int line, ID3D12GraphicsCommand
D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
}
+#define test_clear_rtv_r16g16b16a16_2d(a, b, c, d, e, f, g, h, i) test_clear_rtv_r16g16b16a16_2d_(__LINE__, a, b, c, d, e, f, g, h, i)
+static void test_clear_rtv_r16g16b16a16_2d_(unsigned int line, ID3D12GraphicsCommandList *command_list,
+ D3D12_CPU_DESCRIPTOR_HANDLE rtv_handle, const float *color, ID3D12Resource *resource,
+ ID3D12CommandQueue *queue, const unsigned int expected, ID3D12CommandAllocator *allocator,
+ unsigned int max_diff, BOOL is_todo)
+{
+ ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, color, 0, NULL);
+ transition_resource_state(command_list, resource,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ todo_if(is_todo)
+ check_sub_resource_uint64_(line, resource, 0, queue, command_list, expected, max_diff);
+
+ reset_command_list(command_list, allocator);
+ transition_resource_state(command_list, resource,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+}
+
static void test_clear_render_target_view(void)
{
static const unsigned int array_expected_colors[] = {0xff00ff00, 0xff0000ff, 0xffff0000};
@@ -4353,6 +4416,30 @@ static void test_clear_render_target_view(void)
{color, 0, 0x00000000, true},
{negative_value, 0, 0xfe00ff01, true},
};
+ static const struct
+ {
+ const float *color;
+ unsigned int max_diff;
+ uint64_t expected;
+ bool is_todo;
+ }
+ test_r16g16b16a16_unorm[] =
+ {
+ {green, 0, 0xffff0000, false},
+ {color, 0, 0x8000199a, false},
+ },
+ test_r16g16b16a16_uint[] =
+ {
+ {green, 0, 0x0010000, true},
+ {color, 0, 0x00000000, true},
+ {negative_value, 0, 0x00000001, true},
+ },
+ test_r16g16b16a16_sint[] =
+ {
+ {green, 0, 0x0010000, true},
+ {color, 0, 0x00000000, true},
+ {negative_value, 0, 0xfffe0000ffff0001, true},
+ };
STATIC_ASSERT(ARRAY_SIZE(array_colors) == ARRAY_SIZE(array_expected_colors));
@@ -4541,6 +4628,56 @@ static void test_clear_render_target_view(void)
check_readback_data_uint(&rb, &box, 0xbf4c7f19, 1);
release_resource_readback(&rb);
+ /* R16G16B16A16 views */
+ reset_command_list(command_list, context.allocator);
+ ID3D12Resource_Release(resource);
+ resource_desc.Dimension = D3D12_RESOURCE_DIMENSION_TEXTURE2D;
+ resource_desc.DepthOrArraySize = 1;
+ resource_desc.Format = DXGI_FORMAT_R16G16B16A16_TYPELESS;
+ clear_value.Format = DXGI_FORMAT_R16G16B16A16_UNORM;
+ hr = ID3D12Device_CreateCommittedResource(device,
+ &heap_properties, D3D12_HEAP_FLAG_NONE, &resource_desc,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, &clear_value,
+ &IID_ID3D12Resource, (void **)&resource);
+ ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
+
+ memset(&rtv_desc, 0, sizeof(rtv_desc));
+ rtv_desc.Format = DXGI_FORMAT_R16G16B16A16_UNORM;
+ rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
+ ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+ for (i = 0; i < ARRAY_SIZE(test_r16g16b16a16_unorm); i++)
+ {
+ vkd3d_test_set_context("Test %u", i);
+ test_clear_rtv_r16g16b16a16_2d(command_list, rtv_handle, test_r16g16b16a16_unorm[i].color, resource, queue,
+ test_r16g16b16a16_unorm[i].expected, context.allocator, test_r16g16b16a16_unorm[i].max_diff,
+ test_r16g16b16a16_unorm[i].is_todo);
+ }
+ vkd3d_test_set_context(NULL);
+
+ /* DXGI_FORMAT_R16G16B16A16_UINT view */
+ rtv_desc.Format = DXGI_FORMAT_R16G16B16A16_UINT;
+ ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+ for (i = 0; i < ARRAY_SIZE(test_r16g16b16a16_uint); i++)
+ {
+ vkd3d_test_set_context("Test %u", i);
+ test_clear_rtv_r16g16b16a16_2d(command_list, rtv_handle, test_r16g16b16a16_uint[i].color, resource, queue,
+ test_r16g16b16a16_uint[i].expected, context.allocator, test_r16g16b16a16_uint[i].max_diff,
+ test_r16g16b16a16_uint[i].is_todo);
+ }
+ vkd3d_test_set_context(NULL);
+
+ /* DXGI_FORMAT_R16G16B16A16_SINT view */
+ rtv_desc.Format = DXGI_FORMAT_R16G16B16A16_SINT;
+ ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+ for (i = 0; i < ARRAY_SIZE(test_r16g16b16a16_sint); i++)
+ {
+ vkd3d_test_set_context("Test %u", i);
+ test_clear_rtv_r16g16b16a16_2d(command_list, rtv_handle, test_r16g16b16a16_sint[i].color, resource, queue,
+ test_r16g16b16a16_sint[i].expected, context.allocator, test_r16g16b16a16_sint[i].max_diff,
+ test_r16g16b16a16_sint[i].is_todo);
+ }
+ vkd3d_test_set_context(NULL);
+
ID3D12Resource_Release(resource);
ID3D12DescriptorHeap_Release(rtv_heap);
destroy_test_context(&context);
diff --git a/tests/d3d12_test_utils.h b/tests/d3d12_test_utils.h
index 027a1fd..5a9e1e7 100644
--- a/tests/d3d12_test_utils.h
+++ b/tests/d3d12_test_utils.h
@@ -270,6 +270,8 @@ static unsigned int format_size(DXGI_FORMAT format)
case DXGI_FORMAT_R32G32B32A32_UINT:
case DXGI_FORMAT_R8G8_UNORM:
return 16;
+ case DXGI_FORMAT_R16G16B16A16_TYPELESS:
+ return 8;
case DXGI_FORMAT_R32_TYPELESS:
case DXGI_FORMAT_D32_FLOAT:
case DXGI_FORMAT_R32_FLOAT:
--
2.20.1
July 16, 2019
[PATCH vkd3d 1/3] tests: Test ClearRenderTargetView() with R8G8B8A8_{SINT,UINT} formats.
by Jactry Zeng
Signed-off-by: Jactry Zeng <jzeng(a)codeweavers.com>
---
tests/d3d12.c | 97 +++++++++++++++++++++++++++++++++++++++------------
1 file changed, 75 insertions(+), 22 deletions(-)
diff --git a/tests/d3d12.c b/tests/d3d12.c
index bd055fb..bf063bf 100644
--- a/tests/d3d12.c
+++ b/tests/d3d12.c
@@ -4283,6 +4283,23 @@ static void test_clear_depth_stencil_view(void)
destroy_test_context(&context);
}
+#define test_clear_rtv_r8g8b8a8_2d(a, b, c, d, e, f, g, h, i) test_clear_rtv_r8g8b8a8_2d_(__LINE__, a, b, c, d, e, f, g, h, i)
+static void test_clear_rtv_r8g8b8a8_2d_(unsigned int line, ID3D12GraphicsCommandList *command_list,
+ D3D12_CPU_DESCRIPTOR_HANDLE rtv_handle, const float *color, ID3D12Resource *resource,
+ ID3D12CommandQueue *queue, const unsigned int expected, ID3D12CommandAllocator *allocator,
+ unsigned int max_diff, BOOL is_todo)
+{
+ ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, color, 0, NULL);
+ transition_resource_state(command_list, resource,
+ D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
+ todo_if(is_todo)
+ check_sub_resource_uint_(line, resource, 0, queue, command_list, expected, max_diff);
+
+ reset_command_list(command_list, allocator);
+ transition_resource_state(command_list, resource,
+ D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
+}
+
static void test_clear_render_target_view(void)
{
static const unsigned int array_expected_colors[] = {0xff00ff00, 0xff0000ff, 0xffff0000};
@@ -4292,6 +4309,7 @@ static void test_clear_render_target_view(void)
{1.0f, 0.0f, 0.0f, 1.0f},
{0.0f, 0.0f, 1.0f, 1.0f},
};
+ static const float negative_value[] = {1.0f, -1.0f, -0.5f, -2.0f};
static const float color[] = {0.1f, 0.5f, 0.3f, 0.75f};
static const float green[] = {0.0f, 1.0f, 0.0f, 1.0f};
ID3D12GraphicsCommandList *command_list;
@@ -4311,6 +4329,30 @@ static void test_clear_render_target_view(void)
unsigned int i;
D3D12_BOX box;
HRESULT hr;
+ static const struct
+ {
+ const float *color;
+ unsigned int max_diff;
+ unsigned int expected;
+ bool is_todo;
+ }
+ test_r8g8b8a8_unorm[] =
+ {
+ {green, 0, 0xff00ff00, false},
+ {color, 2, 0xbf4c7f19, false},
+ },
+ test_r8g8b8a8_uint[] =
+ {
+ {green, 0, 0x01000100, true},
+ {color, 0, 0x00000000, true},
+ {negative_value, 0, 0x00000001, true},
+ },
+ test_r8g8b8a8_sint[] =
+ {
+ {green, 0, 0x01000100, true},
+ {color, 0, 0x00000000, true},
+ {negative_value, 0, 0xfe00ff01, true},
+ };
STATIC_ASSERT(ARRAY_SIZE(array_colors) == ARRAY_SIZE(array_expected_colors));
@@ -4358,32 +4400,44 @@ static void test_clear_render_target_view(void)
rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
rtv_desc.ViewDimension = D3D12_RTV_DIMENSION_TEXTURE2D;
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
-
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, green, 0, NULL);
- transition_resource_state(command_list, resource,
- D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
- check_sub_resource_uint(resource, 0, queue, command_list, 0xff00ff00, 0);
-
- reset_command_list(command_list, context.allocator);
- transition_resource_state(command_list, resource,
- D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
-
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, color, 0, NULL);
- transition_resource_state(command_list, resource,
- D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
- check_sub_resource_uint(resource, 0, queue, command_list, 0xbf4c7f19, 2);
+ for (i = 0; i < ARRAY_SIZE(test_r8g8b8a8_unorm); i++)
+ {
+ vkd3d_test_set_context("Test %u", i);
+ test_clear_rtv_r8g8b8a8_2d(command_list, rtv_handle, test_r8g8b8a8_unorm[i].color, resource, queue,
+ test_r8g8b8a8_unorm[i].expected, context.allocator, test_r8g8b8a8_unorm[i].max_diff,
+ test_r8g8b8a8_unorm[i].is_todo);
+ }
+ vkd3d_test_set_context(NULL);
/* sRGB view */
- reset_command_list(command_list, context.allocator);
- transition_resource_state(command_list, resource,
- D3D12_RESOURCE_STATE_COPY_SOURCE, D3D12_RESOURCE_STATE_RENDER_TARGET);
rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UNORM_SRGB;
ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+ test_clear_rtv_r8g8b8a8_2d(command_list, rtv_handle, color, resource, queue,
+ 0xbf95bc59, context.allocator, 2, FALSE);
- ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, rtv_handle, color, 0, NULL);
- transition_resource_state(command_list, resource,
- D3D12_RESOURCE_STATE_RENDER_TARGET, D3D12_RESOURCE_STATE_COPY_SOURCE);
- check_sub_resource_uint(resource, 0, queue, command_list, 0xbf95bc59, 2);
+ /* DXGI_FORMAT_R8G8B8A8_UINT view */
+ rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_UINT;
+ ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+ for (i = 0; i < ARRAY_SIZE(test_r8g8b8a8_uint); i++)
+ {
+ vkd3d_test_set_context("Test %u", i);
+ test_clear_rtv_r8g8b8a8_2d(command_list, rtv_handle, test_r8g8b8a8_uint[i].color, resource, queue,
+ test_r8g8b8a8_uint[i].expected, context.allocator, test_r8g8b8a8_uint[i].max_diff,
+ test_r8g8b8a8_uint[i].is_todo);
+ }
+ vkd3d_test_set_context(NULL);
+
+ /* DXGI_FORMAT_R8G8B8A8_SINT view */
+ rtv_desc.Format = DXGI_FORMAT_R8G8B8A8_SINT;
+ ID3D12Device_CreateRenderTargetView(device, resource, &rtv_desc, rtv_handle);
+ for (i = 0; i < ARRAY_SIZE(test_r8g8b8a8_sint); i++)
+ {
+ vkd3d_test_set_context("Test %u", i);
+ test_clear_rtv_r8g8b8a8_2d(command_list, rtv_handle, test_r8g8b8a8_sint[i].color, resource, queue,
+ test_r8g8b8a8_sint[i].expected, context.allocator, test_r8g8b8a8_sint[i].max_diff,
+ test_r8g8b8a8_sint[i].is_todo);
+ }
+ vkd3d_test_set_context(NULL);
/* 2D array texture */
ID3D12Resource_Release(resource);
@@ -4394,7 +4448,6 @@ static void test_clear_render_target_view(void)
&IID_ID3D12Resource, (void **)&resource);
ok(hr == S_OK, "Failed to create texture, hr %#x.\n", hr);
- reset_command_list(command_list, context.allocator);
for (i = 0; i < ARRAY_SIZE(array_colors); ++i)
{
memset(&rtv_desc, 0, sizeof(rtv_desc));
--
2.20.1
July 16, 2019
[PATCH] dbghelp: Return NULL instead of IMAGE_NO_MAP when PE file mapping fails.
by Conor McCarthy
A NULL test is always applied to the return value from pe_map_full(), but
IMAGE_NO_MAP is not NULL, it is ((void*)-1).
Signed-off-by: Conor McCarthy <cmccarthy(a)codeweavers.com>
---
dlls/dbghelp/pe_module.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/dlls/dbghelp/pe_module.c b/dlls/dbghelp/pe_module.c
index 58530e73..4b7c7baa 100644
--- a/dlls/dbghelp/pe_module.c
+++ b/dlls/dbghelp/pe_module.c
@@ -53,7 +53,7 @@ static void* pe_map_full(struct image_file_map* fmap, IMAGE_NT_HEADERS** nth)
fmap->u.pe.full_count++;
return fmap->u.pe.full_map;
}
- return IMAGE_NO_MAP;
+ return NULL;
}
static void pe_unmap_full(struct image_file_map* fmap)
--
2.22.0
July 16, 2019