Module: wine
Branch: master
Commit: 4f3d39005185b26b04b3fc6a1242acfe79c74b33
URL: http://source.winehq.org/git/wine.git/?a=commit;h=4f3d39005185b26b04b3fc6a1…
Author: Henri Verbeet <hverbeet(a)codeweavers.com>
Date: Wed Nov 23 14:30:31 2016 +0100
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(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/wined3d/directx.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index c9b9146..3f200f5 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -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;