Commit 7757ecfc authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Only store light type counts in struct wined3d_ffp_vs_settings.

The ordering doesn't matter, so this avoids creating some redundant shader variants. Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent 7c5fd62e
......@@ -5717,9 +5717,27 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
for (i = 0; i < MAX_ACTIVE_LIGHTS; ++i)
{
if (state->lights[i])
settings->light_type |= (state->lights[i]->OriginalParms.type
& WINED3D_FFP_LIGHT_TYPE_MASK) << WINED3D_FFP_LIGHT_TYPE_SHIFT(i);
if (!state->lights[i])
continue;
switch (state->lights[i]->OriginalParms.type)
{
case WINED3D_LIGHT_POINT:
++settings->point_light_count;
break;
case WINED3D_LIGHT_SPOT:
++settings->spot_light_count;
break;
case WINED3D_LIGHT_DIRECTIONAL:
++settings->directional_light_count;
break;
case WINED3D_LIGHT_PARALLELPOINT:
++settings->parallel_point_light_count;
break;
default:
FIXME("Unhandled light type %#x.\n", state->lights[i]->OriginalParms.type);
break;
}
}
if (!state->render_states[WINED3D_RS_FOGENABLE])
......
......@@ -2377,12 +2377,14 @@ enum wined3d_ffp_vs_fog_mode
struct wined3d_ffp_vs_settings
{
DWORD light_type : 24; /* MAX_ACTIVE_LIGHTS, 8 * 3 */
DWORD point_light_count : 4;
DWORD spot_light_count : 4;
DWORD directional_light_count : 4;
DWORD parallel_point_light_count : 4;
DWORD diffuse_source : 2;
DWORD emissive_source : 2;
DWORD ambient_source : 2;
DWORD specular_source : 2;
DWORD transformed : 1;
DWORD vertexblends : 2;
DWORD clipping : 1;
......@@ -2390,17 +2392,17 @@ struct wined3d_ffp_vs_settings
DWORD normalize : 1;
DWORD lighting : 1;
DWORD localviewer : 1;
DWORD point_size : 1;
DWORD per_vertex_point_size : 1;
DWORD fog_mode : 2;
DWORD texcoords : 8; /* MAX_TEXTURES */
DWORD ortho_fog : 1;
DWORD flatshading : 1;
DWORD padding : 10;
DWORD swizzle_map : 16; /* MAX_ATTRIBS, 16 */
DWORD padding : 2;
DWORD texgen[MAX_TEXTURES];
WORD swizzle_map; /* MAX_ATTRIBS, 16 */
};
struct wined3d_ffp_vs_desc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment