On Sun, Jan 29, 2017 at 2:43 PM, Guillaume Charifi
<guillaume.charifi(a)sfr.fr> wrote:
> - if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_VERTEX)) && ctx_data->glsl_program)
> + cshader = state->shader[WINED3D_SHADER_TYPE_COMPUTE];
> + if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_COMPUTE))
> + && ctx_data->glsl_program->cs.id)
> {
> - vs_id = ctx_data->glsl_program->vs.id;
> - vs_list = &ctx_data->glsl_program->vs.shader_entry;
> + cs_id = ctx_data->glsl_program->cs.id;
> + }
> + else if (cshader)
> + {
> + struct cs_compile_args args;
>
> - if (use_vs(state))
> + find_cs_compile_args(state, cshader, &args);
> + cs_id = find_glsl_compute_shader(context, priv, cshader, &args);
> + }
> +
> + if(!cs_id)
> + {
> + if (!(context->shader_update_mask & (1u << WINED3D_SHADER_TYPE_VERTEX)) && ctx_data->glsl_program)
> + {
> + vs_id = ctx_data->glsl_program->vs.id;
> + vs_list = &ctx_data->glsl_program->vs.shader_entry;
> +
> + if (use_vs(state))
> + vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX];
> + }
> + else if (use_vs(state))
> {
> + struct vs_compile_args vs_compile_args;
> +
> vshader = state->shader[WINED3D_SHADER_TYPE_VERTEX];
> +
> + find_vs_compile_args(state, vshader, context->stream_info.swizzle_map, &vs_compile_args, d3d_info);
> + vs_id = find_glsl_vshader(context, priv, vshader, &vs_compile_args);
> + vs_list = &vshader->linked_programs;
> + }
> + else if (priv->vertex_pipe == &glsl_vertex_pipe)
> + {
> + struct glsl_ffp_vertex_shader *ffp_shader;
> + struct wined3d_ffp_vs_settings 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;
> + }
> +
> + if (use_vs(state))
> + {
It doesn't seem reasonable to create a GL program for each combination
of graphics pipeline and compute pipeline shaders. A single GL program
for each compute shader is enough.