Zebediah Figura : d3d11: Implement ID3D11Device1::CreateDeferredContext1().

Alexandre Julliard julliard at winehq.org
Thu May 27 16:02:10 CDT 2021


Module: wine
Branch: master
Commit: 9aab4fa8d71b1b8444403a1898b31f12f89ee65e
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9aab4fa8d71b1b8444403a1898b31f12f89ee65e

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu May 27 11:14:30 2021 -0500

d3d11: Implement ID3D11Device1::CreateDeferredContext1().

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=41636
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/device.c      | 12 ++++++++++--
 dlls/d3d11/tests/d3d11.c |  5 +----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c
index 1a02b95772c..3fbd5ec903a 100644
--- a/dlls/d3d11/device.c
+++ b/dlls/d3d11/device.c
@@ -4078,9 +4078,17 @@ static void STDMETHODCALLTYPE d3d11_device_GetImmediateContext1(ID3D11Device2 *i
 static HRESULT STDMETHODCALLTYPE d3d11_device_CreateDeferredContext1(ID3D11Device2 *iface, UINT flags,
         ID3D11DeviceContext1 **context)
 {
-    FIXME("iface %p, flags %#x, context %p stub!\n", iface, flags, context);
+    struct d3d_device *device = impl_from_ID3D11Device2(iface);
+    struct d3d11_device_context *object;
+    HRESULT hr;
 
-    return E_NOTIMPL;
+    TRACE("iface %p, flags %#x, context %p.\n", iface, flags, context);
+
+    if (FAILED(hr = d3d11_deferred_context_create(device, flags, &object)))
+        return hr;
+
+    *context = &object->ID3D11DeviceContext1_iface;
+    return S_OK;
 }
 
 static HRESULT STDMETHODCALLTYPE d3d11_device_CreateBlendState1(ID3D11Device2 *iface,
diff --git a/dlls/d3d11/tests/d3d11.c b/dlls/d3d11/tests/d3d11.c
index 77ea747d981..d8c3b2df19c 100644
--- a/dlls/d3d11/tests/d3d11.c
+++ b/dlls/d3d11/tests/d3d11.c
@@ -32397,9 +32397,7 @@ static void test_deferred_context_swap_state(void)
     ID3D11DeviceContext1_PSSetConstantBuffers(immediate, 0, 1, &green_buffer);
 
     hr = ID3D11Device1_CreateDeferredContext1(device, 0, &deferred);
-    todo_wine ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
-    if (hr != S_OK)
-        goto out;
+    ok(hr == S_OK, "Failed to create deferred context, hr %#x.\n", hr);
 
     feature_level = ID3D11Device1_GetFeatureLevel(device);
     hr = ID3D11Device1_CreateDeviceContextState(device, 0, &feature_level, 1, D3D11_SDK_VERSION,
@@ -32420,7 +32418,6 @@ static void test_deferred_context_swap_state(void)
     ID3DDeviceContextState_Release(state);
     ID3D11DeviceContext1_Release(deferred);
 
-out:
     ID3D11Buffer_Release(green_buffer);
     ID3D11DeviceContext1_Release(immediate);
     ID3D11Device1_Release(device);




More information about the wine-cvs mailing list