[Bug 16699] OpenGL anti-aliasing capabilities of graphics driver not exposed to Google Sketchup 7/8 (wglGetPixelFormatAttribivARB doesn't allow WGL_SWAP_METHOD_ARB support)

wine-bugs at winehq.org wine-bugs at winehq.org
Wed Jul 2 15:00:35 CDT 2014


https://bugs.winehq.org/show_bug.cgi?id=16699

Anastasius Focht <focht at gmx.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |download
             Status|UNCONFIRMED                 |NEW
                URL|                            |http://dl.trimble.com/sketc
                   |                            |hup/gsu8/FW-3-0-16846-EN.ex
                   |                            |e
                 CC|                            |focht at gmx.net
            Summary|OpenGL anti-aliasing        |OpenGL anti-aliasing
                   |capabilities of nVidia gpu  |capabilities of graphics
                   |not exposed to Google       |driver not exposed to
                   |Sketchup 7                  |Google Sketchup 7/8
                   |                            |(wglGetPixelFormatAttribivA
                   |                            |RB doesn't allow
                   |                            |WGL_SWAP_METHOD_ARB
                   |                            |support)
     Ever confirmed|0                           |1

--- Comment #23 from Anastasius Focht <focht at gmx.net> ---
Hello folks,

sorry being a few years late to the party ... confirming.

In my case the standard dialog 'Window' -> 'System Preferences' -> 'OpenGL'
shows:

--- snip ---
Colors: True color, Precision: Medium, Shadows: Yes, AA: 0x
#1  -> 1,ICD,DBL,RGBA,32 (8-8-8-0),24,8,64 (16-16-16-16)

Colors: True color, Precision: Medium, Shadows: No, AA: 0x
#38 -> 1,ICD,DBL,RGBA,32 (8-8-8-0),24,8,64 (16-16-16-16)
--- snip ---

Using trace log and a debugger I figured out the following ...

The app code looks for 'WGL_ARB_multisample' cap in extension string:

--- snip ---
0023:Call opengl32.wglGetProcAddress(00afc22c "wglGetExtensionsStringARB")
ret=0071106e
0023:trace:wgl:wglGetProcAddress returning wglGetExtensionsStringARB ->
0x7e340de2
0023:Ret  opengl32.wglGetProcAddress() retval=7e340de2 ret=0071106e
0023:Call opengl32.wglGetCurrentDC() ret=0071107a
0023:Ret  opengl32.wglGetCurrentDC() retval=00010028 ret=0071107a
0023:Call gdi32.__wine_get_wgl_driver(00010028,0000000b) ret=7e33e669
0023:Ret  gdi32.__wine_get_wgl_driver() retval=7d384fc0 ret=7e33e669
0023:trace:wgl:X11DRV_wglGetExtensionsStringARB () returning
"WGL_ARB_create_context WGL_ARB_create_context_profile
WGL_ARB_pixel_format_float WGL_ATI_pixel_format_float WGL_ARB_extensions_string
WGL_ARB_make_current_read WGL_ARB_multisample WGL_ARB_pbuffer
WGL_ARB_pixel_format WGL_ARB_render_texture WGL_NV_float_buffer
WGL_NV_render_texture_rectangle WGL_EXT_extensions_string WGL_EXT_swap_control
WGL_EXT_framebuffer_sRGB WGL_EXT_swap_control_tear WGL_NV_vertex_array_range
WGL_WINE_pixel_format_passthrough"
...
0023:Call msvcr80.strstr(7d388a90 "WGL_ARB_create_context
WGL_ARB_create_context_profile WGL_ARB_pixel_format_float
WGL_ATI_pixel_format_float WGL_ARB_extensions_string WGL_ARB_make_current_read
WGL_ARB_multisample WGL_ARB_pbuffer WGL_ARB_pixel_format WGL_ARB_render_texture
WGL_NV_float_buffer WGL_NV_render_texture_rectangle WGL_EXT_e"...,00afc354
"WGL_ARB_multisample") ret=007110bd
0023:Ret  msvcr80.strstr() retval=7d388b30 ret=007110bd
--- snip ---

If supported it proceeds to check for 4x multisampling support
(GLX_SAMPLES_ARB: 4).
This succeeds in my case, I have NVIDIA blob:

--- snip ---
0023:Call gdi32.__wine_get_wgl_driver(0002004e,0000000b) ret=7e33e669
0023:Ret  gdi32.__wine_get_wgl_driver() retval=7d384fc0 ret=7e33e669
0023:trace:wgl:X11DRV_wglChoosePixelFormatARB (0x2004e, 0x33ddc4, 0x33ddac, 1,
0x33dd9c, 0x33dda4): hackish
0023:fixme:wgl:X11DRV_wglChoosePixelFormatARB unused pfAttribFList
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[0] = 2001
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[1] = WGL_DRAW_TO_WINDOW_ARB: 1
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[2] = 2010
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[3] = WGL_SUPPORT_OPENGL_ARB: 1
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[4] = 2003
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[5] = WGL_ACCELERATION_ARB: 8231
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[6] = 2014
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[7] = GLX_BUFFER_SIZE: 24
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[8] = 201b
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[9] = GLX_ALPHA_SIZE: 8
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[10] = 2022
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[11] = GLX_DEPTH_SIZE: 16
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[12] = 2023
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[13] = GLX_STENCIL_SIZE: 8
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[14] = 2011
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[15] = GLX_DOUBLEBUFFER: 1
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[16] = 2041
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[17] = GLX_SAMPLE_BUFFERS_ARB: 1
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[18] = 2042
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[19] = GLX_SAMPLES_ARB: 4
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[20] = 2007
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[21] = WGL_SWAP_METHOD_ARB: 0x2028
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[?] = GLX_DRAWABLE_TYPE: 0x1
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[?] = GLX_RENDER_TYPE: 0xffffffff
0023:trace:wgl:ConvertAttribWGLtoGLX pAttr[?] = GLX_FLOAT_COMPONENTS_NV:
0xffffffff
0023:trace:wgl:X11DRV_wglChoosePixelFormatARB at 1/9 found FBCONFIG_ID 0x133
(59)
--- snip ----

It then queries for 'WGL_SWAP_METHOD_ARB' attribute and specifically checks for
'WGL_SWAP_EXCHANGE_ARB' value upon return.

--- snip ----
0023:Call gdi32.__wine_get_wgl_driver(0002004e,0000000b) ret=7e33e669
0023:Ret  gdi32.__wine_get_wgl_driver() retval=7d384fc0 ret=7e33e669
0023:trace:wgl:X11DRV_wglGetPixelFormatAttribivARB (0x2004e, 59, 0, 1,
0x33ddb4, 0x33dda0)
0023:trace:wgl:get_pixel_format Returning fmt_id=0x133 for iPixelFormat=59
0023:trace:wgl:X11DRV_wglGetPixelFormatAttribivARB pAttr[0] = 2007
--- snip ----

This fails, debugger session:

--- snip ---

Wine-dbg>bt
Backtrace:
=>0 0x7d337d32 X11DRV_wglGetPixelFormatAttribivARB+0x757(hdc=0x10028,
iPixelFormat=0x25, iLayerPlane=0, nAttributes=0x1, piAttributes=0x33f690,
piValues=0x33f688)
[/home/focht/projects/wine/wine.repo/src/dlls/winex11.drv/opengl.c:2744] in
winex11 (0x0033f608)
  1 0x7e340b25 wglGetPixelFormatAttribivARB+0x68(hdc=0x10028, format=0x25,
layer=0, count=0x1, attribs=0x33f690, values=0x33f688)
[/home/focht/projects/wine/wine.repo/src/dlls/opengl32/wgl.c:929] in opengl32
(0x0033f64c)
  2 0x007239d3 in sketchup (+0x3239d2) (0x7e340abc)

Wine-dbg>n
2620            switch (curWGLAttr) {
Wine-dbg>n
2744                    piValues[i] = WGL_SWAP_EXCHANGE_ARB;

...

Wine-dbg>n
2812            if (0 != curGLXAttr && iPixelFormat != 0) {
Wine-dbg>n
2818                piValues[i] = GL_FALSE; 
--- snip ---

Source:

http://source.winehq.org/git/wine.git/blob/351fae120690a19530f0c399f0a8956aa877b16d:/dlls/winex11.drv/opengl.c#l2739

http://source.winehq.org/git/wine.git/blob/351fae120690a19530f0c399f0a8956aa877b16d:/dlls/winex11.drv/opengl.c#l2803

The same sequence is executed again for 2x multisample which also fails.

In the end it reports "swap copy unavailable" and keeps multisampling disabled
for the pixel format.

I researched some tutorials how to check for proper multisampling support, for
example here:

http://nehe.gamedev.net/tutorial/fullscreen_antialiasing/16008/

Nowhere was a connection between multisampling support and WGL_SWAP_METHOD_ARB
made.

Anyway, hacking 'winex11.drv' to allow 'wglGetPixelFormatAttribivARB' to return
'WGL_SWAP_EXCHANGE_ARB' for the selected pixel formats helped.

The comment in Wine source indicates this is a weak area (TODO).

The 'OpenGL' dialog window now showed 3 pixel formats with 0x, 2x, 4x
anti-aliasing.

When I selected 2x or 4x anti-aliasing in the dialog, everything became
smoother so it really worked :)

$ sha1sum FW-3-0-16846-EN.exe 
6c9a61fe12b21fe9a1d6b5ee1bb79f331a5fc36c  FW-3-0-16846-EN.exe

$ du -sh FW-3-0-16846-EN.exe 
35M    FW-3-0-16846-EN.exe

$ wine --version
wine-1.7.21-19-g8812193

Regards

-- 
Do not reply to this email, post in Bugzilla using the
above URL to reply.
You are receiving this mail because:
You are watching all bug changes.



More information about the wine-bugs mailing list