wined3d: Initialize unwritten texcoord varyings in the FFP replacement vertex shader.
Only when the GPU supports enough varyings. Signed-off-by: Matteo Bruni <mbruni@codeweavers.com>
This commit is contained in:
parent
c0b3f3f2e8
commit
47bf62962a
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue