wined3d: Prefer shader backends that support both vertex and fragment shaders over ones that support only either.

Apparently there exist some configurations that support both
ARB_vertex_program and ARB_vertex_shader, but only ARB_fragment_program
and not ARB_fragment_shader. Note that this would change the selected
backend for the Geforce 4 cards mentioned in the comment, but hopefully
the mentioned GLSL bug is no longer a concern.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2016-11-23 14:30:31 +01:00 committed by Alexandre Julliard
parent 3de3e64e8b
commit 4f3d390051
1 changed files with 4 additions and 10 deletions

View File

@ -2504,18 +2504,12 @@ static const struct wined3d_shader_backend_ops *select_shader_backend(const stru
{
BOOL glsl = wined3d_settings.glslRequested && gl_info->glsl_version >= MAKEDWORD_VERSION(1, 20);
if (glsl && gl_info->supported[ARB_FRAGMENT_SHADER])
if (glsl && gl_info->supported[ARB_VERTEX_SHADER] && gl_info->supported[ARB_FRAGMENT_SHADER])
return &glsl_shader_backend;
if (glsl && gl_info->supported[ARB_VERTEX_SHADER])
{
/* Geforce4 cards support GLSL but for vertex shaders only. Further
* its reported GLSL caps are wrong. This combined with the fact that
* GLSL won't offer more features or performance, use ARB shaders only
* on this card. */
if (gl_info->supported[NV_VERTEX_PROGRAM] && !gl_info->supported[NV_VERTEX_PROGRAM2])
return &arb_program_shader_backend;
if (gl_info->supported[ARB_VERTEX_PROGRAM] && gl_info->supported[ARB_FRAGMENT_PROGRAM])
return &arb_program_shader_backend;
if (glsl && (gl_info->supported[ARB_VERTEX_SHADER] || gl_info->supported[ARB_FRAGMENT_SHADER]))
return &glsl_shader_backend;
}
if (gl_info->supported[ARB_VERTEX_PROGRAM] || gl_info->supported[ARB_FRAGMENT_PROGRAM])
return &arb_program_shader_backend;
return &none_shader_backend;