From: Sergey Isakov Subject: [PATCH] wined3d: fix different level count while texture update Message-Id: <18CA3780-F333-47E5-A2D5-0AA9BF178203@bk.ru> Date: Tue, 28 Apr 2015 21:18:06 +0300 Bug 38048 According to MSDN https://msdn.microsoft.com/en-us/library/windows/desktop/bb205858(v=vs.85) source texture CAN have greater level count then destination Current comparison "!=“ causes black textures as discussed in the bugzilla. Bug 38048
According to MSDN https://msdn.microsoft.com/en-us/library/windows/desktop/bb205858(v=vs.85)
source texture CAN have greater level count then destination
Current comparison "!=“ causes black textures as discussed in the bugzilla.
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a3fbe25..ba94604 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3565,11 +3566,11 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device, return WINED3DERR_INVALIDCALL; } - /* Check that both textures have the identical numbers of levels. */ - level_count = wined3d_texture_get_level_count(src_texture); - if (wined3d_texture_get_level_count(dst_texture) != level_count) + /* Check that both textures have the compatible numbers of levels. */ + level_count = wined3d_texture_get_level_count(dst_texture); + if (wined3d_texture_get_level_count(src_texture) < level_count) { - WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n"); + WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n"); return WINED3DERR_INVALIDCALL; }