Matteo Bruni : wined3d: Avoid using GL_MAX_VARYING_FLOATS_ARB in core profile contexts.

Alexandre Julliard julliard at winehq.org
Fri Oct 12 18:00:41 CDT 2018


Module: wine
Branch: master
Commit: 985b96b09e3608498ca717abe384a5d37fab31e5
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=985b96b09e3608498ca717abe384a5d37fab31e5

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Fri Oct 12 15:39:57 2018 +0200

wined3d: Avoid using GL_MAX_VARYING_FLOATS_ARB in core profile contexts.

Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/adapter_gl.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c
index cedfe23..99df19c 100644
--- a/dlls/wined3d/adapter_gl.c
+++ b/dlls/wined3d/adapter_gl.c
@@ -3079,9 +3079,18 @@ static void wined3d_adapter_init_limits(struct wined3d_gl_info *gl_info, struct
         gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB, &gl_max);
         gl_info->limits.glsl_ps_float_constants = gl_max / 4;
         TRACE("Max ARB_FRAGMENT_SHADER float constants: %u.\n", gl_info->limits.glsl_ps_float_constants);
-        gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max);
-        gl_info->limits.glsl_varyings = gl_max;
-        TRACE("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_max, gl_max / 4);
+        if (gl_info->supported[WINED3D_GL_LEGACY_CONTEXT])
+        {
+            gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_VARYING_FLOATS_ARB, &gl_max);
+            gl_info->limits.glsl_varyings = gl_max;
+        }
+        else
+        {
+            gl_info->gl_ops.gl.p_glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &gl_max);
+            gl_info->limits.glsl_varyings = gl_max - 4;
+        }
+        TRACE("Max GLSL varyings: %u (%u 4 component varyings).\n", gl_info->limits.glsl_varyings,
+                gl_info->limits.glsl_varyings / 4);
 
         if (gl_info->supported[ARB_UNIFORM_BUFFER_OBJECT])
         {




More information about the wine-cvs mailing list