At the moment wine always set the PFD_GENERIC_ACCELERATED flag in X11DRV_DescribePixelFormat. SeriousSam uses this flag to determine if the pixelformat is hardware accelerated. If the flag is set it is interpreted as _no_ hardware acceleration available.
Unfortunately MSDN isn't really clear about what that flag really means: it describes it as: "The pixel format is supported by a device driver that accelerates the generic implementation."
After reading [1] I think it should be like that instead: If PFD_GENERIC_ACCELERATED is set the pixelformat is partially accelerated by the device driver and some parts are just software fallbacks. If PFD_GENERIC_FORMAT is set everything is done in software. And only if none of both is set it is fully accelerated in hardware.
Is there anything similiar in GLX(full vs. partial accelerated) so we could set that flag according to that? Or, if not, can we just drop it? Imo it's better always off than always on.
Thanks Peter
well my mail may be off-topic/irrelevant please have a look at http://www.opengl.org/resources/faq/technical/mswindows.htm
(faq no 5.040) thanks, vijay On 11/16/05, Peter Beutner p.beutner@gmx.net wrote:
At the moment wine always set the PFD_GENERIC_ACCELERATED flag in X11DRV_DescribePixelFormat. SeriousSam uses this flag to determine if the pixelformat is hardware accelerated. If the flag is set it is interpreted as _no_ hardware acceleration available.
Unfortunately MSDN isn't really clear about what that flag really means: it describes it as: "The pixel format is supported by a device driver that accelerates the generic implementation."
After reading [1] I think it should be like that instead: If PFD_GENERIC_ACCELERATED is set the pixelformat is partially accelerated by the device driver and some parts are just software fallbacks. If PFD_GENERIC_FORMAT is set everything is done in software. And only if none of both is set it is fully accelerated in hardware.
Is there anything similiar in GLX(full vs. partial accelerated) so we could set that flag according to that? Or, if not, can we just drop it? Imo it's better always off than always on.
Thanks Peter
On Wed, Nov 16, 2005 at 03:21:29PM +0100, Peter Beutner wrote:
At the moment wine always set the PFD_GENERIC_ACCELERATED flag in X11DRV_DescribePixelFormat. SeriousSam uses this flag to determine if the pixelformat is hardware accelerated. If the flag is set it is interpreted as _no_ hardware acceleration available.
Well, the best way to check this would be to run a test case on a Windows box with OpenGL installed and accelerated.
Then create the most standard pixel format (ie double buffer + depth buffer) and see what the pixel format is. If it does not fill GENERIC_ACCELERATED, we should do the same in Wine.
Note that the equivalent does not really exist in GLX (except maybe between the direct / indirect rendering pathes but this is not the same distinction than in Windows).
Lionel
On Wednesday 16 November 2005 19:08, Lionel Ulmer wrote:
On Wed, Nov 16, 2005 at 03:21:29PM +0100, Peter Beutner wrote:
At the moment wine always set the PFD_GENERIC_ACCELERATED flag in X11DRV_DescribePixelFormat. SeriousSam uses this flag to determine if the pixelformat is hardware accelerated. If the flag is set it is interpreted as _no_ hardware acceleration available.
Well, the best way to check this would be to run a test case on a Windows box with OpenGL installed and accelerated.
Then create the most standard pixel format (ie double buffer + depth buffer) and see what the pixel format is. If it does not fill GENERIC_ACCELERATED, we should do the same in Wine.
You can provide a similar behavior with opengl:
from http://rzaix12.rrz.uni-hamburg.de/doc_link/en_US/a_doc_lib/libs/openglrf/glX...
<snip> GLX_CONFIG_CAVEAT This attribute defines any problems that the GLX FBConfig may have:
GLX_NONE No caveats GLX_SLOW_CONFIG A drawable with this configuration may run at reduced performance. GLX_NON_CONFORMANT_CONFIG A drawable with this configuration will not pass the required OpenGL conformance tests. <snip>
as example you can see wglGetPixelFormatAttribivARB implementation in dlls/opengl/wgl_ext.c :)
But you must test what windows provide and on which configs
Regards, Raphael
Raphael schrieb:
You can provide a similar behavior with opengl:
from http://rzaix12.rrz.uni-hamburg.de/doc_link/en_US/a_doc_lib/libs/openglrf/glX...
<snip> GLX_CONFIG_CAVEAT This attribute defines any problems that the GLX FBConfig may have:
GLX_NONE No caveats GLX_SLOW_CONFIG A drawable with this configuration may run at reduced performance. GLX_NON_CONFORMANT_CONFIG A drawable with this configuration will not pass the required OpenGL conformance tests.
<snip>
as example you can see wglGetPixelFormatAttribivARB implementation in dlls/opengl/wgl_ext.c :)
Thanks for the hint. :) So something like the attached patch would be ok?
Note: I'm not really sure if both PFD_GENERIC_FORMAT | PFD_GENERIC_ACCELERATED should be set for GLX_SLOW_CONFIG or only the latter one. Or only PFD_GENERIC_FORMAT. If you think of PFD_GENERIC_FORMAT as "really slow" and PFD_GENERIC_ACCELERATED as "faster, but still slow", I dunno how that should be compared to GLX_SLOW_CONFIG ;)
And I don't know enough about OpenGL programming(in fact almost nothing) to say what flag in general is used to be checked by applications.
Perhaps just place a TRACE in the GLX_SLOW_CONFIG path to better catch it if there is a an application which might have trouble with this?
Peter
But you must test what windows provide and on which configs
Regards, Raphael
diff --git a/dlls/x11drv/opengl.c b/dlls/x11drv/opengl.c index e2fff7e..7763c21 100644 --- a/dlls/x11drv/opengl.c +++ b/dlls/x11drv/opengl.c @@ -358,11 +358,15 @@ int X11DRV_DescribePixelFormat(X11DRV_PD ppfd->nVersion = 1;
/* These flags are always the same... */ - ppfd->dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL | PFD_GENERIC_ACCELERATED; - /* Now the flags extraced from the Visual */ + ppfd->dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_OPENGL; + /* Now the flags extracted from the Visual */
wine_tsx11_lock();
+ pglXGetFBConfigAttrib(gdi_display, cur, GLX_CONFIG_CAVEAT, &value); + if(value == GLX_SLOW_CONFIG) + ppfd->dwFlags |= PFD_GENERIC_ACCELERATED; + pglXGetFBConfigAttrib(gdi_display, cur, GLX_DOUBLEBUFFER, &value); if (value) ppfd->dwFlags |= PFD_DOUBLEBUFFER; pglXGetFBConfigAttrib(gdi_display, cur, GLX_STEREO, &value); if (value) ppfd->dwFlags |= PFD_STEREO;
Thanks for the hint. :) So something like the attached patch would be ok?
Well, it looks OK for me so you can submit it.
I would have been more 'brutal' than you: if on Windows one does not see an example of a pixel format with this flag set, just never set it on Wine either :-)
Lionel
On Thursday 17 November 2005 19:17, Lionel Ulmer wrote:
Thanks for the hint. :) So something like the attached patch would be ok?
Well, it looks OK for me so you can submit it.
For me too
I would have been more 'brutal' than you: if on Windows one does not see an example of a pixel format with this flag set, just never set it on Wine either :-)
No i prefer Peter patch, else programs will select no-accelerated FB configs thinking they are optimised.
Lionel
Regards, Raphael
Lionel Ulmer schrieb:
On Wed, Nov 16, 2005 at 03:21:29PM +0100, Peter Beutner wrote:
At the moment wine always set the PFD_GENERIC_ACCELERATED flag in X11DRV_DescribePixelFormat. SeriousSam uses this flag to determine if the pixelformat is hardware accelerated. If the flag is set it is interpreted as _no_ hardware acceleration available.
Well, the best way to check this would be to run a test case on a Windows box with OpenGL installed and accelerated.
Then create the most standard pixel format (ie double buffer + depth buffer) and see what the pixel format is. If it does not fill GENERIC_ACCELERATED, we should do the same in Wine.
hm as far as I had understand that there is no direct way to determine whether hardware acceleration is used or not.The only way is to do it indirectly via DescribePixelFormat(). So I can't really use DescribePixelFormat at the same time to test whether the GENERIC_ACCELERATED flag stands for hardware acceleration or not. It's kind of chicken and egg problem ;)
However I will just assume that ATI ships its opengl drivers with full hardware acceleration support.Attached is the output from wglinfo[1]. The column 'geac' shows the PFD_GENERIC_ACCELERATED flag.As you can see it is never set. So from this I would conclude that PFD_GENERIC_ACCELERATED should not be set.(at least not unconditionally)
Peter
[1] You can get wglinfo from here: http://www.cg.tuwien.ac.at/~wimmer/wglinfo/
Note that the equivalent does not really exist in GLX (except maybe between the direct / indirect rendering pathes but this is not the same distinction than in Windows).
Lionel
OpenGL vendor string: ATI Technologies Inc. OpenGL renderer string: MOBILITY RADEON 9600 x86/SSE2 OpenGL version string: 1.5.4773 WinXP Release OpenGL extensions (GL_): GL_ARB_multitexture, GL_EXT_texture_env_add, GL_EXT_compiled_vertex_array, GL_S3_s3tc, GL_ARB_depth_texture, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_multisample, GL_ARB_occlusion_query, GL_ARB_point_parameters, GL_ARB_point_sprite, GL_ARB_shader_objects, GL_ARB_shading_language_100, GL_ARB_shadow, GL_ARB_shadow_ambient, GL_ARB_texture_border_clamp, GL_ARB_texture_compression, GL_ARB_texture_cube_map, GL_ARB_texture_env_add, GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat, GL_ARB_transpose_matrix, GL_ARB_vertex_blend, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ARB_window_pos, GL_ATI_draw_buffers, GL_ATI_element_array, GL_ATI_envmap_bumpmap, GL_ATI_fragment_shader, GL_ATI_map_object_buffer, GL_ATI_separate_stencil, GL_ATI_texture_env_combine3, GL_ATI_texture_float, GL_ATI_texture_mirror_once, GL_ATI_vertex_array_object, GL_ATI_vertex_attrib_array_object, GL_ATI_vertex_streams, GL_ATIX_texture_env_combine3, GL_ATIX_texture_env_route, GL_ATIX_vertex_shader_output_point_size, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, GL_EXT_blend_func_separate, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint, GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, GL_EXT_packed_pixels, GL_EXT_point_parameters, GL_EXT_rescale_normal, GL_EXT_secondary_color, GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap, GL_EXT_texgen_reflection, GL_EXT_texture3D, GL_EXT_texture_compression_s3tc, GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, GL_EXT_texture_object, GL_EXT_texture_rectangle, GL_EXT_vertex_array, GL_EXT_vertex_shader, GL_HP_occlusion_test, GL_NV_texgen_reflection, GL_NV_blend_square, GL_NV_occlusion_query, GL_SGI_color_matrix, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_border_clamp, GL_SGIS_texture_lod, GL_SGIS_generate_mipmap, GL_SGIS_multitexture, GL_SUN_multi_draw_arrays, GL_WIN_swap_hint, WGL_EXT_extensions_string, WGL_EXT_swap_control.
visual x bf lv rg d st ge ge r g b a ax dp st accum buffs ms id dep cl sp sz l ci b ro ne ac sz sz sz sz bf th cl r g b a ns b ----------------------------------------------------------------------- 0x01 32 wn . 32 . r . . . . 8 8 8 8 . 24 8 . . . . . . 0x02 32 wn . 32 . r . . . . 8 8 8 8 . 24 8 16 16 16 16 . . 0x03 32 wn . 32 . r . . . . 8 8 8 8 . 24 8 . . . . . . 0x04 32 wn . 32 . r . . . . 8 8 8 8 . 24 8 16 16 16 16 . . 0x05 32 wn . 32 . r y . . . 8 8 8 8 . 24 8 . . . . . . 0x06 32 wn . 32 . r y . . . 8 8 8 8 . 24 8 16 16 16 16 . . 0x07 32 wn . 32 . r . . . . 8 8 8 8 1 24 8 . . . . . . 0x08 32 wn . 32 . r . . . . 8 8 8 8 1 24 8 16 16 16 16 . . 0x09 32 wn . 32 . r . . . . 8 8 8 8 1 24 8 . . . . . . 0x0a 32 wn . 32 . r . . . . 8 8 8 8 1 24 8 16 16 16 16 . . 0x0b 32 wn . 32 . r y . . . 8 8 8 8 1 24 8 . . . . . . 0x0c 32 wn . 32 . r y . . . 8 8 8 8 1 24 8 16 16 16 16 . . 0x0d 32 wn . 32 . r . . . . 8 8 8 8 2 24 8 . . . . . . 0x0e 32 wn . 32 . r . . . . 8 8 8 8 2 24 8 16 16 16 16 . . 0x0f 32 wn . 32 . r . . . . 8 8 8 8 2 24 8 . . . . . . 0x10 32 wn . 32 . r . . . . 8 8 8 8 2 24 8 16 16 16 16 . . 0x11 32 wn . 32 . r y . . . 8 8 8 8 2 24 8 . . . . . . 0x12 32 wn . 32 . r y . . . 8 8 8 8 2 24 8 16 16 16 16 . . 0x13 32 wn . 32 . r . . . . 8 8 8 8 3 24 8 . . . . . . 0x14 32 wn . 32 . r . . . . 8 8 8 8 3 24 8 16 16 16 16 . . 0x15 32 wn . 32 . r . . . . 8 8 8 8 3 24 8 . . . . . . 0x16 32 wn . 32 . r . . . . 8 8 8 8 3 24 8 16 16 16 16 . . 0x41 32 wn . 32 . r . . y . 8 8 8 . . 32 8 16 16 16 . . . 0x42 32 wn . 32 . r . . y . 8 8 8 . . 16 8 16 16 16 . . . 0x43 32 wn . 32 . r y . y . 8 8 8 . . 32 8 16 16 16 . . . 0x44 32 wn . 32 . r y . y . 8 8 8 . . 16 8 16 16 16 . . . 0x45 32 wn . 32 . r . . y . 8 8 8 8 . 32 8 16 16 16 16 . . 0x46 32 wn . 32 . r . . y . 8 8 8 8 . 16 8 16 16 16 16 . . 0x47 32 wn . 32 . r y . y . 8 8 8 8 . 32 8 16 16 16 16 . . 0x48 32 wn . 32 . r y . y . 8 8 8 8 . 16 8 16 16 16 16 . . 0x49 32 wn . 32 . c . . y . . . . . . 32 8 . . . . . . 0x4a 32 wn . 32 . c . . y . . . . . . 16 8 . . . . . . 0x4b 32 wn . 32 . c y . y . . . . . . 32 8 . . . . . . 0x4c 32 wn . 32 . c y . y . . . . . . 16 8 . . . . . . 0x4d 24 bm . 24 . r . . y . 8 8 8 . . 32 8 16 16 16 . . . 0x4e 24 bm . 24 . r . . y . 8 8 8 . . 16 8 16 16 16 . . . 0x4f 24 bm . 24 . r . . y . 8 8 8 8 . 32 8 16 16 16 16 . . 0x50 24 bm . 24 . r . . y . 8 8 8 8 . 16 8 16 16 16 16 . . 0x51 24 bm . 24 . c . . y . . . . . . 32 8 . . . . . . 0x52 24 bm . 24 . c . . y . . . . . . 16 8 . . . . . . 0x53 16 bm . 16 . r . . y . 5 5 5 . . 32 8 11 11 10 . . . 0x54 16 bm . 16 . r . . y . 5 5 5 . . 16 8 11 11 10 . . . 0x55 16 bm . 16 . r . . y . 5 5 5 8 . 32 8 8 8 8 8 . . 0x56 16 bm . 16 . r . . y . 5 5 5 8 . 16 8 8 8 8 8 . . 0x57 16 bm . 16 . c . . y . . . . . . 32 8 . . . . . . 0x58 16 bm . 16 . c . . y . . . . . . 16 8 . . . . . . 0x59 8 bm . 8 . r . . y . 3 3 2 . . 32 8 11 11 10 . . . 0x5a 8 bm . 8 . r . . y . 3 3 2 . . 16 8 11 11 10 . . . 0x5b 8 bm . 8 . r . . y . 3 3 2 8 . 32 8 8 8 8 8 . . 0x5c 8 bm . 8 . r . . y . 3 3 2 8 . 16 8 8 8 8 8 . . 0x5d 8 bm . 8 . c . . y . . . . . . 32 8 . . . . . . 0x5e 8 bm . 8 . c . . y . . . . . . 16 8 . . . . . . 0x5f 4 bm . 4 . r . . y . 1 1 1 . . 32 8 5 6 5 . . . 0x60 4 bm . 4 . r . . y . 1 1 1 . . 16 8 5 6 5 . . . 0x61 4 bm . 4 . r . . y . 1 1 1 8 . 32 8 4 4 4 4 . . 0x62 4 bm . 4 . r . . y . 1 1 1 8 . 16 8 4 4 4 4 . . 0x63 4 bm . 4 . c . . y . . . . . . 32 8 . . . . . . 0x64 4 bm . 4 . c . . y . . . . . . 16 8 . . . . . . ----------------------------------------------------------------------- visual x bf lv rg d st ge ge r g b a ax dp st accum buffs ms id dep cl sp sz l ci b ro ne ac sz sz sz sz bf th cl r g b a ns b -----------------------------------------------------------------------