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