Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=49395 Signed-off-by: Rémi Bernon rbernon@codeweavers.com ---
Resending this series as there's been conflicting d2d1 changes. This is only the first part of it.
dlls/d2d1/d2d1_private.h | 3 ++- dlls/d2d1/device.c | 10 ++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/dlls/d2d1/d2d1_private.h b/dlls/d2d1/d2d1_private.h index 81a46c8a7ce..b236bf57b6f 100644 --- a/dlls/d2d1/d2d1_private.h +++ b/dlls/d2d1/d2d1_private.h @@ -27,7 +27,7 @@ #include <math.h> #define COBJMACROS #include "d2d1_2.h" -#include "d3d11.h" +#include "d3d11_1.h" #ifdef D2D1_INIT_GUID #include "initguid.h" #endif @@ -162,6 +162,7 @@ struct d2d_device_context ID2D1Factory *factory; ID2D1Device *device; ID3D10Device *d3d_device; + ID3D11Device1 *d3d11_device; struct d2d_bitmap *target; ID3D10StateBlock *stateblock; struct d2d_shape_resources shape_resources[D2D_SHAPE_TYPE_COUNT]; diff --git a/dlls/d2d1/device.c b/dlls/d2d1/device.c index 2a0c094fb74..a03b1f56836 100644 --- a/dlls/d2d1/device.c +++ b/dlls/d2d1/device.c @@ -287,6 +287,7 @@ static ULONG STDMETHODCALLTYPE d2d_device_context_inner_Release(IUnknown *iface) context->stateblock->lpVtbl->Release(context->stateblock); if (context->target) ID2D1Bitmap1_Release(&context->target->ID2D1Bitmap1_iface); + ID3D11Device1_Release(context->d3d11_device); ID3D10Device_Release(context->d3d_device); ID2D1Factory_Release(context->factory); ID2D1Device_Release(context->device); @@ -3850,6 +3851,13 @@ static HRESULT d2d_device_context_init(struct d2d_device_context *render_target, return hr; }
+ if (FAILED(hr = IDXGIDevice_QueryInterface(device_impl->dxgi_device, + &IID_ID3D11Device1, (void **)&render_target->d3d11_device))) + { + WARN("Failed to query ID3D11Device1 interface, hr %#x.\n", hr); + goto err; + } + if (FAILED(hr = D3D10StateBlockMaskEnableAll(&state_mask))) { WARN("Failed to create stateblock mask, hr %#x.\n", hr); @@ -4013,6 +4021,8 @@ err: } if (render_target->stateblock) render_target->stateblock->lpVtbl->Release(render_target->stateblock); + if (render_target->d3d11_device) + ID3D11Device1_Release(render_target->d3d11_device); if (render_target->d3d_device) ID3D10Device_Release(render_target->d3d_device); ID2D1Device_Release(render_target->device);