From: Elizabeth Figura zfigura@codeweavers.com
It is possible (if somewhat artificial) to use lighting without using ambient lighting. In this case ffp_light_ambient may not be an active uniform.
We could be more sophisticated here, and add lighting to the mask if we use any lighting uniform, but this is simpler and probably good enough. --- dlls/d3d8/tests/visual.c | 8 ++++---- dlls/wined3d/glsl_shader.c | 4 +--- 2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/dlls/d3d8/tests/visual.c b/dlls/d3d8/tests/visual.c index f6217e5f400..c605b53606c 100644 --- a/dlls/d3d8/tests/visual.c +++ b/dlls/d3d8/tests/visual.c @@ -12325,13 +12325,13 @@ static void test_specular_shaders(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); get_surface_readback(context.backbuffer, &rb); color = get_readback_color(&rb, 160, 120); - todo_wine ok(color_match(color, 0x003300, 1), "Got color %08x.\n", color); + ok(color_match(color, 0x003300, 1), "Got color %08x.\n", color); color = get_readback_color(&rb, 480, 120); - todo_wine ok(color_match(color, 0x001900, 1), "Got color %08x.\n", color); + ok(color_match(color, 0x001900, 1), "Got color %08x.\n", color); color = get_readback_color(&rb, 160, 360); - todo_wine ok(color_match(color, 0x009900, 1), "Got color %08x.\n", color); + ok(color_match(color, 0x009900, 1), "Got color %08x.\n", color); color = get_readback_color(&rb, 480, 360); - todo_wine ok(color_match(color, 0x003300, 1), "Got color %08x.\n", color); + ok(color_match(color, 0x003300, 1), "Got color %08x.\n", color); release_surface_readback(&rb);
hr = IDirect3DDevice8_BeginScene(device); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 5dfcbb689b7..018b949f41c 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -10583,7 +10583,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl, else { entry->constant_update_mask |= WINED3D_SHADER_CONST_FFP_MODELVIEW - | WINED3D_SHADER_CONST_FFP_PROJ; + | WINED3D_SHADER_CONST_FFP_PROJ | WINED3D_SHADER_CONST_FFP_LIGHTS;
for (i = 1; i < MAX_VERTEX_BLENDS; ++i) { @@ -10607,8 +10607,6 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl, || 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; } if (entry->vs.clip_planes_location != -1) entry->constant_update_mask |= WINED3D_SHADER_CONST_VS_CLIP_PLANES;