Commit c371b46c authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11: Implement d3d10_device_CheckFormatSupport().

The d3d11_device_CheckFormatSupport() function should filter the format support based on the device feature level. Signed-off-by: 's avatarJózef Kucia <jkucia@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 0ccc7c09
...@@ -11006,6 +11006,7 @@ static void check_format_support(const unsigned int *format_support, ...@@ -11006,6 +11006,7 @@ static void check_format_support(const unsigned int *format_support,
continue; continue;
} }
todo_wine
ok(supported, "Format %#x - %s supported, format support %#x.\n", ok(supported, "Format %#x - %s supported, format support %#x.\n",
format, feature_name, format_support[format]); format, feature_name, format_support[format]);
} }
...@@ -11015,6 +11016,7 @@ static void test_required_format_support(void) ...@@ -11015,6 +11016,7 @@ static void test_required_format_support(void)
{ {
unsigned int format_support[DXGI_FORMAT_B4G4R4A4_UNORM + 1]; unsigned int format_support[DXGI_FORMAT_B4G4R4A4_UNORM + 1];
ID3D10Device *device; ID3D10Device *device;
unsigned int support;
DXGI_FORMAT format; DXGI_FORMAT format;
ULONG refcount; ULONG refcount;
HRESULT hr; HRESULT hr;
...@@ -11031,20 +11033,19 @@ static void test_required_format_support(void) ...@@ -11031,20 +11033,19 @@ static void test_required_format_support(void)
return; 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)); memset(format_support, 0, sizeof(format_support));
for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format) for (format = DXGI_FORMAT_UNKNOWN; format <= DXGI_FORMAT_B4G4R4A4_UNORM; ++format)
{ {
hr = ID3D10Device_CheckFormatSupport(device, format, &format_support[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", "Got unexpected result for format %#x: hr %#x, format_support %#x.\n",
format, hr, format_support[format]); 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), check_format_support(format_support, index_buffers, ARRAY_SIZE(index_buffers),
D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER, "index buffer"); D3D10_FORMAT_SUPPORT_IA_INDEX_BUFFER, "index buffer");
......
...@@ -5417,10 +5417,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface ...@@ -5417,10 +5417,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateCounter(ID3D10Device1 *iface
static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface, static HRESULT STDMETHODCALLTYPE d3d10_device_CheckFormatSupport(ID3D10Device1 *iface,
DXGI_FORMAT format, UINT *format_support) 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); 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, static HRESULT STDMETHODCALLTYPE d3d10_device_CheckMultisampleQualityLevels(ID3D10Device1 *iface,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment