diff --git a/src/mesa/drivers/dri/i915/intel_context.c b/src/mesa/drivers/dri/i915/intel_context.c index 09c2ee1e5ae..cacc4e9cbc8 100644 --- a/src/mesa/drivers/dri/i915/intel_context.c +++ b/src/mesa/drivers/dri/i915/intel_context.c @@ -600,8 +600,6 @@ intelDestroyContext(__DRIcontext * driContextPriv) /* free the Mesa context */ _mesa_free_context_data(&intel->ctx, true); - _math_matrix_dtr(&intel->ViewportMatrix); - ralloc_free(intel); driContextPriv->driverPrivate = NULL; } diff --git a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c index 247cad4a38b..98e3c2943c0 100644 --- a/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv10_state_tnl.c @@ -490,6 +490,4 @@ nv10_emit_projection(struct gl_context *ctx, int emit) BEGIN_NV04(push, NV10_3D(PROJECTION_MATRIX(0)), 16); PUSH_DATAm(push, m.m); - - _math_matrix_dtr(&m); } diff --git a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c index 607a5c0314a..58066683937 100644 --- a/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c +++ b/src/mesa/drivers/dri/nouveau/nv20_state_tnl.c @@ -378,6 +378,4 @@ nv20_emit_projection(struct gl_context *ctx, int emit) BEGIN_NV04(push, NV20_3D(PROJECTION_MATRIX(0)), 16); PUSH_DATAm(push, m.m); - - _math_matrix_dtr(&m); } diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 49aaaa2bea6..efcf9863848 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -408,13 +408,5 @@ GLboolean r200CreateContext( gl_api api, void r200DestroyContext( __DRIcontext *driContextPriv ) { - int i; - r200ContextPtr rmesa = (r200ContextPtr)driContextPriv->driverPrivate; - if (rmesa) - { - for ( i = 0 ; i < R200_MAX_TEXTURE_UNITS ; i++ ) { - _math_matrix_dtr( &rmesa->TexGenMatrix[i] ); - } - } radeonDestroyContext(driContextPriv); } diff --git a/src/mesa/main/matrix.c b/src/mesa/main/matrix.c index f325af3c6fc..e2c2a204271 100644 --- a/src/mesa/main/matrix.c +++ b/src/mesa/main/matrix.c @@ -1012,17 +1012,10 @@ init_matrix_stack(struct gl_matrix_stack *stack, * Free matrix stack. * * \param stack matrix stack. - * - * Calls _math_matrix_dtr() for each element of the matrix stack and - * frees the array. */ static void free_matrix_stack( struct gl_matrix_stack *stack ) { - GLuint i; - for (i = 0; i < stack->StackSize; i++) { - _math_matrix_dtr(&stack->Stack[i]); - } free(stack->Stack); stack->Stack = stack->Top = NULL; stack->StackSize = 0; @@ -1071,8 +1064,7 @@ void _mesa_init_matrix( struct gl_context * ctx ) * * \param ctx GL context. * - * Frees each of the matrix stacks and the combined modelview-projection - * matrix. + * Frees each of the matrix stacks. */ void _mesa_free_matrix_data( struct gl_context *ctx ) { @@ -1084,8 +1076,6 @@ void _mesa_free_matrix_data( struct gl_context *ctx ) free_matrix_stack(&ctx->TextureMatrixStack[i]); for (i = 0; i < ARRAY_SIZE(ctx->ProgramMatrixStack); i++) free_matrix_stack(&ctx->ProgramMatrixStack[i]); - /* combined Modelview*Projection matrix */ - _math_matrix_dtr( &ctx->_ModelProjectMatrix ); } diff --git a/src/mesa/math/m_matrix.c b/src/mesa/math/m_matrix.c index 0202c6fa1f2..ba761ec714d 100644 --- a/src/mesa/math/m_matrix.c +++ b/src/mesa/math/m_matrix.c @@ -1499,33 +1499,12 @@ _math_matrix_loadf( GLmatrix *mat, const GLfloat *m ) void _math_matrix_ctr( GLmatrix *m ) { - m->m = align_malloc( 16 * sizeof(GLfloat), 16 ); - if (m->m) - memcpy( m->m, Identity, sizeof(Identity) ); - m->inv = align_malloc( 16 * sizeof(GLfloat), 16 ); - if (m->inv) - memcpy( m->inv, Identity, sizeof(Identity) ); + memcpy( m->m, Identity, sizeof(Identity) ); + memcpy( m->inv, Identity, sizeof(Identity) ); m->type = MATRIX_IDENTITY; m->flags = 0; } -/** - * Matrix destructor. - * - * \param m matrix. - * - * Frees the data in a GLmatrix. - */ -void -_math_matrix_dtr( GLmatrix *m ) -{ - align_free( m->m ); - m->m = NULL; - - align_free( m->inv ); - m->inv = NULL; -} - /*@}*/ diff --git a/src/mesa/math/m_matrix.h b/src/mesa/math/m_matrix.h index 6de9e1a84cd..63549b5cff6 100644 --- a/src/mesa/math/m_matrix.h +++ b/src/mesa/math/m_matrix.h @@ -73,8 +73,8 @@ enum GLmatrixtype { * Matrix type to represent 4x4 transformation matrices. */ typedef struct { - GLfloat *m; /**< 16 matrix elements (16-byte aligned) */ - GLfloat *inv; /**< 16-element inverse (16-byte aligned) */ + ALIGN16 GLfloat m[16]; /**< 16 matrix elements (16-byte aligned) */ + ALIGN16 GLfloat inv[16]; /**< 16-element inverse (16-byte aligned) */ GLuint flags; /**< possible values determined by (of \link * MatFlags MAT_FLAG_* flags\endlink) */ @@ -87,9 +87,6 @@ typedef struct { extern void _math_matrix_ctr( GLmatrix *m ); -extern void -_math_matrix_dtr( GLmatrix *m ); - extern void _math_matrix_mul_matrix( GLmatrix *dest, const GLmatrix *a, const GLmatrix *b ); diff --git a/src/mesa/math/m_vector_asm.h b/src/mesa/math/m_vector_asm.h index 60cf1ec8fd1..90de44b0a50 100644 --- a/src/mesa/math/m_vector_asm.h +++ b/src/mesa/math/m_vector_asm.h @@ -52,6 +52,6 @@ * _math_matrix_set_identity(). */ #define MATRIX_M 0 -#define MATRIX_INV (MATRIX_M + MATH_ASM_PTR_SIZE) +#define MATRIX_INV (MATRIX_M + 16 * 4) #endif /* _M_VECTOR_ASM_H */ diff --git a/src/mesa/tnl/t_context.c b/src/mesa/tnl/t_context.c index 1b787180e36..cd79e968ef1 100644 --- a/src/mesa/tnl/t_context.c +++ b/src/mesa/tnl/t_context.c @@ -113,8 +113,6 @@ _tnl_DestroyContext( struct gl_context *ctx ) struct tnl_shine_tab *s, *tmps; TNLcontext *tnl = TNL_CONTEXT(ctx); - _math_matrix_dtr(&tnl->_WindowMap); - /* Free lighting shininess exponentiation table */ foreach_s( s, tmps, tnl->_ShineTabList ) { free( s );