[PATCH 2/5] wined3d: Check all the ffp_material fields.

Matteo Bruni mbruni at codeweavers.com
Mon May 4 16:16:12 CDT 2015


The application can override each material parameter with one of the two
FFP vertex color attributes. The 'ambient' struct field in the GLSL shader
can thus happen to be unused and the GL driver may optimize it away.

Fixes bug 38532.
---
 dlls/wined3d/glsl_shader.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index a5399b2..0a130e1 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -6761,7 +6761,10 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
                 break;
             }
         }
-        if (entry->vs.material_ambient_location != -1)
+        if (entry->vs.material_ambient_location != -1 || entry->vs.material_diffuse_location != -1
+                || entry->vs.material_specular_location != -1
+                || entry->vs.material_emissive_location != -1
+                || entry->vs.material_shininess_location != -1)
             entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MATERIAL;
         if (entry->vs.light_ambient_location != -1)
             entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_LIGHTS;
-- 
2.3.6




More information about the wine-patches mailing list