https://bugs.winehq.org/show_bug.cgi?id=38875
Bug ID: 38875 Summary: DirectDraw: blitting from Offscreen Plain surface to Primary Surface displays black instead Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: danweiss@gmail.com Distribution: ---
I made a simple DirectDraw test program that draws a bitmap to an Offscreen Plain surface, then draws that surface to the primary surface with resizing.
It works fine on Windows. But whenever I run it on Wine, it draws a black rectangle instead of the bitmap.
If I create a System Memory Surface instead of an Offscreen Plain Surface, it draws correctly.
Link to the test program EXE: http://www.dwedit.org/files/TestWin32_2.exe
https://bugs.winehq.org/show_bug.cgi?id=38875
--- Comment #1 from Dan Weiss danweiss@gmail.com --- Some additional information:
OS: Debian Jessie x64
Video Card information from lspci:
00:02.0 VGA compatible controller: Intel Corporation 82945G/GZ Integrated Graphics Controller (rev 02) (prog-if 00 [VGA controller]) Subsystem: Intel Corporation Device 464c Flags: bus master, fast devsel, latency 0, IRQ 16 Memory at 90300000 (32-bit, non-prefetchable) [size=512K] I/O ports at 30e0 [size=8] Memory at 80000000 (32-bit, prefetchable) [size=256M] Memory at 90380000 (32-bit, non-prefetchable) [size=256K] Expansion ROM at <unassigned> [disabled] Capabilities: <access denied> Kernel driver in use: i915
Source code of the test program is available if you really need it.
https://bugs.winehq.org/show_bug.cgi?id=38875
Stefan Dösinger stefan@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |stefan@codeweavers.com
--- Comment #2 from Stefan Dösinger stefan@codeweavers.com --- Do you have the source code of the program?
Looks like we have a GL blit that fails...
https://bugs.winehq.org/show_bug.cgi?id=38875
--- Comment #3 from Dan Weiss danweiss@gmail.com --- source code: http://www.dwedit.org/files/TestWin32_2.7z
https://bugs.winehq.org/show_bug.cgi?id=38875
--- Comment #4 from Stefan Dösinger stefan@codeweavers.com --- Do you know which blit in the code fails? The GetDC / GDI based blit to backSurface or the ddraw blit from backSurface to primarySurface?
https://bugs.winehq.org/show_bug.cgi?id=38875
--- Comment #5 from Dan Weiss danweiss@gmail.com --- I believe that the blit that fails is the one from the offscreen surface to the primary surface. This is the DirectDraw blit itself, not the DC blit. I had tried locking the offscreen surface and checking whether it was solid black or not, and it wasn't.
https://bugs.winehq.org/show_bug.cgi?id=38875
Stefan Dösinger stefandoesinger@gmx.at changed:
What |Removed |Added ---------------------------------------------------------------------------- CC|stefan@codeweavers.com |stefandoesinger@gmx.at
https://bugs.winehq.org/show_bug.cgi?id=38875
Sergey Isakov isakov-sl@bk.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |isakov-sl@bk.ru
--- Comment #6 from Sergey Isakov isakov-sl@bk.ru --- Created attachment 53357 --> https://bugs.winehq.org/attachment.cgi?id=53357 Is it expected screenshot?
Resizing window led to dirty surround but main picture is good.
https://bugs.winehq.org/show_bug.cgi?id=38875
Lucian Poston lucianposton@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lucianposton@gmail.com
https://bugs.winehq.org/show_bug.cgi?id=38875
Lauri Kenttä lauri.kentta@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |lauri.kentta@gmail.com
--- Comment #7 from Lauri Kenttä lauri.kentta@gmail.com --- According to my tests and experiments, the sample program (TestWin32_2) has only one problem on Wine: using both ddraw and OpenGL doesn't work. Otherwise I don't see any problems with the different ddraw rendering modes. Also, the code seems to have a bug where openGlHdc is released in InitOpenGL but still used in DrawScreenOpenGL, so I'm a bit surprised if it works at all.
https://bugs.winehq.org/show_bug.cgi?id=38875
--- Comment #8 from Lauri Kenttä lauri.kentta@gmail.com --- Created attachment 56452 --> https://bugs.winehq.org/attachment.cgi?id=56452 Sample program
Here's a stripped-down version of the test program. In this one, you press numbers 1-6 to select different rendering functions. Look at the source and stdout for more information. There are a lot of asserts to catch any failures.
This program shows that blitting from DDSCAPS_OFFSCREENPLAIN to the primary surface works fine. This bug report is either fixed, incomplete or invalid.
There are other problems, not related to the title of this bug report:
If a ddraw test is run first, SetPixelFormat in InitOpenGL fails, so it's not a surprise that it won't render anything. Setting depth buffer and stencil buffer to 0 bits (as they are not needed) fixes this problem, though. I suppose this is a known problem of the current ddraw implementation.
If OpenGL is initialized first, ddraw doesn't draw anything, but I don't see any of the functions actually failing in that case.
Switching ddraw->OpenGL->ddraw crashes Wine with this error: err:d3d:context_check_fbo_status FBO 0 is incomplete, driver bug? wine: Unhandled page fault on read access to 0x00000000 ...
https://bugs.winehq.org/show_bug.cgi?id=38875
joaopa jeremielapuree@yahoo.fr changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |jeremielapuree@yahoo.fr
--- Comment #9 from joaopa jeremielapuree@yahoo.fr --- Created attachment 62627 --> https://bugs.winehq.org/attachment.cgi?id=62627 Binary test
Is still a bug in current wine (3.19)?
I compiled the source from the previous comment, but I don't know how the test should behave.
https://bugs.winehq.org/show_bug.cgi?id=38875
Bartosz gang65@poczta.onet.pl changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |gang65@poczta.onet.pl
https://bugs.winehq.org/show_bug.cgi?id=38875
zaplo00@mt2015.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |zaplo00@mt2015.com
--- Comment #10 from zaplo00@mt2015.com --- Created attachment 63245 --> https://bugs.winehq.org/attachment.cgi?id=63245 binary test
Test 1 - 2 (draw_BitBlt, draw_ogl_1) display image shown in screenshot. Test 3 - 6 (ddraw1-4) make the image flash continously.