1
0
Fork 0
mirror of synced 2025-03-07 03:53:26 +01:00

wined3d/glsl: Always set WINED3D_SHADER_CONST_FFP_LIGHTS in FFP constant update masks.

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.
This commit is contained in:
Zebediah Figura 2023-10-28 17:12:43 -05:00 committed by Alexandre Julliard
parent 4171fdf4d7
commit b5a252bcec
2 changed files with 5 additions and 7 deletions

View file

@ -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);

View file

@ -10595,7 +10595,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)
{
@ -10619,8 +10619,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;