wined3d: Add shader_precompile() to shader_backend_ops.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2017-04-13 11:21:44 +02:00 committed by Alexandre Julliard
parent 142a42c0c6
commit 2fc56cac4c
4 changed files with 15 additions and 1 deletions

View File

@ -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,

View File

@ -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,

View File

@ -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)

View File

@ -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,