=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: wined3d: Add shader_precompile() to shader_backend_ops.

Alexandre Julliard julliard at winehq.org
Thu Apr 13 13:06:09 CDT 2017


Module: wine
Branch: master
Commit: 2fc56cac4c0aae0b5d0e38df7c5ab89f325f416c
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2fc56cac4c0aae0b5d0e38df7c5ab89f325f416c

Author: Józef Kucia <jkucia at codeweavers.com>
Date:   Thu Apr 13 11:21:44 2017 +0200

wined3d: Add shader_precompile() to shader_backend_ops.

Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/arb_program_shader.c | 3 +++
 dlls/wined3d/glsl_shader.c        | 5 +++++
 dlls/wined3d/shader.c             | 7 ++++++-
 dlls/wined3d/wined3d_private.h    | 1 +
 4 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c
index caa0d69..3b1eff9 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 994e0c7..3f9e7a6 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 7927062..3681a8d 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(&device->shaders, &shader->shader_list_entry);
 
-    list_add_head(&shader->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 6f1ac37..9e48b49 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,




More information about the wine-cvs mailing list