https://bugs.winehq.org/show_bug.cgi?id=38048
Bug ID: 38048 Summary: Unigine Heaven 4.0 Benchmark Basic renders lots of black textures Product: Wine Version: 1.7.31 Hardware: x86 URL: http://www.techpowerup.com/downloads/2205/unigine-heav en-dx11-benchmark-4-0/ OS: Linux Status: NEW Keywords: download, regression Severity: normal Priority: P2 Component: directx-d3d Assignee: wine-bugs@winehq.org Reporter: gyebro69@gmail.com CC: matteo.mystral@gmail.com Regression SHA1: ea85db2a3fd081ca9f84d8989f775357a250914a Distribution: ---
Created attachment 50679 --> https://bugs.winehq.org/attachment.cgi?id=50679 terminal output
Some of the textures are pitch black when running Unigine Heaven Benchmark 4.0 Basic in DX9 mode. Textures are rendered correctly in OpenGL mode.
The problem is present since 1.7.31 and reverting the following commit on 1.7.36 fixes the issue for me:
ea85db2a3fd081ca9f84d8989f775357a250914a is the first bad commit commit ea85db2a3fd081ca9f84d8989f775357a250914a Author: Matteo Bruni mbruni@codeweavers.com Date: Mon Nov 3 22:38:26 2014 +0100
wined3d: Add ATI1N texture format support.
You should start the installed application like this: wine browser_x86.exe -config ../data/launcher/launcher.xml
The settings I used: API: DirectX 9 Quality: Low Stereo 3D: disabled Multi-monitor: disabled Anti-aliasing: disabled Fullscreen: yes
Wine 1.7.36 Fedora 21 Nvidia binary drivers 340.76
Unigine_Heaven-4.0.exe md5sum: 84ecd9a10b252f5b48d9b3e259d36d2c
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #1 from Béla Gyebrószki gyebro69@gmail.com --- Created attachment 50680 --> https://bugs.winehq.org/attachment.cgi?id=50680 screenshot
https://bugs.winehq.org/show_bug.cgi?id=38048
Sebastian Lackner sebastian@fds-team.de changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |sebastian@fds-team.de
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #2 from Matteo Bruni matteo.mystral@gmail.com --- Created attachment 50699 --> https://bugs.winehq.org/attachment.cgi?id=50699 Hack
Thanks Béla for the bug report.
I can reproduce the issue. It turns out that Heaven is doing an UpdateTexture from a 10-levels to a 8-levels 512x512 ATI2N texture (i.e. the latter is missing the 2x2 and 1x1 levels). That's currently rejected by wined3d_device_update_texture but it seems to work just fine on Windows, notwithstanding MSDN mentioning such case as invalid. I haven't checked it but probably the application was using a different codepath without ATI1N and ATI2N textures before the regression patch thus not triggering this bug.
The attached patch drops the check and fixes the issue for me. It needs more work for Wine (i.e. it might break other games as it is).
https://bugs.winehq.org/show_bug.cgi?id=38048
Ruslan Kabatsayev b7.10110111@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |b7.10110111@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=38048
Sergey Isakov isakov-sl@bk.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |isakov-sl@bk.ru
--- Comment #3 from Sergey Isakov isakov-sl@bk.ru --- I can confirm this patch with AMD HD6670 in OSX10.9.5. Thanks Matteo!
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #4 from Sergey Isakov isakov-sl@bk.ru --- Wine-1.7.41 The bug is still present. The patch is rule.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #5 from Sergey Isakov isakov-sl@bk.ru --- (In reply to Matteo Bruni from comment #2)
Created attachment 50699 [details] Hack
Thanks Béla for the bug report.
I can reproduce the issue. It turns out that Heaven is doing an UpdateTexture from a 10-levels to a 8-levels 512x512 ATI2N texture (i.e. the latter is missing the 2x2 and 1x1 levels). That's currently rejected by wined3d_device_update_texture but it seems to work just fine on Windows, notwithstanding MSDN mentioning such case as invalid. I haven't checked it but probably the application was using a different codepath without ATI1N and ATI2N textures before the regression patch thus not triggering this bug.
The attached patch drops the check and fixes the issue for me. It needs more work for Wine (i.e. it might break other games as it is).
MSDN says that " If the destination texture has fewer levels than the source, only the matching levels are copied. If the source texture has fewer levels than the destination, the method will fail." https://msdn.microsoft.com/en-us/library/windows/desktop/bb205858(v=vs.85).a... So src_level > dst_level is normal according to MSDN. The sources must be corrected as follow ---- level_count = wined3d_texture_get_level_count(dst_texture); if (wined3d_texture_get_level_count(src_texture) < level_count) { WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n"); return WINED3DERR_INVALIDCALL; } ----
Best wishes!
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #6 from Nikolay Sivov bunglehead@gmail.com --- (In reply to Sergey Isakov from comment #5)
MSDN says that " If the destination texture has fewer levels than the source, only the matching levels are copied. If the source texture has fewer levels than the destination, the method will fail." https://msdn.microsoft.com/en-us/library/windows/desktop/bb205858(v=vs.85). aspx So src_level > dst_level is normal according to MSDN. The sources must be corrected as follow
level_count = wined3d_texture_get_level_count(dst_texture); if (wined3d_texture_get_level_count(src_texture) < level_count) { WARN("Source has fewer level counts then destination, returning
WINED3DERR_INVALIDCALL.\n"); return WINED3DERR_INVALIDCALL; }
If you want to propose a patch, first add some tests to show that it's correct; and next will be to actually produce a patch, not a snippet from some file.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #7 from Sergey Isakov isakov-sl@bk.ru --- Created attachment 51335 --> https://bugs.winehq.org/attachment.cgi?id=51335 patch confirmation screenshot
With this patch textures are good.
Anyway, I will wait for admin confirmation.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #8 from Sergey Isakov isakov-sl@bk.ru --- Additional traces fixme:d3d:wined3d_device_update_texture src_level=7 dst_level=7 fixme:d3d:wined3d_device_update_texture src_level=7 dst_level=7 fixme:d3d:wined3d_device_update_texture src_level=5 dst_level=3 fixme:d3d:wined3d_device_update_texture src_level=9 dst_level=7 fixme:d3d:wined3d_device_update_texture src_level=10 dst_level=8 fixme:d3d:wined3d_device_update_texture src_level=10 dst_level=8 fixme:d3d:wined3d_device_update_texture src_level=7 dst_level=7 fixme:d3d:wined3d_device_update_texture src_level=1 dst_level=1 fixme:d3d:wined3d_device_update_texture src_level=1 dst_level=1
https://bugs.winehq.org/show_bug.cgi?id=38048
Béla Gyebrószki gyebro69@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |5af656ea85e22a00304f1904e91 | |ccfee52a6ccc5 Status|NEW |RESOLVED Resolution|--- |FIXED
--- Comment #9 from Béla Gyebrószki gyebro69@gmail.com --- Fixed by http://source.winehq.org/git/wine.git/commitdiff/5af656ea85e22a00304f1904e91...
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #10 from Sergey Isakov isakov-sl@bk.ru --- Something wrong here According to MSDN " If the source texture has fewer levels than the destination, the method will fail."
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #11 from Sergey Isakov isakov-sl@bk.ru --- (In reply to Nikolay Sivov from comment #6)
If you want to propose a patch, first add some tests to show that it's correct; and next will be to actually produce a patch, not a snippet from some file.
But I also doesn't see any test in the commit http://source.winehq.org/git/wine.git/commitdiff/5af656ea85e22a00304f1904e91...
Quot licet jovi non licet bovi?
https://bugs.winehq.org/show_bug.cgi?id=38048
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #12 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 1.7.42.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #13 from Matteo Bruni matteo.mystral@gmail.com --- (In reply to Sergey Isakov from comment #11)
(In reply to Nikolay Sivov from comment #6)
If you want to propose a patch, first add some tests to show that it's correct; and next will be to actually produce a patch, not a snippet from some file.
But I also doesn't see any test in the commit http://source.winehq.org/git/wine.git/commitdiff/ 5af656ea85e22a00304f1904e91ccfee52a6ccc5
Quot licet jovi non licet bovi?
https://www.winehq.org/pipermail/wine-patches/2015-April/138974.html https://www.winehq.org/pipermail/wine-patches/2015-April/138975.html https://www.winehq.org/pipermail/wine-devel/2015-April/107491.html
Obviously the tests do pass on Windows for me, both Nvidia and AMD.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #14 from Sergey Isakov isakov-sl@bk.ru --- These tests shown you want to show. In real life we should follow Microsoft requirements: if src_levels < dst_levels then the method UpdateTexture must return fail and not continue to work with unpredictable rezults.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #15 from Ruslan Kabatsayev b7.10110111@gmail.com --- (In reply to Sergey Isakov from comment #14)
These tests shown you want to show. In real life we should follow Microsoft requirements: if src_levels < dst_levels then the method UpdateTexture must return fail and not continue to work with unpredictable rezults.
In real life Wine should follow Windows behavior, not errors in the documentation.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #16 from Sergey Isakov isakov-sl@bk.ru --- I think this is not errors in the documentation. This is undefined texture if src < dst.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #17 from Ruslan Kabatsayev b7.10110111@gmail.com --- (In reply to Sergey Isakov from comment #16)
I think this is not errors in the documentation. This is undefined texture if src < dst.
If documentation doesn't reflect actual behavior, it's an error in documentation. Since the applications rely on it, it's unlikely to be fixed even if considered a bug in Windows' D3D implementation.
https://bugs.winehq.org/show_bug.cgi?id=38048
--- Comment #18 from Sergey Isakov isakov-sl@bk.ru --- (In reply to Ruslan Kabatsayev from comment #17)
(In reply to Sergey Isakov from comment #16)
I think this is not errors in the documentation. This is undefined texture if src < dst.
If documentation doesn't reflect actual behavior, it's an error in documentation. Since the applications rely on it, it's unlikely to be fixed even if considered a bug in Windows' D3D implementation.
You seems not hear me. It is not a bug in documentation. It is not a bug in Windows D3D. It is undefined textures as dst will not completely filled if src_level is not enough for dst.