diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index caa0d69d339..3b1eff9c8d8 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -5669,9 +5669,12 @@ static BOOL shader_arb_has_ffp_proj_control(void *shader_priv) return priv->ffp_proj_control; } +static void shader_arb_precompile(void *shader_priv, struct wined3d_shader *shader) {} + const struct wined3d_shader_backend_ops arb_program_shader_backend = { shader_arb_handle_instruction, + shader_arb_precompile, shader_arb_select, shader_arb_select_compute, shader_arb_disable, diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 994e0c70861..3f9e7a6c6e8 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -9458,6 +9458,10 @@ static void set_glsl_shader_program(const struct wined3d_context *context, const } } +static void shader_glsl_precompile(void *shader_priv, struct wined3d_shader *shader) +{ +} + /* Context activation is done by the caller. */ static void shader_glsl_select(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state) @@ -10242,6 +10246,7 @@ static BOOL shader_glsl_has_ffp_proj_control(void *shader_priv) const struct wined3d_shader_backend_ops glsl_shader_backend = { shader_glsl_handle_instruction, + shader_glsl_precompile, shader_glsl_select, shader_glsl_select_compute, shader_glsl_disable, diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 79270629587..3681a8d6212 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -2852,6 +2852,7 @@ struct shader_none_priv }; static void shader_none_handle_instruction(const struct wined3d_shader_instruction *ins) {} +static void shader_none_precompile(void *shader_priv, struct wined3d_shader *shader) {} static void shader_none_select_compute(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state) {} static void shader_none_update_float_vertex_constants(struct wined3d_device *device, UINT start, UINT count) {} @@ -2974,6 +2975,7 @@ static BOOL shader_none_has_ffp_proj_control(void *shader_priv) const struct wined3d_shader_backend_ops none_shader_backend = { shader_none_handle_instruction, + shader_none_precompile, shader_none_select, shader_none_select_compute, shader_none_disable, @@ -3076,8 +3078,11 @@ ULONG CDECL wined3d_shader_incref(struct wined3d_shader *shader) static void wined3d_shader_init_object(void *object) { struct wined3d_shader *shader = object; + struct wined3d_device *device = shader->device; - list_add_head(&shader->device->shaders, &shader->shader_list_entry); + list_add_head(&device->shaders, &shader->shader_list_entry); + + device->shader_backend->shader_precompile(device->shader_priv, shader); } static void wined3d_shader_destroy_object(void *object) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6f1ac3768e9..9e48b49bcc3 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -1334,6 +1334,7 @@ struct wined3d_vertex_pipe_ops; struct wined3d_shader_backend_ops { void (*shader_handle_instruction)(const struct wined3d_shader_instruction *); + void (*shader_precompile)(void *shader_priv, struct wined3d_shader *shader); void (*shader_select)(void *shader_priv, struct wined3d_context *context, const struct wined3d_state *state); void (*shader_select_compute)(void *shader_priv, struct wined3d_context *context,