2015-05-28 23:43 GMT+02:00 Henri Verbeet hverbeet@gmail.com:
On 28 May 2015 at 23:23, Matteo Bruni mbruni@codeweavers.com wrote:
@@ -6987,6 +7006,13 @@ static void shader_glsl_select(void *shader_priv, struct wined3d_context *contex GLuint program_id = 0, prev_id = 0; GLenum old_vertex_color_clamp, current_vertex_color_clamp;
- if (!ctx_data->backend_init_done)
- {
gl_info->gl_ops.gl.p_glEnable(GL_PROGRAM_POINT_SIZE);
checkGLcall("GL_PROGRAM_POINT_SIZE");
ctx_data->backend_init_done = TRUE;
- }
Is this shared state between contexts? Otherwise you need to do this once for every context. Also, shader_glsl_select() is kind of a hot path, it may be better to just add an entry to struct wined3d_shader_backend_ops for this kind of initialization.
It's not shared but it should already be executed for each context (the flag is stored in struct wined3d_context). It would be surprising to me if that additional flag check has any performance impact since it is next to ctx_data->glsl_program which is accessed anyway just a bit later. It's probably cleaner to add a separate function though so I'm going to try that.