=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11: Implement d3d10_device_CheckFormatSupport().
Alexandre Julliard
julliard at winehq.org
Mon Dec 11 13:53:37 CST 2017
Module: wine
Branch: master
Commit: c371b46c4a78ca2d7a8e106f29ab411f5f4dd1bb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=c371b46c4a78ca2d7a8e106f29ab411f5f4dd1bb
Author: Józef Kucia <jkucia at codeweavers.com>
Date: Mon Dec 11 10:25:26 2017 +0100
d3d11: Implement d3d10_device_CheckFormatSupport().
The d3d11_device_CheckFormatSupport() function should filter the format
support based on the device feature level.
Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/d3d10core/tests/device.c | 15 ++++++++-------
dlls/d3d11/device.c | 6 ++++--
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/dlls/d3d10core/tests/device.c b/dlls/d3d10core/tests/device.c
index 5221c0e..980d405 100644
--- a/dlls/d3d10core/tests/device.c
+++ b/dlls/d3d10core/tests/device.c
@@ -11006,6 +11006,7 @@ static void check_format_support(const unsigned int *format_support,
continue;
}
+ todo_wine
ok(supported, "Format %#x - %s supported, format support %#x.\n",
format, feature_name, format_support[format]);
}
@@ -11015,6 +11016,7 @@ static void test_required_format_support(void)
{
unsigned int format_support[DXGI_FORMAT_B4G4R4A4_UNORM + 1];
ID3D10Device *device;
+ unsigned int support;
DXGI_FORMAT format;
ULONG refcount;
HRESULT hr;
@@ -11031,20 +11033,19 @@ static void test_required_format_support(void)
return;
}
+ support = 0xdeadbeef;
+ hr = ID3D10Device_CheckFormatSupport(device, ~0u, &support);
+ ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr);
+ ok(!support, "Got unexpected format support %#x.\n", support);
+
memset(format_support, 0, sizeof(format_support));
for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format)
{
hr = ID3D10Device_CheckFormatSupport(device, format, &format_support[format]);
- todo_wine ok(hr == S_OK || (hr == E_FAIL && !format_support[format]),
+ ok(hr == S_OK || (hr == E_FAIL && !format_support[format]),
"Got unexpected result for format %#x: hr %#x, format_support %#x.\n",
format, hr, format_support[format]);
}
- if (hr == E_NOTIMPL)
- {
- skip("CheckFormatSupport not implemented.\n");
- ID3D10Device_Release(device);
- return;
- }
check_format_support(format_support, index_buffers, ARRAY_SIZE(index_buffers),
D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER, "index buffer");
diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 820463c..b2a40b3 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -5417,10 +5417,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface
static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface,
DXGI_FORMAT format, UINT *format_support)
{
- FIXME("iface %p, format %s, format_support %p stub!\n",
+ struct d3d_device *device = impl_from_ID3D10Device(iface);
+
+ TRACE("iface %p, format %s, format_support %p.\n",
iface, debug_dxgi_format(format), format_support);
- return E_NOTIMPL;
+ return d3d11_device_CheckFormatSupport(&device->ID3D11Device_iface, format, format_support);
}
static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface,
More information about the wine-cvs
mailing list