[PATCH 3/7] d3d11: Implement d3d10_device_CheckFormatSupport().

Józef Kucia jkucia at codeweavers.com
Mon Dec 11 03:25:26 CST 2017


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>
---

I forget to submit this patch before the code freeze. Anyway, it's a
non-invasive change.

For https://bugs.winehq.org/show_bug.cgi?id=40046

---
 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 5221c0ea3a39..980d405ce810 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 820463c27599..b2a40b3c6d31 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,
-- 
2.13.6




More information about the wine-devel mailing list