Zebediah Figura : wined3d: Introduce wined3d_stateblock_set_render_state().

Alexandre Julliard julliard at winehq.org
Fri Oct 18 14:01:15 CDT 2019


Module: wine
Branch: master
Commit: d66b8592faab40ff3272880dde60f7c8da15122c
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=d66b8592faab40ff3272880dde60f7c8da15122c

Author: Zebediah Figura <z.figura12 at gmail.com>
Date:   Thu Oct  3 19:38:04 2019 -0500

wined3d: Introduce wined3d_stateblock_set_render_state().

Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/wined3d/stateblock.c | 15 +++++++++++++++
 dlls/wined3d/wined3d.spec |  1 +
 include/wine/wined3d.h    |  2 ++
 3 files changed, 18 insertions(+)

diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index dae95ae46e..42d1d9d4d8 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1419,6 +1419,21 @@ void CDECL wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *
     stateblock->changed.vertexDecl = TRUE;
 }
 
+void CDECL wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock,
+        enum wined3d_render_state state, DWORD value)
+{
+    TRACE("stateblock %p, state %s (%#x), value %#x.\n", stateblock, debug_d3drenderstate(state), state, value);
+
+    if (state > WINEHIGHEST_RENDER_STATE)
+    {
+        WARN("Unhandled render state %#x.\n", state);
+        return;
+    }
+
+    stateblock->stateblock_state.rs[state] = value;
+    stateblock->changed.renderState[state >> 5] |= 1u << (state & 0x1f);
+}
+
 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 b65681f210..488b1c4e65 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -262,6 +262,7 @@
 @ cdecl wined3d_stateblock_set_ps_consts_b(ptr long long ptr)
 @ cdecl wined3d_stateblock_set_ps_consts_f(ptr long long ptr)
 @ cdecl wined3d_stateblock_set_ps_consts_i(ptr long long ptr)
+@ cdecl wined3d_stateblock_set_render_state(ptr long long)
 @ cdecl wined3d_stateblock_set_vertex_declaration(ptr ptr)
 @ cdecl wined3d_stateblock_set_vertex_shader(ptr ptr)
 @ cdecl wined3d_stateblock_set_vs_consts_b(ptr long long ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index f79cd212a1..8d13a245ad 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2667,6 +2667,8 @@ HRESULT __cdecl wined3d_stateblock_set_ps_consts_f(struct wined3d_stateblock *st
         unsigned int start_idx, unsigned int count, const struct wined3d_vec4 *constants);
 HRESULT __cdecl wined3d_stateblock_set_ps_consts_i(struct wined3d_stateblock *stateblock,
         unsigned int start_idx, unsigned int count, const struct wined3d_ivec4 *constants);
+void __cdecl wined3d_stateblock_set_render_state(struct wined3d_stateblock *stateblock,
+        enum wined3d_render_state state, DWORD value);
 void __cdecl wined3d_stateblock_set_vertex_declaration(struct wined3d_stateblock *stateblock,
         struct wined3d_vertex_declaration *declaration);
 void __cdecl wined3d_stateblock_set_vertex_shader(struct wined3d_stateblock *stateblock, struct wined3d_shader *shader);




More information about the wine-cvs mailing list