[PATCH 6/7] d3d11: Add support for mapping 3D textures. (resend)

Józef Kucia jkucia at codeweavers.com
Mon Nov 2 10:12:30 CST 2015


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/d3d11/d3d11_private.h | 1 +
 dlls/d3d11/texture.c       | 8 ++++++++
 dlls/d3d11/utils.c         | 8 ++++++--
 3 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h
index b6d84c0..932d518 100644
--- a/dlls/d3d11/d3d11_private.h
+++ b/dlls/d3d11/d3d11_private.h
@@ -133,6 +133,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;
 
 /* ID3D11Buffer, ID3D10Buffer */
 struct d3d_buffer
diff --git a/dlls/d3d11/texture.c b/dlls/d3d11/texture.c
index ef4c3ac..9c7f299 100644
--- a/dlls/d3d11/texture.c
+++ b/dlls/d3d11/texture.c
@@ -887,6 +887,14 @@ static const struct ID3D10Texture3DVtbl d3d10_texture3d_vtbl =
     d3d10_texture3d_GetDesc,
 };
 
+struct d3d_texture3d *unsafe_impl_from_ID3D11Texture3D(ID3D11Texture3D *iface)
+{
+    if (!iface)
+        return NULL;
+    assert(iface->lpVtbl == &d3d11_texture3d_vtbl);
+    return impl_from_ID3D11Texture3D(iface);
+}
+
 static const struct wined3d_parent_ops d3d_texture3d_wined3d_parent_ops =
 {
     d3d_texture3d_wined3d_object_released,
diff --git a/dlls/d3d11/utils.c b/dlls/d3d11/utils.c
index 31dffa3..7a2df7e 100644
--- a/dlls/d3d11/utils.c
+++ b/dlls/d3d11/utils.c
@@ -518,8 +518,12 @@ struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *re
             return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture2D(
                     (ID3D11Texture2D *)resource)->wined3d_texture);
 
+        case D3D11_RESOURCE_DIMENSION_TEXTURE3D:
+            return wined3d_texture_get_resource(unsafe_impl_from_ID3D11Texture3D(
+                    (ID3D11Texture3D *)resource)->wined3d_texture);
+
         default:
-            FIXME("Unhandled resource dimension %#x.\n", dimension);
+            FIXME("Unhandled resource dimension %u.\n", dimension);
             return NULL;
     }
 }
@@ -541,7 +545,7 @@ struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *re
                     (ID3D10Texture2D *)resource)->wined3d_texture);
 
         default:
-            FIXME("Unhandled resource dimension %#x.\n", dimension);
+            FIXME("Unhandled resource dimension %u.\n", dimension);
             return NULL;
     }
 }
-- 
2.4.10




More information about the wine-patches mailing list