[PATCH 2/7] wined3d: Introduce wined3d_stateblock_set_vertex_shader().

Zebediah Figura z.figura12 at gmail.com
Sat Jun 22 10:29:17 CDT 2019


Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
 dlls/wined3d/stateblock.c | 12 ++++++++++++
 dlls/wined3d/wined3d.spec |  1 +
 include/wine/wined3d.h    |  1 +
 3 files changed, 14 insertions(+)

diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 80e58114c10..72affacfca6 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1274,6 +1274,18 @@ void CDECL wined3d_stateblock_apply(const struct wined3d_stateblock *stateblock)
     TRACE("Applied stateblock %p.\n", stateblock);
 }
 
+void CDECL wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader)
+{
+    TRACE("stateblock %p, shader %p.\n", stateblock, shader);
+
+    if (shader)
+        wined3d_shader_incref(shader);
+    if (stateblock->stateblock_state.vs)
+        wined3d_shader_decref(stateblock->stateblock_state.vs);
+    stateblock->stateblock_state.vs = shader;
+    stateblock->changed.vertexShader = TRUE;
+}
+
 static void init_default_render_states(DWORD rs[WINEHIGHEST_RENDER_STATE + 1], const struct wined3d_d3d_info *d3d_info)
 {
     union
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index 9b4f4792f5d..a01a9991737 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -260,6 +260,7 @@
 @ cdecl wined3d_stateblock_create(ptr long ptr)
 @ cdecl wined3d_stateblock_decref(ptr)
 @ cdecl wined3d_stateblock_incref(ptr)
+@ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr)
 
 @ cdecl wined3d_swapchain_create(ptr ptr ptr ptr ptr)
 @ cdecl wined3d_swapchain_decref(ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 27776385313..de41b19ee7d 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2666,6 +2666,7 @@ HRESULT __cdecl wined3d_stateblock_create(struct wined3d_device *device,
         enum wined3d_stateblock_type type, struct wined3d_stateblock **stateblock);
 ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
 ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
+void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);
 
 HRESULT __cdecl wined3d_swapchain_create(struct wined3d_device *device, struct wined3d_swapchain_desc *desc,
         void *parent, const struct wined3d_parent_ops *parent_ops, struct wined3d_swapchain **swapchain);
-- 
2.21.0




More information about the wine-devel mailing list