=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3d11: Handle 3D textures in wined3d_resource_from_d3d10_resource().

Alexandre Julliard julliard at winehq.org
Wed Jan 10 17:06:29 CST 2018


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

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Wed Jan 10 17:26:33 2018 +0100

d3d11: Handle 3D textures in wined3d_resource_from_d3d10_resource().

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3d11/d3d11_private.h | 1 +
 dlls/d3d11/texture.c       | 8 ++++++++
 dlls/d3d11/utils.c         | 4 ++++
 3 files changed, 13 insertions(+)

diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index 4d9f34e..e7fd3a7 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -152,6 +152,7 @@ struct d3d_texture3d
 HRESULT d3d_texture3d_create(struct d3d_device *device, const D3D11_TEXTURE3D_DESC *desc,
         const D3D11_SUBRESOURCE_DATA *data, struct d3d_texture3d **texture) DECLSPEC_HIDDEN;
 struct d3d_texture3d *unsafe_impl_from_ID3D11Texture3D(ID3D11Texture3D *iface) DECLSPEC_HIDDEN;
+struct d3d_texture3d *unsafe_impl_from_ID3D10Texture3D(ID3D10Texture3D *iface) DECLSPEC_HIDDEN;
 
 /* ID3D11Buffer, ID3D10Buffer */
 struct d3d_buffer
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index 177c0cc..17fb4b1 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -924,6 +924,14 @@ static const struct ID3D10Texture3DVtbl d3d10_texture3d_vtbl =
     d3d10_texture3d_GetDesc,
 };
 
+struct d3d_texture3d *unsafe_impl_from_ID3D10Texture3D(ID3D10Texture3D *iface)
+{
+    if (!iface)
+        return NULL;
+    assert(iface->lpVtbl == &d3d10_texture3d_vtbl);
+    return CONTAINING_RECORD(iface, struct d3d_texture3d, ID3D10Texture3D_iface);
+}
+
 struct d3d_texture3d *unsafe_impl_from_ID3D11Texture3D(ID3D11Texture3D *iface)
 {
     if (!iface)
diff --git a/dlls/d3d11/utils.c b/dlls/d3d11/utils.c
index e919c58..c9e137c 100644
--- a/dlls/d3d11/utils.c
+++ b/dlls/d3d11/utils.c
@@ -637,6 +637,10 @@ struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *re
             return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture2D(
                     (ID3D10Texture2D *)resource)->wined3d_texture);
 
+        case D3D10_RESOURCE_DIMENSION_TEXTURE3D:
+            return wined3d_texture_get_resource(unsafe_impl_from_ID3D10Texture3D(
+                    (ID3D10Texture3D *)resource)->wined3d_texture);
+
         default:
             FIXME("Unhandled resource dimension %#x.\n", dimension);
             return NULL;




More information about the wine-cvs mailing list