[PATCH 5/5] wined3d: Prefer shader backends that support both vertex and fragment shaders over ones that support only either.

Henri Verbeet hverbeet at codeweavers.com
Wed Nov 23 07:30:31 CST 2016


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 at codeweavers.com>
---
 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;
-- 
2.1.4




More information about the wine-patches mailing list