diff --git a/dlls/d3d10core/texture.c b/dlls/d3d10core/texture.c index f1691905e0d..80ac8995a2c 100644 --- a/dlls/d3d10core/texture.c +++ b/dlls/d3d10core/texture.c @@ -253,6 +253,7 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic if (desc->MipLevels == 1 && desc->ArraySize == 1) { + DXGI_SURFACE_DESC surface_desc; IWineDXGIDevice *wine_device; if (FAILED(hr = ID3D10Device1_QueryInterface(&device->ID3D10Device1_iface, &IID_IWineDXGIDevice, @@ -262,7 +263,12 @@ HRESULT d3d10_texture2d_init(struct d3d10_texture2d *texture, struct d3d10_devic return E_FAIL; } - hr = IWineDXGIDevice_create_surface(wine_device, NULL, 0, NULL, + surface_desc.Width = desc->Width; + surface_desc.Height = desc->Height; + surface_desc.Format = desc->Format; + surface_desc.SampleDesc = desc->SampleDesc; + + hr = IWineDXGIDevice_create_surface(wine_device, &surface_desc, 0, NULL, (IUnknown *)&texture->ID3D10Texture2D_iface, (void **)&texture->dxgi_surface); IWineDXGIDevice_Release(wine_device); if (FAILED(hr)) diff --git a/dlls/dxgi/device.c b/dlls/dxgi/device.c index e98a2c0dbd9..837c57fb063 100644 --- a/dlls/dxgi/device.c +++ b/dlls/dxgi/device.c @@ -276,8 +276,7 @@ static HRESULT STDMETHODCALLTYPE dxgi_device_create_surface(IWineDXGIDevice *ifa return E_OUTOFMEMORY; } - hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer); - if (FAILED(hr)) + if (FAILED(hr = dxgi_surface_init(object, (IDXGIDevice *)iface, outer, desc))) { WARN("Failed to initialize surface, hr %#x.\n", hr); HeapFree(GetProcessHeap(), 0, object); diff --git a/dlls/dxgi/dxgi_private.h b/dlls/dxgi/dxgi_private.h index 24d9a269da7..75126cf1428 100644 --- a/dlls/dxgi/dxgi_private.h +++ b/dlls/dxgi/dxgi_private.h @@ -142,8 +142,11 @@ struct dxgi_surface IUnknown *outer_unknown; LONG refcount; IDXGIDevice *device; + + DXGI_SURFACE_DESC desc; }; -HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer) DECLSPEC_HIDDEN; +HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, + IUnknown *outer, const DXGI_SURFACE_DESC *desc) DECLSPEC_HIDDEN; #endif /* __WINE_DXGI_PRIVATE_H */ diff --git a/dlls/dxgi/surface.c b/dlls/dxgi/surface.c index 28147422d58..10daff71541 100644 --- a/dlls/dxgi/surface.c +++ b/dlls/dxgi/surface.c @@ -154,9 +154,13 @@ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDevice(IDXGISurface *iface, REF /* IDXGISurface methods */ static HRESULT STDMETHODCALLTYPE dxgi_surface_GetDesc(IDXGISurface *iface, DXGI_SURFACE_DESC *desc) { - FIXME("iface %p, desc %p stub!\n", iface, desc); + struct dxgi_surface *surface = impl_from_IDXGISurface(iface); - return E_NOTIMPL; + TRACE("iface %p, desc %p.\n", iface, desc); + + *desc = surface->desc; + + return S_OK; } static HRESULT STDMETHODCALLTYPE dxgi_surface_Map(IDXGISurface *iface, DXGI_MAPPED_RECT *mapped_rect, UINT flags) @@ -200,13 +204,15 @@ static const struct IUnknownVtbl dxgi_surface_inner_unknown_vtbl = dxgi_surface_inner_Release, }; -HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, IUnknown *outer) +HRESULT dxgi_surface_init(struct dxgi_surface *surface, IDXGIDevice *device, + IUnknown *outer, const DXGI_SURFACE_DESC *desc) { surface->IDXGISurface_iface.lpVtbl = &dxgi_surface_vtbl; surface->IUnknown_iface.lpVtbl = &dxgi_surface_inner_unknown_vtbl; surface->refcount = 1; surface->outer_unknown = outer ? outer : &surface->IUnknown_iface; surface->device = device; + surface->desc = *desc; return S_OK; }