Commit 47bf6296 authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Initialize unwritten texcoord varyings in the FFP replacement vertex shader.

Only when the GPU supports enough varyings. Signed-off-by: 's avatarMatteo Bruni <mbruni@codeweavers.com>
parent c0b3f3f2
......@@ -5802,6 +5802,8 @@ static GLuint shader_glsl_generate_ffp_vertex_shader(struct wined3d_string_buffe
if (settings->texcoords & (1u << i))
shader_addline(buffer, "gl_TexCoord[%u] = ffp_texture_matrix[%u] * ffp_attrib_texcoord%u;\n",
i, i, i);
else if (gl_info->limits.glsl_varyings >= wined3d_max_compat_varyings(gl_info))
shader_addline(buffer, "gl_TexCoord[%u] = vec4(0.0);\n", i);
break;
case WINED3DTSS_TCI_CAMERASPACENORMAL:
......
......@@ -4343,6 +4343,13 @@ DWORD get_flexible_vertex_size(DWORD d3dvtVertexType) {
return size;
}
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info)
{
/* On core profile we have to also count diffuse and specular colors and the
* fog coordinate. */
return gl_info->supported[WINED3D_GL_LEGACY_CONTEXT] ? MAX_TEXTURES * 4 : (MAX_TEXTURES + 2) * 4 + 1;
}
void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state,
struct ffp_frag_settings *settings, BOOL ignore_textype)
{
......
......@@ -1877,6 +1877,7 @@ extern const struct wine_rb_functions wined3d_ffp_frag_program_rb_functions DECL
extern const struct wine_rb_functions wined3d_ffp_vertex_program_rb_functions DECLSPEC_HIDDEN;
extern const struct wined3d_parent_ops wined3d_null_parent_ops DECLSPEC_HIDDEN;
unsigned int wined3d_max_compat_varyings(const struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void gen_ffp_frag_op(const struct wined3d_context *context, const struct wined3d_state *state,
struct ffp_frag_settings *settings, BOOL ignore_textype) DECLSPEC_HIDDEN;
const struct ffp_frag_desc *find_ffp_frag_shader(const struct wine_rb_tree *fragment_shaders,
......
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