Module: wine Branch: master Commit: fe4a226bfa405a46a0cf40eb2f6bb5addbf06990 URL: http://source.winehq.org/git/wine.git/?a=commit;h=fe4a226bfa405a46a0cf40eb2f...
Author: Matteo Bruni mbruni@codeweavers.com Date: Wed Mar 18 21:07:34 2015 +0100
wined3d: Introduce a get_identity_matrix() function.
---
dlls/wined3d/stateblock.c | 9 ++------- dlls/wined3d/utils.c | 13 +++++++++++++ dlls/wined3d/wined3d_private.h | 2 ++ 3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/stateblock.c b/dlls/wined3d/stateblock.c index dc146fc..62b1841 100644 --- a/dlls/wined3d/stateblock.c +++ b/dlls/wined3d/stateblock.c @@ -1121,16 +1121,11 @@ static void state_init_default(struct wined3d_state *state, const struct wined3d DWORD d; } tmpfloat; unsigned int i; - static const struct wined3d_matrix identity = - {{{ - 1.0f, 0.0f, 0.0f, 0.0f, - 0.0f, 1.0f, 0.0f, 0.0f, - 0.0f, 0.0f, 1.0f, 0.0f, - 0.0f, 0.0f, 0.0f, 1.0f, - }}}; + struct wined3d_matrix identity;
TRACE("state %p, gl_info %p.\n", state, gl_info);
+ get_identity_matrix(&identity); state->gl_primitive_type = ~0u;
/* Set some of the defaults for lights, transforms etc */ diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 725318f..551dca8 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -3117,6 +3117,19 @@ BOOL is_invalid_op(const struct wined3d_state *state, int stage, return FALSE; }
+void get_identity_matrix(struct wined3d_matrix *mat) +{ + static const struct wined3d_matrix identity = + {{{ + 1.0f, 0.0f, 0.0f, 0.0f, + 0.0f, 1.0f, 0.0f, 0.0f, + 0.0f, 0.0f, 1.0f, 0.0f, + 0.0f, 0.0f, 0.0f, 1.0f, + }}}; + + *mat = identity; +} + /* Setup this textures matrix according to the texture flags. */ /* Context activation is done by the caller (state handler). */ void set_texture_matrix(const struct wined3d_gl_info *gl_info, const float *smat, DWORD flags, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index b0c7a53..4f03b1b 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -3037,6 +3037,8 @@ static inline BOOL shader_constant_is_local(const struct wined3d_shader *shader, return FALSE; }
+void get_identity_matrix(struct wined3d_matrix *mat) DECLSPEC_HIDDEN; + /* Using additional shader constants (uniforms in GLSL / program environment * or local parameters in ARB) is costly: * ARB only knows float4 parameters and GLSL compiler are not really smart