[PATCH 1/4] wined3d: Introduce wined3d_stateblock_multiply_transform().
Zebediah Figura
z.figura12 at gmail.com
Tue Dec 3 22:23:22 CST 2019
Signed-off-by: Zebediah Figura <z.figura12 at gmail.com>
---
Alternatively, this could be done using wined3d_stateblock_get_state() plus
wined3d_stateblock_set_transform().
dlls/wined3d/stateblock.c | 14 ++++++++++++++
dlls/wined3d/wined3d.spec | 1 +
include/wine/wined3d.h | 2 ++
3 files changed, 17 insertions(+)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c
index 24134b8f3ef..f6d36f8c259 100644
--- a/dlls/wined3d/stateblock.c
+++ b/dlls/wined3d/stateblock.c
@@ -1505,6 +1505,20 @@ void CDECL wined3d_stateblock_set_transform(struct wined3d_stateblock *statebloc
stateblock->changed.transform[d3dts >> 5] |= 1u << (d3dts & 0x1f);
}
+void CDECL wined3d_stateblock_multiply_transform(struct wined3d_stateblock *stateblock,
+ enum wined3d_transform_state d3dts, const struct wined3d_matrix *matrix)
+{
+ struct wined3d_matrix *mat = &stateblock->stateblock_state.transforms[d3dts];
+
+ TRACE("stateblock %p, state %s, matrix %p.\n", stateblock, debug_d3dtstype(d3dts), matrix);
+ TRACE("%.8e %.8e %.8e %.8e\n", matrix->_11, matrix->_12, matrix->_13, matrix->_14);
+ TRACE("%.8e %.8e %.8e %.8e\n", matrix->_21, matrix->_22, matrix->_23, matrix->_24);
+ TRACE("%.8e %.8e %.8e %.8e\n", matrix->_31, matrix->_32, matrix->_33, matrix->_34);
+ TRACE("%.8e %.8e %.8e %.8e\n", matrix->_41, matrix->_42, matrix->_43, matrix->_44);
+
+ multiply_matrix(mat, mat, matrix);
+}
+
HRESULT CDECL wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock,
UINT plane_idx, const struct wined3d_vec4 *plane)
{
diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec
index e10095c796d..c8ef442c72d 100644
--- a/dlls/wined3d/wined3d.spec
+++ b/dlls/wined3d/wined3d.spec
@@ -263,6 +263,7 @@
@ cdecl wined3d_stateblock_get_state(ptr)
@ cdecl wined3d_stateblock_incref(ptr)
@ cdecl wined3d_stateblock_init_contained_states(ptr)
+@ cdecl wined3d_stateblock_multiply_transform(ptr long ptr)
@ cdecl wined3d_stateblock_reset(ptr)
@ cdecl wined3d_stateblock_set_base_vertex_index(ptr long)
@ cdecl wined3d_stateblock_set_clip_plane(ptr long ptr)
diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h
index 89c1d898cd5..650fc52a046 100644
--- a/include/wine/wined3d.h
+++ b/include/wine/wined3d.h
@@ -2725,6 +2725,8 @@ ULONG __cdecl wined3d_stateblock_decref(struct wined3d_stateblock *stateblock);
const struct wined3d_stateblock_state * __cdecl wined3d_stateblock_get_state(const struct wined3d_stateblock *stateblock);
ULONG __cdecl wined3d_stateblock_incref(struct wined3d_stateblock *stateblock);
void __cdecl wined3d_stateblock_init_contained_states(struct wined3d_stateblock *stateblock);
+void __cdecl wined3d_stateblock_multiply_transform(struct wined3d_stateblock *stateblock,
+ enum wined3d_transform_state state, const struct wined3d_matrix *matrix);
void __cdecl wined3d_stateblock_reset(struct wined3d_stateblock *stateblock);
void __cdecl wined3d_stateblock_set_base_vertex_index(struct wined3d_stateblock *stateblock, INT base_index);
HRESULT __cdecl wined3d_stateblock_set_clip_plane(struct wined3d_stateblock *stateblock,
--
2.23.0
More information about the wine-devel
mailing list