Module: wine Branch: master Commit: 82dffc9567988ece44207553cd5d4fe1dacb4944 URL: http://source.winehq.org/git/wine.git/?a=commit;h=82dffc9567988ece44207553cd...
Author: Henri Verbeet hverbeet@codeweavers.com Date: Thu Aug 6 00:21:58 2015 +0200
d3d10core: Ensure the information we return in d3d10_texture2d_GetDesc() is current.
---
dlls/d3d10core/texture.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-)
diff --git a/dlls/d3d10core/texture.c b/dlls/d3d10core/texture.c index 3ee87df..04b9e2d 100644 --- a/dlls/d3d10core/texture.c +++ b/dlls/d3d10core/texture.c @@ -243,11 +243,26 @@ static void STDMETHODCALLTYPE d3d10_texture2d_Unmap(ID3D10Texture2D *iface, UINT
static void STDMETHODCALLTYPE d3d10_texture2d_GetDesc(ID3D10Texture2D *iface, D3D10_TEXTURE2D_DESC *desc) { - struct d3d10_texture2d *This = impl_from_ID3D10Texture2D(iface); + struct d3d10_texture2d *texture = impl_from_ID3D10Texture2D(iface); + struct wined3d_resource_desc wined3d_desc;
TRACE("iface %p, desc %p\n", iface, desc);
- *desc = This->desc; + *desc = texture->desc; + + wined3d_mutex_lock(); + wined3d_resource_get_desc(wined3d_texture_get_resource(texture->wined3d_texture), &wined3d_desc); + wined3d_mutex_unlock(); + + /* FIXME: Resizing swapchain buffers can cause these to change. We'd like + * to get everything from wined3d, but e.g. bind flags don't exist as such + * there (yet). */ + desc->Width = wined3d_desc.width; + desc->Height = wined3d_desc.height; + desc->Format = dxgi_format_from_wined3dformat(wined3d_desc.format); + desc->SampleDesc.Count = wined3d_desc.multisample_type == WINED3D_MULTISAMPLE_NONE + ? 1 : wined3d_desc.multisample_type; + desc->SampleDesc.Quality = wined3d_desc.multisample_quality; }
static const struct ID3D10Texture2DVtbl d3d10_texture2d_vtbl =