Matteo Bruni : wined3d: Check all the ffp_material fields.

Alexandre Julliard julliard at wine.codeweavers.com
Tue May 5 09:50:51 CDT 2015


Module: wine
Branch: master
Commit: 2bab1f7250b89021e7c0c246c4594cf919a98c8d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2bab1f7250b89021e7c0c246c4594cf919a98c8d

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Mon May  4 23:16:12 2015 +0200

wined3d: Check all the ffp_material fields.

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.

---

 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;




More information about the wine-cvs mailing list