Commit 09eda02b authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Output all the texture coordinates in the FFP replacement VS when there…

wined3d: Output all the texture coordinates in the FFP replacement VS when there are enough varyings. Signed-off-by: 's avatarMatteo Bruni <mbruni@codeweavers.com> Signed-off-by: 's avatarHenri Verbeet <hverbeet@codeweavers.com>
parent 08b21528
......@@ -6803,7 +6803,7 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const
struct glsl_ffp_vertex_shader *ffp_shader;
struct wined3d_ffp_vs_settings settings;
wined3d_ffp_get_vs_settings(state, &context->stream_info, &settings);
wined3d_ffp_get_vs_settings(context, state, &settings);
ffp_shader = shader_glsl_find_ffp_vertex_shader(priv, gl_info, &settings);
vs_id = ffp_shader->id;
vs_list = &ffp_shader->linked_programs;
......@@ -7971,11 +7971,11 @@ static void glsl_vertex_pipe_vdecl(struct wined3d_context *context,
context->constant_update_mask |= WINED3D_SHADER_CONST_FFP_TEXMATRIX;
/* Because of settings->texcoords, we have to always regenerate the
* vertex shader on a vdecl change.
* TODO: Just always output all the texcoords when there are enough
* varyings available to drop the dependency. */
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
/* Because of settings->texcoords, we have to regenerate the vertex
* shader on a vdecl change if there aren't enough varyings to just
* always output all the texture coordinates. */
if (gl_info->limits.glsl_varyings < wined3d_max_compat_varyings(gl_info))
context->shader_update_mask |= 1u << WINED3D_SHADER_TYPE_VERTEX;
if (use_ps(state)
&& state->shader[WINED3D_SHADER_TYPE_PIXEL]->reg_maps.shader_version.major == 1
......
......@@ -4825,9 +4825,12 @@ const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions =
ffp_frag_program_key_compare,
};
void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct wined3d_stream_info *si,
struct wined3d_ffp_vs_settings *settings)
void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings)
{
const struct wined3d_stream_info *si = &context->stream_info;
const struct wined3d_gl_info *gl_info = context->gl_info;
const struct wined3d_d3d_info *d3d_info = context->d3d_info;
unsigned int coord_idx, i;
if (si->position_transformed)
......@@ -4851,6 +4854,8 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct
settings->texcoords |= 1u << i;
settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
}
if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info))
settings->texcoords = (1u << MAX_TEXTURES) - 1;
return;
}
......@@ -4900,6 +4905,8 @@ void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct
settings->texcoords |= 1u << i;
settings->texgen[i] = state->texture_states[i][WINED3D_TSS_TEXCOORD_INDEX];
}
if (d3d_info->limits.varying_count >= wined3d_max_compat_varyings(gl_info))
settings->texcoords = (1u << MAX_TEXTURES) - 1;
settings->light_type = 0;
for (i = 0; i < MAX_ACTIVE_LIGHTS; ++i)
......
......@@ -1939,8 +1939,8 @@ struct wined3d_ffp_vs_desc
struct wined3d_ffp_vs_settings settings;
};
void wined3d_ffp_get_vs_settings(const struct wined3d_state *state, const struct wined3d_stream_info *si,
struct wined3d_ffp_vs_settings *settings) DECLSPEC_HIDDEN;
void wined3d_ffp_get_vs_settings(const struct wined3d_context *context,
const struct wined3d_state *state, struct wined3d_ffp_vs_settings *settings) DECLSPEC_HIDDEN;
struct wined3d
{
......
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