projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
24507ff
)
added aligned memory allocations (Gareth Hughes)
author
Brian Paul
<brian.paul@tungstengraphics.com>
Tue, 27 Jun 2000 22:10:00 +0000
(22:10 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Tue, 27 Jun 2000 22:10:00 +0000
(22:10 +0000)
src/mesa/main/context.c
patch
|
blob
|
history
src/mesa/main/matrix.c
patch
|
blob
|
history
src/mesa/main/matrix.h
patch
|
blob
|
history
src/mesa/x86/3dnow.c
patch
|
blob
|
history
src/mesa/x86/x86.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/context.c
b/src/mesa/main/context.c
index 7ed7f12425fed1353c85068a29bea4c2f01f1b97..eb9ed313bfdc99d6bd8580b0ad3b89fa40522576 100644
(file)
--- a/
src/mesa/main/context.c
+++ b/
src/mesa/main/context.c
@@
-1,4
+1,4
@@
-/* $Id: context.c,v 1.7
2 2000/06/27 21:42:13
brianp Exp $ */
+/* $Id: context.c,v 1.7
3 2000/06/27 22:10:00
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-1391,7
+1391,7
@@
_mesa_initialize_context( GLcontext *ctx,
ctx->PB = gl_alloc_pb();
if (!ctx->PB) {
ctx->PB = gl_alloc_pb();
if (!ctx->PB) {
- FREE( ctx->VB );
+
ALIGN_
FREE( ctx->VB );
FREE( ctx );
return GL_FALSE;
}
FREE( ctx );
return GL_FALSE;
}
@@
-1404,9
+1404,9
@@
_mesa_initialize_context( GLcontext *ctx,
/* allocate new group of display lists */
ctx->Shared = alloc_shared_state();
if (!ctx->Shared) {
/* allocate new group of display lists */
ctx->Shared = alloc_shared_state();
if (!ctx->Shared) {
-
FREE(ctx->VB
);
- FREE(
ctx->PB
);
- FREE(
ctx
);
+
ALIGN_FREE( ctx->VB
);
+ FREE(
ctx->PB
);
+ FREE(
ctx
);
return GL_FALSE;
}
}
return GL_FALSE;
}
}
@@
-1436,9
+1436,9
@@
_mesa_initialize_context( GLcontext *ctx,
if (!alloc_proxy_textures(ctx)) {
free_shared_state(ctx, ctx->Shared);
if (!alloc_proxy_textures(ctx)) {
free_shared_state(ctx, ctx->Shared);
-
FREE(ctx->VB
);
- FREE(
ctx->PB
);
- FREE(
ctx
);
+
ALIGN_FREE( ctx->VB
);
+ FREE(
ctx->PB
);
+ FREE(
ctx
);
return GL_FALSE;
}
return GL_FALSE;
}
@@
-1465,11
+1465,11
@@
_mesa_initialize_context( GLcontext *ctx,
ctx->Save = (struct _glapi_table *) CALLOC(dispatchSize * sizeof(void*));
if (!ctx->Exec || !ctx->Save) {
free_shared_state(ctx, ctx->Shared);
ctx->Save = (struct _glapi_table *) CALLOC(dispatchSize * sizeof(void*));
if (!ctx->Exec || !ctx->Save) {
free_shared_state(ctx, ctx->Shared);
-
FREE(ctx->VB
);
- FREE(
ctx->PB
);
+
ALIGN_FREE( ctx->VB
);
+ FREE(
ctx->PB
);
if (ctx->Exec)
if (ctx->Exec)
- FREE(
ctx->Exec
);
- FREE(
ctx
);
+ FREE(
ctx->Exec
);
+ FREE(
ctx
);
}
_mesa_init_exec_table(ctx->Exec, dispatchSize);
_mesa_init_dlist_table(ctx->Save, dispatchSize);
}
_mesa_init_exec_table(ctx->Exec, dispatchSize);
_mesa_init_dlist_table(ctx->Save, dispatchSize);
@@
-1612,7
+1612,7
@@
gl_free_context_data( GLcontext *ctx )
/* Free cache of immediate buffers. */
while (ctx->nr_im_queued-- > 0) {
struct immediate * next = ctx->freed_im_queue->next;
/* Free cache of immediate buffers. */
while (ctx->nr_im_queued-- > 0) {
struct immediate * next = ctx->freed_im_queue->next;
- FREE( ctx->freed_im_queue );
+
ALIGN_
FREE( ctx->freed_im_queue );
ctx->freed_im_queue = next;
}
gl_extensions_dtr(ctx);
ctx->freed_im_queue = next;
}
gl_extensions_dtr(ctx);
diff --git
a/src/mesa/main/matrix.c
b/src/mesa/main/matrix.c
index 5eb5bb43f0c5daead20be807c423778bf10c4253..5db2542a6e8df644560894dd99181014f70ace77 100644
(file)
--- a/
src/mesa/main/matrix.c
+++ b/
src/mesa/main/matrix.c
@@
-1,4
+1,4
@@
-/* $Id: matrix.c,v 1.1
7 2000/04/08 18:57:45
brianp Exp $ */
+/* $Id: matrix.c,v 1.1
8 2000/06/27 22:10:00
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-1562,16
+1562,23
@@
void gl_calculate_model_project_matrix( GLcontext *ctx )
void gl_matrix_ctr( GLmatrix *m )
{
void gl_matrix_ctr( GLmatrix *m )
{
+ if ( m->m == 0 ) {
+ m->m = (GLfloat *) ALIGN_MALLOC( 16 * sizeof(GLfloat), 16 );
+ }
+ MEMCPY( m->m, Identity, sizeof(Identity) );
m->inv = 0;
m->inv = 0;
- MEMCPY( m->m, Identity, sizeof(Identity));
m->type = MATRIX_IDENTITY;
m->flags = MAT_DIRTY_DEPENDENTS;
}
void gl_matrix_dtr( GLmatrix *m )
{
m->type = MATRIX_IDENTITY;
m->flags = MAT_DIRTY_DEPENDENTS;
}
void gl_matrix_dtr( GLmatrix *m )
{
- if (m->inv != 0) {
- FREE(m->inv);
+ if ( m->m != 0 ) {
+ ALIGN_FREE( m->m );
+ m->m = 0;
+ }
+ if ( m->inv != 0 ) {
+ ALIGN_FREE( m->inv );
m->inv = 0;
}
}
m->inv = 0;
}
}
@@
-1579,7
+1586,7
@@
void gl_matrix_dtr( GLmatrix *m )
#if 0
void gl_matrix_set_identity( GLmatrix *m )
{
#if 0
void gl_matrix_set_identity( GLmatrix *m )
{
- MEMCPY( m->m, Identity, sizeof(Identity));
+ MEMCPY( m->m, Identity, sizeof(Identity)
);
m->type = MATRIX_IDENTITY;
m->flags = MAT_DIRTY_DEPENDENTS;
}
m->type = MATRIX_IDENTITY;
m->flags = MAT_DIRTY_DEPENDENTS;
}
@@
-1587,15
+1594,15
@@
void gl_matrix_set_identity( GLmatrix *m )
void gl_matrix_alloc_inv( GLmatrix *m )
{
void gl_matrix_alloc_inv( GLmatrix *m )
{
- if (
m->inv == 0
) {
- m->inv = (GLfloat *)
MALLOC(16*sizeof(GLfloat)
);
+ if (
m->inv == 0
) {
+ m->inv = (GLfloat *)
ALIGN_MALLOC( 16 * sizeof(GLfloat), 16
);
MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) );
}
}
void gl_matrix_copy( GLmatrix *to, const GLmatrix *from )
{
MEMCPY( m->inv, Identity, 16 * sizeof(GLfloat) );
}
}
void gl_matrix_copy( GLmatrix *to, const GLmatrix *from )
{
- MEMCPY( to->m, from->m, sizeof(Identity));
+ MEMCPY( to->m, from->m, sizeof(Identity)
);
to->flags = from->flags | MAT_DIRTY_DEPENDENTS;
to->type = from->type;
to->flags = from->flags | MAT_DIRTY_DEPENDENTS;
to->type = from->type;
diff --git
a/src/mesa/main/matrix.h
b/src/mesa/main/matrix.h
index d0fcdabb6277283dd807a2d3a215e47be94a3bb9..b142afb4613c699c2243466258765322aadbc671 100644
(file)
--- a/
src/mesa/main/matrix.h
+++ b/
src/mesa/main/matrix.h
@@
-1,4
+1,4
@@
-/* $Id: matrix.h,v 1.
5 1999/12/10 20:01:06
brianp Exp $ */
+/* $Id: matrix.h,v 1.
6 2000/06/27 22:10:00
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-34,8
+34,8
@@
typedef struct {
typedef struct {
- GLfloat
m[16];
- GLfloat *inv; /* optional */
+ GLfloat
*m; /* 16-byte aligned */
+ GLfloat *inv; /* optional
, 16-byte aligned
*/
GLuint flags;
GLuint type;
} GLmatrix;
GLuint flags;
GLuint type;
} GLmatrix;
diff --git
a/src/mesa/x86/3dnow.c
b/src/mesa/x86/3dnow.c
index f61e369edc2ff7ab693ee0f5e3fe61678a4ae351..dd085b6cbe0aaabef5affaeb84f99b389f2c2ef3 100644
(file)
--- a/
src/mesa/x86/3dnow.c
+++ b/
src/mesa/x86/3dnow.c
@@
-1,4
+1,4
@@
-/* $Id: 3dnow.c,v 1.
4 2000/06/14 21:55:1
1 brianp Exp $ */
+/* $Id: 3dnow.c,v 1.
5 2000/06/27 22:10:0
1 brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-50,7
+50,7
@@
#define XFORM_ARGS GLvector4f *to_vec, \
#define XFORM_ARGS GLvector4f *to_vec, \
- const GL
matrix *mat
, \
+ const GL
float m[16]
, \
const GLvector4f *from_vec, \
const GLubyte *mask, \
const GLubyte flag
const GLvector4f *from_vec, \
const GLubyte *mask, \
const GLubyte flag
diff --git
a/src/mesa/x86/x86.c
b/src/mesa/x86/x86.c
index d6c4f31084cd960231d312d0216662d6df89b147..2db200df05b33b262b648c2fe3ad97ffb9920bd8 100644
(file)
--- a/
src/mesa/x86/x86.c
+++ b/
src/mesa/x86/x86.c
@@
-1,4
+1,4
@@
-/* $Id: x86.c,v 1.
7 2000/05/26 16:17:00
brianp Exp $ */
+/* $Id: x86.c,v 1.
8 2000/06/27 22:10:01
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-37,23
+37,23
@@
#include "x86.h"
#ifdef USE_X86_ASM
#include "x86.h"
#ifdef USE_X86_ASM
-extern void _ASMAPI gl_v16_x86_cliptest_points4(GLfloat *first_vert,
+extern void _ASMAPI gl_v16_x86_cliptest_points4(
GLfloat *first_vert,
GLfloat *last_vert,
GLubyte *or_mask,
GLubyte *and_mask,
GLubyte *clip_mask );
GLfloat *last_vert,
GLubyte *or_mask,
GLubyte *and_mask,
GLubyte *clip_mask );
-extern void _ASMAPI gl_v16_x86_general_xform(GLfloat *dest,
+extern void _ASMAPI gl_v16_x86_general_xform(
GLfloat *dest,
const GLfloat *m,
const GLfloat *src,
GLuint src_stride,
const GLfloat *m,
const GLfloat *src,
GLuint src_stride,
-
GLuint count
);
+
GLuint count
);
#endif
#define XFORM_ARGS GLvector4f *to_vec, \
#endif
#define XFORM_ARGS GLvector4f *to_vec, \
- const GL
matrix *mat
, \
+ const GL
float m[16]
, \
const GLvector4f *from_vec, \
const GLubyte *mask, \
const GLubyte flag
const GLvector4f *from_vec, \
const GLubyte *mask, \
const GLubyte flag
@@
-118,7
+118,6
@@
void gl_init_x86_asm_transforms( void )
gl_test_all_transform_functions("x86");
#endif
gl_test_all_transform_functions("x86");
#endif
-
gl_cliptest_points4_v16 = gl_v16_x86_cliptest_points4;
gl_xform_points3_v16_general = gl_v16_x86_general_xform;
#endif
gl_cliptest_points4_v16 = gl_v16_x86_cliptest_points4;
gl_xform_points3_v16_general = gl_v16_x86_general_xform;
#endif