Commit fe4a226b authored by Matteo Bruni's avatar Matteo Bruni Committed by Alexandre Julliard

wined3d: Introduce a get_identity_matrix() function.

parent 1e66b33d
......@@ -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 */
......
......@@ -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,
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment