[PATCH 2/5] wined3d: Refuse to create a texture view changing format from non-typeless.

Matteo Bruni mbruni at codeweavers.com
Fri Nov 24 16:29:58 CST 2017


Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
---
 dlls/wined3d/view.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/dlls/wined3d/view.c b/dlls/wined3d/view.c
index 62f087b23a..f75dd00000 100644
--- a/dlls/wined3d/view.c
+++ b/dlls/wined3d/view.c
@@ -128,6 +128,13 @@ static const struct wined3d_format *validate_resource_view(const struct wined3d_
         struct wined3d_texture *texture = texture_from_resource(resource);
         unsigned int depth_or_layer_count;
 
+        if (resource->format->id != format->id && !wined3d_format_is_typeless(resource->format))
+        {
+            WARN("Trying to create incompatible view for non typeless format %s.\n",
+                    debug_d3dformat(format->id));
+            return NULL;
+        }
+
         if (mip_slice && resource->type == WINED3D_RTYPE_TEXTURE_3D)
             depth_or_layer_count = wined3d_texture_get_level_depth(texture, desc->u.texture.level_idx);
         else
-- 
2.13.6




More information about the wine-devel mailing list