http://bugs.winehq.org/show_bug.cgi?id=29630
Bug #: 29630 Summary: OpenGL: Rendering to child window fails with fglrx Product: Wine Version: 1.3.37 Platform: x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: major Priority: P2 Component: winex11.drv AssignedTo: wine-bugs@winehq.org ReportedBy: lauri.koponen@iki.fi Classification: Unclassified
Created attachment 38390 --> http://bugs.winehq.org/attachment.cgi?id=38390 Log of: WINEDEBUG=+wgl,+opengl wine ./glWin.exe
OpenGL on an ATI Radeon HD6970 with the fglrx driver release 11.12 (8.920) fails when the rendering context is created in a child window. The example program here demonstrates the issue: http://www.songho.ca/opengl/gl_mvc.html, direct download link: http://www.songho.ca/opengl/files/glWin.zip
When I run that glWin.exe with WINEDEBUG=+wgl,+opengl, the log shows that rendering is going on and wine indeed gets the calls and does not return errors, but on screen the window is full of garbage (old framebuffer contents).
It's probably a driver bug, but maybe there's some workaround...
AMD driver release 11.10 had the same problem. I did not try older versions.
This is probably not a duplicate of bug 16806, because the rendering works just fine with an NVidia graphics adapter and their closed-source drivers, using the same wine version.
http://bugs.winehq.org/show_bug.cgi?id=29630
Lauri Koponen lauri.koponen@iki.fi changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download, hardware
--- Comment #1 from Lauri Koponen lauri.koponen@iki.fi 2012-01-16 15:48:35 CST --- I have set the importance as "major" as this potentially affects a large variety of different applications.
http://bugs.winehq.org/show_bug.cgi?id=29630
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|winex11.drv |-unknown Severity|major |normal
--- Comment #2 from Dmitry Timoshkov dmitry@baikal.ru 2012-01-16 19:21:48 CST --- As you guessed this is probably a driver bug.
http://bugs.winehq.org/show_bug.cgi?id=29630
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|download, hardware |
http://bugs.winehq.org/show_bug.cgi?id=29630
--- Comment #3 from Lauri Koponen lauri.koponen@iki.fi 2012-01-17 01:10:59 CST --- I have also created a bug report for AMD, here: http://ati.cchtml.com/show_bug.cgi?id=394
http://bugs.winehq.org/show_bug.cgi?id=29630
--- Comment #4 from Lauri Koponen lauri.koponen@iki.fi 2012-01-19 12:10:38 CST --- Now, I don't know (at least yet) why the code was originally written the way it was, but I got the example working with this change:
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e6affcb..3937b20 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -591,7 +591,7 @@ static BOOL set_win_format( HWND hwnd, XID fbconfig_id ) XInstallColormap(gdi_display, attrib.colormap);
if(data->gl_drawable) XDestroyWindow(gdi_display, data->gl_drawable); - data->gl_drawable = XCreateWindow(gdi_display, dummy_parent, -w, 0, w, + data->gl_drawable = XCreateWindow(gdi_display, dummy_parent, 0, 0, w, h vis->depth, InputOutput, vis->visual, CWColormap | CWOverrideRedirect, &attrib);
But what is the reason that (-w) is there for?
http://bugs.winehq.org/show_bug.cgi?id=29630
--- Comment #5 from Lauri Koponen lauri.koponen@iki.fi 2012-01-19 12:13:52 CST --- Sorry, the ends of long lines went missing. Here's the change again:
diff --git a/dlls/winex11.drv/window.c b/dlls/winex11.drv/window.c index e6affcb..3937b20 100644 --- a/dlls/winex11.drv/window.c +++ b/dlls/winex11.drv/window.c @@ -591,7 +591,7 @@ static BOOL set_win_format( HWND hwnd, XID fbconfig_id ) XInstallColormap(gdi_display, attrib.colormap);
if(data->gl_drawable) XDestroyWindow(gdi_display, data->gl_drawable); - data->gl_drawable = XCreateWindow(gdi_display, dummy_parent, -w, 0, w, h, 0, + data->gl_drawable = XCreateWindow(gdi_display, dummy_parent, 0, 0, w, h, 0, vis->depth, InputOutput, vis->visual, CWColormap | CWOverrideRedirect, &attrib);
http://bugs.winehq.org/show_bug.cgi?id=29630
Lauri Koponen lauri.koponen@iki.fi changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|-unknown |winex11.drv
http://bugs.winehq.org/show_bug.cgi?id=29630
Matteo Bruni matteo.mystral@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |matteo.mystral@gmail.com
--- Comment #6 from Matteo Bruni matteo.mystral@gmail.com 2012-01-24 17:23:24 CST --- Yeah, this looks like a bug in fglrx. Rendering to an offscreen window doesn't work properly, at least when x < 0. In fact putting a "w" in place of the "-w" works okay here.
I sent http://www.winehq.org/pipermail/wine-patches/2012-January/111087.html because the change makes sense anyway. The "-w" was needed when that piece of code was introduced because at that time the GL window was actually a child of the "whole" X window (see 00633e37bcc8da1032f34ea2d87814739de07db4). BTW, thank you for the bug report and the analysis!
http://bugs.winehq.org/show_bug.cgi?id=29630
--- Comment #7 from Lauri Koponen lauri.koponen@iki.fi 2012-01-25 02:25:32 CST --- Thank you Matteo!
I later noticed that resizing the OpenGL child window causes the same problem to re-appear. I have not traced this one yet, but I suppose there's a similar "-w" somewhere in the window resizing code.
- Lauri
http://bugs.winehq.org/show_bug.cgi?id=29630
--- Comment #8 from Lauri Koponen lauri.koponen@iki.fi 2012-01-25 02:28:17 CST --- OK, I had a look at your patch, and looks like you might have fixed the resizing bug too. I will test it and report back if it helps.
http://bugs.winehq.org/show_bug.cgi?id=29630
--- Comment #9 from Lauri Koponen lauri.koponen@iki.fi 2012-01-25 13:40:24 CST --- Confirmed, your patch also fixes window resizing.
http://bugs.winehq.org/show_bug.cgi?id=29630
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |b4afbf98cf29cd1beb24d2958d1 | |cc5243f70b5a9 Status|UNCONFIRMED |RESOLVED Resolution| |FIXED
--- Comment #10 from Dmitry Timoshkov dmitry@baikal.ru 2012-01-26 01:08:07 CST --- Fixed.
http://bugs.winehq.org/show_bug.cgi?id=29630
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #11 from Alexandre Julliard julliard@winehq.org 2012-01-27 14:17:28 CST --- Closing bugs fixed in 1.4-rc1.