-/* $Id: texformat.c,v 1.6 2001/03/28 20:40:51 gareth Exp $ */
+/* $Id: texformat.c,v 1.7 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
}
-/* ================================================================
+/* =============================================================
* Default GLchan-based formats:
*/
};
-/* ================================================================
+/* =============================================================
* Hardware formats:
*/
};
-/* ================================================================
+/* =============================================================
* Null format:
*/
-/* $Id: texutil.c,v 1.21 2001/03/28 20:40:51 gareth Exp $ */
+/* $Id: texutil.c,v 1.22 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
-/* ================================================================
+/* =============================================================
* RGBA8888 textures:
*/
-/* ================================================================
+/* =============================================================
* ARGB8888 textures:
*/
-/* ================================================================
+/* =============================================================
* RGB888 textures:
*/
-/* ================================================================
+/* =============================================================
* RGB565 textures:
*/
-/* ================================================================
+/* =============================================================
* ARGB4444 textures:
*/
-/* ================================================================
+/* =============================================================
* ARGB1555 textures:
*/
-/* ================================================================
+/* =============================================================
* AL88 textures:
*/
-/* ================================================================
+/* =============================================================
* RGB332 textures:
*/
-/* ================================================================
+/* =============================================================
* CI8 (and all other single-byte texel) textures:
*/
-/* ================================================================
+/* =============================================================
* Global entry points
*/
-/* $Id: texutil_tmp.h,v 1.6 2001/03/27 20:32:24 brianp Exp $ */
+/* $Id: texutil_tmp.h,v 1.7 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
convert->dstImageHeight * DST_TEXEL_BYTES)
-/* ================================================================
+/* =============================================================
* PRE: No pixelstore attribs, width == dstImageWidth.
*/
static GLboolean
-/* ================================================================
+/* =============================================================
* PRE: No pixelstore attribs, width != dstImageWidth.
*/
static GLboolean
-/* ================================================================
+/* =============================================================
* PRE: Require pixelstore attribs, width == dstImageWidth.
*/
static GLboolean
-/* ================================================================
+/* =============================================================
* PRE: Require pixelstore attribs, width != dstImageWidth.
*/
static GLboolean
-/* $Id: m_copy_tmp.h,v 1.5 2001/03/12 02:02:36 gareth Exp $ */
+/* $Id: m_copy_tmp.h,v 1.6 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
#define COPY_FUNC( BITS ) \
-static void TAG2(copy, BITS)( GLvector4f *to, const GLvector4f *f, \
- const GLubyte mask[] ) \
+static void TAG2(copy, BITS)( GLvector4f *to, const GLvector4f *f ) \
{ \
GLfloat (*t)[4] = (GLfloat (*)[4])to->start; \
GLfloat *from = f->start; \
GLuint stride = f->stride; \
GLuint count = f->count; \
GLuint i; \
- (void) mask; \
\
if (BITS) \
STRIDE_LOOP { \
- CULL_CHECK { \
- if (BITS&1) t[i][0] = from[0]; \
- if (BITS&2) t[i][1] = from[1]; \
- if (BITS&4) t[i][2] = from[2]; \
- if (BITS&8) t[i][3] = from[3]; \
- } \
+ if (BITS&1) t[i][0] = from[0]; \
+ if (BITS&2) t[i][1] = from[1]; \
+ if (BITS&4) t[i][2] = from[2]; \
+ if (BITS&8) t[i][3] = from[3]; \
} \
}
COPY_FUNC( 0xe )
COPY_FUNC( 0xf )
-static void TAG2(init_copy, 0 ) ( void )
+static void TAG2(init_copy, 0)( void )
{
- _mesa_copy_tab[IDX][0x0] = TAG2(copy, 0x0);
- _mesa_copy_tab[IDX][0x1] = TAG2(copy, 0x1);
- _mesa_copy_tab[IDX][0x2] = TAG2(copy, 0x2);
- _mesa_copy_tab[IDX][0x3] = TAG2(copy, 0x3);
- _mesa_copy_tab[IDX][0x4] = TAG2(copy, 0x4);
- _mesa_copy_tab[IDX][0x5] = TAG2(copy, 0x5);
- _mesa_copy_tab[IDX][0x6] = TAG2(copy, 0x6);
- _mesa_copy_tab[IDX][0x7] = TAG2(copy, 0x7);
- _mesa_copy_tab[IDX][0x8] = TAG2(copy, 0x8);
- _mesa_copy_tab[IDX][0x9] = TAG2(copy, 0x9);
- _mesa_copy_tab[IDX][0xa] = TAG2(copy, 0xa);
- _mesa_copy_tab[IDX][0xb] = TAG2(copy, 0xb);
- _mesa_copy_tab[IDX][0xc] = TAG2(copy, 0xc);
- _mesa_copy_tab[IDX][0xd] = TAG2(copy, 0xd);
- _mesa_copy_tab[IDX][0xe] = TAG2(copy, 0xe);
- _mesa_copy_tab[IDX][0xf] = TAG2(copy, 0xf);
+ _mesa_copy_tab[0x0] = TAG2(copy, 0x0);
+ _mesa_copy_tab[0x1] = TAG2(copy, 0x1);
+ _mesa_copy_tab[0x2] = TAG2(copy, 0x2);
+ _mesa_copy_tab[0x3] = TAG2(copy, 0x3);
+ _mesa_copy_tab[0x4] = TAG2(copy, 0x4);
+ _mesa_copy_tab[0x5] = TAG2(copy, 0x5);
+ _mesa_copy_tab[0x6] = TAG2(copy, 0x6);
+ _mesa_copy_tab[0x7] = TAG2(copy, 0x7);
+ _mesa_copy_tab[0x8] = TAG2(copy, 0x8);
+ _mesa_copy_tab[0x9] = TAG2(copy, 0x9);
+ _mesa_copy_tab[0xa] = TAG2(copy, 0xa);
+ _mesa_copy_tab[0xb] = TAG2(copy, 0xb);
+ _mesa_copy_tab[0xc] = TAG2(copy, 0xc);
+ _mesa_copy_tab[0xd] = TAG2(copy, 0xd);
+ _mesa_copy_tab[0xe] = TAG2(copy, 0xe);
+ _mesa_copy_tab[0xf] = TAG2(copy, 0xf);
}
-/* $Id: m_debug_norm.c,v 1.6 2001/03/29 06:46:27 gareth Exp $ */
+/* $Id: m_debug_norm.c,v 1.7 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
};
-/* ================================================================
+/* =============================================================
* Reference transformations
*/
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
const GLfloat *m = mat->inv;
GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
- (void) mask;
(void) lengths;
for ( i = 0 ; i < in->count ; i++ ) {
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
const GLfloat *m = mat->inv;
GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
- (void) mask;
-
for ( i = 0 ; i < in->count ; i++ ) {
GLfloat t[3];
}
-/* ================================================================
+/* =============================================================
* Normal transformation tests
*/
ref2->flags = 0;
if ( norm_normalize_types[mtype] == 0 ) {
- ref_norm_transform_rescale( mat, scale, source, NULL, NULL, ref );
+ ref_norm_transform_rescale( mat, scale, source, NULL, ref );
} else {
- ref_norm_transform_normalize( mat, scale, source, NULL, NULL, ref );
- ref_norm_transform_normalize( mat, scale, source, length, NULL, ref2 );
+ ref_norm_transform_normalize( mat, scale, source, NULL, ref );
+ ref_norm_transform_normalize( mat, scale, source, length, ref2 );
}
if ( mesa_profile ) {
BEGIN_RACE( *cycles );
- func( mat, scale, source, NULL, NULL, dest );
+ func( mat, scale, source, NULL, dest );
END_RACE( *cycles );
- func( mat, scale, source, length, NULL, dest2 );
+ func( mat, scale, source, length, dest2 );
} else {
- func( mat, scale, source, NULL, NULL, dest );
- func( mat, scale, source, length, NULL, dest2 );
+ func( mat, scale, source, NULL, dest );
+ func( mat, scale, source, length, dest2 );
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
void _math_test_all_normal_transform_functions( char *description )
{
int mtype;
- long benchmark_tab[0xf][0x4];
+ long benchmark_tab[0xf];
static int first_time = 1;
if ( first_time ) {
#endif
for ( mtype = 0 ; mtype < 8 ; mtype++ ) {
- normal_func func = _mesa_normal_tab[norm_types[mtype]][0];
- long *cycles = &(benchmark_tab[mtype][0]);
+ normal_func func = _mesa_normal_tab[norm_types[mtype]];
+ long *cycles = &benchmark_tab[mtype];
if ( test_norm_function( func, mtype, cycles ) == 0 ) {
char buf[100];
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile ) {
- printf( " %li\t", benchmark_tab[mtype][0] );
+ printf( " %li\t", benchmark_tab[mtype] );
printf( " | [%s]\n", norm_strings[mtype] );
}
#endif
-/* $Id: m_debug_util.h,v 1.2 2001/03/12 00:48:41 gareth Exp $ */
+/* $Id: m_debug_util.h,v 1.3 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
#endif
-/* ================================================================
+/* =============================================================
* Helper functions
*/
-/* $Id: m_debug_xform.c,v 1.7 2001/03/29 06:46:27 gareth Exp $ */
+/* $Id: m_debug_xform.c,v 1.8 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
};
-/* ================================================================
+/* =============================================================
* Reference transformations
*/
static void ref_transform( GLvector4f *dst,
const GLmatrix *mat,
- const GLvector4f *src,
- const GLubyte *clipmask,
- const GLubyte flag )
+ const GLvector4f *src )
{
GLuint i;
GLfloat *s = (GLfloat *)src->start;
GLfloat (*d)[4] = (GLfloat (*)[4])dst->start;
const GLfloat *m = mat->m;
- (void) clipmask;
- (void) flag;
-
for ( i = 0 ; i < src->count ; i++ ) {
TRANSFORM_POINT( d[i], m, s );
s = (GLfloat *)((char *)s + src->stride);
}
-/* ================================================================
+/* =============================================================
* Vertex transformation tests
*/
GLvector4f source[1], dest[1], ref[1];
GLmatrix mat[1];
GLfloat *m;
- GLubyte mask[TEST_COUNT];
int i, j;
#ifdef RUN_DEBUG_BENCHMARK
int cycle_i; /* the counter for the benchmarks we run */
}
for ( i = 0 ; i < TEST_COUNT ; i++) {
- mask[i] = i % 2; /* mask every 2nd element */
ASSIGN_4V( d[i], 0.0, 0.0, 0.0, 1.0 );
ASSIGN_4V( s[i], 0.0, 0.0, 0.0, 1.0 );
for ( j = 0 ; j < psize ; j++ )
ref->size = 0;
ref->flags = 0;
- ref_transform( ref, mat, source, NULL, 0 );
+ ref_transform( ref, mat, source );
if ( mesa_profile ) {
BEGIN_RACE( *cycles );
- func( dest, mat->m, source, NULL, 0 );
+ func( dest, mat->m, source );
END_RACE( *cycles );
}
else {
- func( dest, mat->m, source, NULL, 0 );
+ func( dest, mat->m, source );
}
for ( i = 0 ; i < TEST_COUNT ; i++ ) {
void _math_test_all_transform_functions( char *description )
{
int psize, mtype;
- long benchmark_tab[2][4][7];
+ long benchmark_tab[4][7];
static int first_time = 1;
if ( first_time ) {
for ( mtype = 0 ; mtype < 7 ; mtype++ ) {
for ( psize = 1 ; psize <= 4 ; psize++ ) {
- transform_func func = _mesa_transform_tab[0][psize][mtypes[mtype]];
- long *cycles = &(benchmark_tab[0][psize-1][mtype]);
+ transform_func func = _mesa_transform_tab[psize][mtypes[mtype]];
+ long *cycles = &(benchmark_tab[psize-1][mtype]);
if ( test_transform_function( func, psize, mtype, cycles ) == 0 ) {
char buf[100];
}
#ifdef RUN_DEBUG_BENCHMARK
if ( mesa_profile )
- printf( " %li\t", benchmark_tab[0][psize-1][mtype] );
+ printf( " %li\t", benchmark_tab[psize-1][mtype] );
#endif
}
#ifdef RUN_DEBUG_BENCHMARK
-/* $Id: m_dotprod_tmp.h,v 1.5 2001/03/12 02:02:36 gareth Exp $ */
+/* $Id: m_dotprod_tmp.h,v 1.6 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
static void TAG(dotprod_vec2)( GLfloat *out,
GLuint outstride,
const GLvector4f *coord_vec,
- const GLfloat plane[4],
- const GLubyte mask[] )
+ const GLfloat plane[4] )
{
GLuint stride = coord_vec->stride;
GLfloat *coord = coord_vec->start;
const GLfloat plane0 = plane[0], plane1 = plane[1], plane3 = plane[3];
- (void) mask;
-
for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(out,outstride)) {
- CULL_CHECK {
- *out = (coord[0] * plane0 +
- coord[1] * plane1 +
- plane3);
- }
+ *out = (coord[0] * plane0 +
+ coord[1] * plane1 +
+ plane3);
}
}
static void TAG(dotprod_vec3)( GLfloat *out,
GLuint outstride,
const GLvector4f *coord_vec,
- const GLfloat plane[4],
- const GLubyte mask[] )
+ const GLfloat plane[4] )
{
GLuint stride = coord_vec->stride;
GLfloat *coord = coord_vec->start;
const GLfloat plane0 = plane[0], plane1 = plane[1], plane2 = plane[2];
const GLfloat plane3 = plane[3];
- (void) mask;
-
for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(out,outstride)) {
- CULL_CHECK {
- *out = (coord[0] * plane0 +
- coord[1] * plane1 +
- coord[2] * plane2 +
- plane3);
- }
+ *out = (coord[0] * plane0 +
+ coord[1] * plane1 +
+ coord[2] * plane2 +
+ plane3);
}
}
static void TAG(dotprod_vec4)( GLfloat *out,
GLuint outstride,
const GLvector4f *coord_vec,
- const GLfloat plane[4],
- const GLubyte mask[] )
+ const GLfloat plane[4] )
{
GLuint stride = coord_vec->stride;
GLfloat *coord = coord_vec->start;
const GLfloat plane0 = plane[0], plane1 = plane[1], plane2 = plane[2];
const GLfloat plane3 = plane[3];
- (void) mask;
-
for (i=0;i<count;i++,STRIDE_F(coord,stride),STRIDE_F(out,outstride)) {
- CULL_CHECK {
- *out = (coord[0] * plane0 +
- coord[1] * plane1 +
- coord[2] * plane2 +
- coord[3] * plane3);
- }
+ *out = (coord[0] * plane0 +
+ coord[1] * plane1 +
+ coord[2] * plane2 +
+ coord[3] * plane3);
}
}
static void TAG(init_dotprod)( void )
{
- _mesa_dotprod_tab[IDX&1][2] = TAG(dotprod_vec2);
- _mesa_dotprod_tab[IDX&1][3] = TAG(dotprod_vec3);
- _mesa_dotprod_tab[IDX&1][4] = TAG(dotprod_vec4);
+ _mesa_dotprod_tab[2] = TAG(dotprod_vec2);
+ _mesa_dotprod_tab[3] = TAG(dotprod_vec3);
+ _mesa_dotprod_tab[4] = TAG(dotprod_vec4);
}
-/* $Id: m_norm_tmp.h,v 1.6 2001/03/12 02:02:36 gareth Exp $ */
+/* $Id: m_norm_tmp.h,v 1.7 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat m1 = m[1], m5 = m[5], m9 = m[9];
GLfloat m2 = m[2], m6 = m[6], m10 = m[10];
- (void) mask;
if (!lengths) {
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat tx, ty, tz;
- {
- const GLfloat ux = from[0], uy = from[1], uz = from[2];
- tx = ux * m0 + uy * m1 + uz * m2;
- ty = ux * m4 + uy * m5 + uz * m6;
- tz = ux * m8 + uy * m9 + uz * m10;
+ GLfloat tx, ty, tz;
+ {
+ const GLfloat ux = from[0], uy = from[1], uz = from[2];
+ tx = ux * m0 + uy * m1 + uz * m2;
+ ty = ux * m4 + uy * m5 + uz * m6;
+ tz = ux * m8 + uy * m9 + uz * m10;
+ }
+ {
+ GLdouble len = tx*tx + ty*ty + tz*tz;
+ if (len > 1e-20) {
+ GLdouble scale = 1.0 / GL_SQRT(len);
+ out[i][0] = (GLfloat) (tx * scale);
+ out[i][1] = (GLfloat) (ty * scale);
+ out[i][2] = (GLfloat) (tz * scale);
}
+ else
{
- GLdouble len = tx*tx + ty*ty + tz*tz;
- if (len > 1e-20) {
- GLdouble scale = 1.0 / GL_SQRT(len);
- out[i][0] = (GLfloat) (tx * scale);
- out[i][1] = (GLfloat) (ty * scale);
- out[i][2] = (GLfloat) (tz * scale);
- }
- else
- {
- out[i][0] = out[i][1] = out[i][2] = 0;
- }
+ out[i][0] = out[i][1] = out[i][2] = 0;
}
}
}
}
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat tx, ty, tz;
- {
- const GLfloat ux = from[0], uy = from[1], uz = from[2];
- tx = ux * m0 + uy * m1 + uz * m2;
- ty = ux * m4 + uy * m5 + uz * m6;
- tz = ux * m8 + uy * m9 + uz * m10;
- }
- {
- GLfloat len = lengths[i];
- out[i][0] = tx * len;
- out[i][1] = ty * len;
- out[i][2] = tz * len;
- }
+ GLfloat tx, ty, tz;
+ {
+ const GLfloat ux = from[0], uy = from[1], uz = from[2];
+ tx = ux * m0 + uy * m1 + uz * m2;
+ ty = ux * m4 + uy * m5 + uz * m6;
+ tz = ux * m8 + uy * m9 + uz * m10;
+ }
+ {
+ GLfloat len = lengths[i];
+ out[i][0] = tx * len;
+ out[i][1] = ty * len;
+ out[i][2] = tz * len;
}
}
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat m0 = m[0];
GLfloat m5 = m[5];
GLfloat m10 = m[10];
- (void) mask;
if (!lengths) {
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat tx, ty, tz;
- {
- const GLfloat ux = from[0], uy = from[1], uz = from[2];
- tx = ux * m0 ;
- ty = uy * m5 ;
- tz = uz * m10;
+ GLfloat tx, ty, tz;
+ {
+ const GLfloat ux = from[0], uy = from[1], uz = from[2];
+ tx = ux * m0 ;
+ ty = uy * m5 ;
+ tz = uz * m10;
+ }
+ {
+ GLdouble len = tx*tx + ty*ty + tz*tz;
+ if (len > 1e-20) {
+ GLdouble scale = 1.0 / GL_SQRT(len);
+ out[i][0] = (GLfloat) (tx * scale);
+ out[i][1] = (GLfloat) (ty * scale);
+ out[i][2] = (GLfloat) (tz * scale);
}
+ else
{
- GLdouble len = tx*tx + ty*ty + tz*tz;
- if (len > 1e-20) {
- GLdouble scale = 1.0 / GL_SQRT(len);
- out[i][0] = (GLfloat) (tx * scale);
- out[i][1] = (GLfloat) (ty * scale);
- out[i][2] = (GLfloat) (tz * scale);
- }
- else
- {
- out[i][0] = out[i][1] = out[i][2] = 0;
- }
+ out[i][0] = out[i][1] = out[i][2] = 0;
}
}
}
}
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat tx, ty, tz;
- {
- const GLfloat ux = from[0], uy = from[1], uz = from[2];
- tx = ux * m0 ;
- ty = uy * m5 ;
- tz = uz * m10;
- }
- {
- GLfloat len = lengths[i];
- out[i][0] = tx * len;
- out[i][1] = ty * len;
- out[i][2] = tz * len;
- }
+ GLfloat tx, ty, tz;
+ {
+ const GLfloat ux = from[0], uy = from[1], uz = from[2];
+ tx = ux * m0 ;
+ ty = uy * m5 ;
+ tz = uz * m10;
+ }
+ {
+ GLfloat len = lengths[i];
+ out[i][0] = tx * len;
+ out[i][1] = ty * len;
+ out[i][2] = tz * len;
}
}
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat m5 = scale*m[5];
GLfloat m10 = scale*m[10];
(void) lengths;
- (void) mask;
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat ux = from[0], uy = from[1], uz = from[2];
- out[i][0] = ux * m0;
- out[i][1] = uy * m5;
- out[i][2] = uz * m10;
- }
+ GLfloat ux = from[0], uy = from[1], uz = from[2];
+ out[i][0] = ux * m0;
+ out[i][1] = uy * m5;
+ out[i][2] = uz * m10;
}
dest->count = in->count;
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat m1 = scale*m[1], m5 = scale*m[5], m9 = scale*m[9];
GLfloat m2 = scale*m[2], m6 = scale*m[6], m10 = scale*m[10];
(void) lengths;
- (void) mask;
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat ux = from[0], uy = from[1], uz = from[2];
- out[i][0] = ux * m0 + uy * m1 + uz * m2;
- out[i][1] = ux * m4 + uy * m5 + uz * m6;
- out[i][2] = ux * m8 + uy * m9 + uz * m10;
- }
+ GLfloat ux = from[0], uy = from[1], uz = from[2];
+ out[i][0] = ux * m0 + uy * m1 + uz * m2;
+ out[i][1] = ux * m4 + uy * m5 + uz * m6;
+ out[i][2] = ux * m8 + uy * m9 + uz * m10;
}
dest->count = in->count;
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat m10 = m[10];
(void) scale;
(void) lengths;
- (void) mask;
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat ux = from[0], uy = from[1], uz = from[2];
- out[i][0] = ux * m0;
- out[i][1] = uy * m5;
- out[i][2] = uz * m10;
- }
+ GLfloat ux = from[0], uy = from[1], uz = from[2];
+ out[i][0] = ux * m0;
+ out[i][1] = uy * m5;
+ out[i][2] = uz * m10;
}
dest->count = in->count;
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat m2 = m[2], m6 = m[6], m10 = m[10];
(void) scale;
(void) lengths;
- (void) mask;
STRIDE_LOOP {
- CULL_CHECK {
- GLfloat ux = from[0], uy = from[1], uz = from[2];
- out[i][0] = ux * m0 + uy * m1 + uz * m2;
- out[i][1] = ux * m4 + uy * m5 + uz * m6;
- out[i][2] = ux * m8 + uy * m9 + uz * m10;
- }
+ GLfloat ux = from[0], uy = from[1], uz = from[2];
+ out[i][0] = ux * m0 + uy * m1 + uz * m2;
+ out[i][1] = ux * m4 + uy * m5 + uz * m6;
+ out[i][2] = ux * m8 + uy * m9 + uz * m10;
}
dest->count = in->count;
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLuint count = in->count;
GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
(void) mat;
- (void) mask;
(void) scale;
if (lengths) {
STRIDE_LOOP {
- CULL_CHECK {
- const GLfloat x = from[0], y = from[1], z = from[2];
- GLfloat invlen = lengths[i];
- out[i][0] = x * invlen;
- out[i][1] = y * invlen;
- out[i][2] = z * invlen;
- }
+ const GLfloat x = from[0], y = from[1], z = from[2];
+ GLfloat invlen = lengths[i];
+ out[i][0] = x * invlen;
+ out[i][1] = y * invlen;
+ out[i][2] = z * invlen;
}
}
else {
STRIDE_LOOP {
- CULL_CHECK {
- const GLfloat x = from[0], y = from[1], z = from[2];
- GLdouble len = x * x + y * y + z * z;
- if (len > 1e-50) {
- len = 1.0 / GL_SQRT(len);
- out[i][0] = (GLfloat) (x * len);
- out[i][1] = (GLfloat) (y * len);
- out[i][2] = (GLfloat) (z * len);
- }
- else {
- out[i][0] = x;
- out[i][1] = y;
- out[i][2] = z;
- }
+ const GLfloat x = from[0], y = from[1], z = from[2];
+ GLdouble len = x * x + y * y + z * z;
+ if (len > 1e-50) {
+ len = 1.0 / GL_SQRT(len);
+ out[i][0] = (GLfloat) (x * len);
+ out[i][1] = (GLfloat) (y * len);
+ out[i][2] = (GLfloat) (z * len);
+ }
+ else {
+ out[i][0] = x;
+ out[i][1] = y;
+ out[i][2] = z;
}
}
}
GLfloat scale,
const GLvector3f *in,
const GLfloat *lengths,
- const GLubyte mask[],
GLvector3f *dest )
{
GLuint i;
GLfloat (*out)[3] = (GLfloat (*)[3])dest->start;
(void) mat;
(void) lengths;
- (void) mask;
-
STRIDE_LOOP {
- CULL_CHECK {
- SCALE_SCALAR_3V( out[i], scale, from );
- }
+ SCALE_SCALAR_3V( out[i], scale, from );
}
dest->count = in->count;
}
static void _XFORMAPI
TAG(init_c_norm_transform)( void )
{
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
TAG(transform_normals_no_rot);
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =
TAG(transform_rescale_normals_no_rot);
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] =
TAG(transform_normalize_normals_no_rot);
- _mesa_normal_tab[NORM_TRANSFORM][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM] =
TAG(transform_normals);
- _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =
TAG(transform_rescale_normals);
- _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE][IDX] =
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] =
TAG(transform_normalize_normals);
- _mesa_normal_tab[NORM_RESCALE][IDX] =
+ _mesa_normal_tab[NORM_RESCALE] =
TAG(rescale_normals);
- _mesa_normal_tab[NORM_NORMALIZE][IDX] =
+ _mesa_normal_tab[NORM_NORMALIZE] =
TAG(normalize_normals);
}
-/* $Id: m_xform.c,v 1.11 2001/03/12 00:48:41 gareth Exp $ */
+/* $Id: m_xform.c,v 1.12 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
clip_func _mesa_clip_tab[5];
clip_func _mesa_clip_np_tab[5];
-dotprod_func _mesa_dotprod_tab[2][5];
-vec_copy_func _mesa_copy_tab[2][0x10];
-normal_func _mesa_normal_tab[0xf][0x4];
-transform_func **(_mesa_transform_tab[2]);
-static transform_func *cull_transform_tab[5];
-static transform_func *raw_transform_tab[5];
+dotprod_func _mesa_dotprod_tab[5];
+vec_copy_func _mesa_copy_tab[0x10];
+normal_func _mesa_normal_tab[0xf];
+transform_func *_mesa_transform_tab[5];
/* Raw data format used for:
* - Eye-to-clip transform (via the function above).
* - Cliptesting
* - And everything else too, if culling happens to be disabled.
+ *
+ * GH: It's used for everything now, as clipping/culling is done
+ * elsewhere (most often by the driver itself).
*/
-#define TAG(x) x##_raw
-#define TAG2(x,y) x##y##_raw
-#define IDX 0
-#define STRIDE_LOOP for (i=0;i<count;i++, STRIDE_F(from, stride))
-#define LOOP for (i=0;i<n;i++)
-#define CULL_CHECK
-#define CLIP_CHECK
+#define TAG(x) x
+#define TAG2(x,y) x##y
+#define STRIDE_LOOP for ( i = 0 ; i < count ; i++, STRIDE_F(from, stride) )
+#define LOOP for ( i = 0 ; i < n ; i++ )
#define ARGS
#include "m_xform_tmp.h"
#include "m_clip_tmp.h"
#undef TAG
#undef TAG2
#undef LOOP
-#undef CULL_CHECK
-#undef CLIP_CHECK
#undef ARGS
-#undef IDX
-
-/* Culled data used for:
- * - texture transformations
- * - viewport map transformation
- * - normal transformations prior to lighting
- * - user cliptests
- */
-#define TAG(x) x##_masked
-#define TAG2(x,y) x##y##_masked
-#define IDX 1
-#define STRIDE_LOOP for (i=0;i<count;i++, STRIDE_F(from, stride))
-#define LOOP for (i=0;i<n;i++)
-#define CULL_CHECK if (mask[i])
-#define CLIP_CHECK if ((mask[i] & flag) == 0)
-#define ARGS , const GLubyte mask[]
-#include "m_xform_tmp.h"
-#include "m_norm_tmp.h"
-#include "m_dotprod_tmp.h"
-#include "m_copy_tmp.h"
-#undef TAG
-#undef TAG2
-#undef LOOP
-#undef CULL_CHECK
-#undef CLIP_CHECK
-#undef ARGS
-#undef IDX
-
-
GLvector4f *_mesa_project_points( GLvector4f *proj_vec,
- const GLvector4f *clip_vec )
+ const GLvector4f *clip_vec )
{
const GLuint stride = clip_vec->stride;
const GLfloat *from = (GLfloat *)clip_vec->start;
void
_math_init_transformation( void )
{
- _mesa_transform_tab[0] = raw_transform_tab;
- _mesa_transform_tab[1] = cull_transform_tab;
-
- init_c_transformations_raw();
- init_c_transformations_masked();
- init_c_norm_transform_raw();
- init_c_norm_transform_masked();
- init_c_cliptest_raw();
- init_copy0_raw();
- init_copy0_masked();
- init_dotprod_raw();
- init_dotprod_masked();
+ init_c_transformations();
+ init_c_norm_transform();
+ init_c_cliptest();
+ init_copy0();
+ init_dotprod();
#ifdef DEBUG
_math_test_all_transform_functions( "default" );
-/* $Id: m_xform.h,v 1.9 2001/03/12 02:02:36 gareth Exp $ */
+/* $Id: m_xform.h,v 1.10 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
typedef void (*dotprod_func)( GLfloat *out,
GLuint out_stride,
CONST GLvector4f *coord_vec,
- CONST GLfloat plane[4],
- CONST GLubyte mask[]);
+ CONST GLfloat plane[4] );
typedef void (*vec_copy_func)( GLvector4f *to,
- CONST GLvector4f *from,
- CONST GLubyte mask[]);
+ CONST GLvector4f *from );
GLfloat scale,
CONST GLvector3f *in,
CONST GLfloat lengths[],
- CONST GLubyte mask[],
GLvector3f *dest );
/* Flags for selecting a normal transformation function.
*/
-#define NORM_RESCALE 0x1 /* apply the scale factor */
-#define NORM_NORMALIZE 0x2 /* normalize */
-#define NORM_TRANSFORM 0x4 /* apply the transformation matrix */
+#define NORM_RESCALE 0x1 /* apply the scale factor */
+#define NORM_NORMALIZE 0x2 /* normalize */
+#define NORM_TRANSFORM 0x4 /* apply the transformation matrix */
#define NORM_TRANSFORM_NO_ROT 0x8 /* apply the transformation matrix */
*/
typedef void (_XFORMAPIP transform_func)( GLvector4f *to_vec,
CONST GLfloat m[16],
- CONST GLvector4f *from_vec,
- CONST GLubyte *clipmask,
- CONST GLubyte flag );
+ CONST GLvector4f *from_vec );
extern GLvector4f *_mesa_project_points( GLvector4f *to,
CONST GLfloat src[][3] );
-extern dotprod_func _mesa_dotprod_tab[2][5];
-extern vec_copy_func _mesa_copy_tab[2][0x10];
-extern vec_copy_func _mesa_copy_clean_tab[2][5];
+extern dotprod_func _mesa_dotprod_tab[5];
+extern vec_copy_func _mesa_copy_tab[0x10];
+extern vec_copy_func _mesa_copy_clean_tab[5];
extern clip_func _mesa_clip_tab[5];
extern clip_func _mesa_clip_np_tab[5];
-extern normal_func _mesa_normal_tab[0xf][0x4];
+extern normal_func _mesa_normal_tab[0xf];
-/* Use of 3 layers of linked 1-dimensional arrays to reduce
+/* Use of 2 layers of linked 1-dimensional arrays to reduce
* cost of lookup.
*/
-extern transform_func **(_mesa_transform_tab[2]);
+extern transform_func *_mesa_transform_tab[5];
extern void _mesa_transform_point_sz( GLfloat Q[4], CONST GLfloat M[16],
#define TransformRaw( to, mat, from ) \
- ( (*_mesa_transform_tab[0][(from)->size][(mat)->type])( to, (mat)->m, from, 0, 0 ), \
- (to) )
+ ( _mesa_transform_tab[(from)->size][(mat)->type]( to, (mat)->m, from ), \
+ (to) )
#endif
-/* $Id: m_xform_tmp.h,v 1.5 2001/03/12 02:02:36 gareth Exp $ */
+/* $Id: m_xform_tmp.h,v 1.6 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* cliped and/or culled vertices.
*/
+/* GH: Not any more -- it's easier (and faster) to just process the
+ * entire vector. Clipping and culling are handled further down
+ * the pipe, most often during or after the conversion to some
+ * driver-specific vertex format.
+ */
+
static void _XFORMAPI
TAG(transform_points1_general)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m2 = m[2], m14 = m[14];
const GLfloat m3 = m[3], m15 = m[15];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m1 * ox + m13;
- to[i][2] = m2 * ox + m14;
- to[i][3] = m3 * ox + m15;
- }
+ const GLfloat ox = from[0];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m1 * ox + m13;
+ to[i][2] = m2 * ox + m14;
+ to[i][3] = m3 * ox + m15;
}
-
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
to_vec->count = from_vec->count;
static void _XFORMAPI
TAG(transform_points1_identity)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start;
GLuint i;
- (void) mask;
- (void) flag;
if (to_vec == from_vec) return;
STRIDE_LOOP {
- CLIP_CHECK {
- to[i][0] = from[0];
- }
+ to[i][0] = from[0];
}
-
to_vec->size = 1;
to_vec->flags |= VEC_SIZE_1;
to_vec->count = from_vec->count;
static void _XFORMAPI
TAG(transform_points1_2d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m1 = m[1];
const GLfloat m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m1 * ox + m13;
- }
+ const GLfloat ox = from[0];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m1 * ox + m13;
}
to_vec->size = 2;
to_vec->flags |= VEC_SIZE_2;
static void _XFORMAPI
TAG(transform_points1_2d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
const GLfloat m0 = m[0], m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m13;
- }
+ const GLfloat ox = from[0];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m13;
}
-
to_vec->size = 2;
to_vec->flags |= VEC_SIZE_2;
to_vec->count = from_vec->count;
static void _XFORMAPI
TAG(transform_points1_3d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m1 = m[1], m2 = m[2];
const GLfloat m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m1 * ox + m13;
- to[i][2] = m2 * ox + m14;
- }
+ const GLfloat ox = from[0];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m1 * ox + m13;
+ to[i][2] = m2 * ox + m14;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points1_3d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0];
const GLfloat m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m13;
- to[i][2] = m14;
- }
+ const GLfloat ox = from[0];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m13;
+ to[i][2] = m14;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points1_perspective)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
const GLfloat m0 = m[0], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0];
- to[i][0] = m0 * ox ;
- to[i][1] = 0 ;
- to[i][2] = m14;
- to[i][3] = 0;
- }
+ const GLfloat ox = from[0];
+ to[i][0] = m0 * ox ;
+ to[i][1] = 0 ;
+ to[i][2] = m14;
+ to[i][3] = 0;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points2_general)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m2 = m[2], m6 = m[6], m14 = m[14];
const GLfloat m3 = m[3], m7 = m[7], m15 = m[15];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1];
- to[i][0] = m0 * ox + m4 * oy + m12;
- to[i][1] = m1 * ox + m5 * oy + m13;
- to[i][2] = m2 * ox + m6 * oy + m14;
- to[i][3] = m3 * ox + m7 * oy + m15;
- }
+ const GLfloat ox = from[0], oy = from[1];
+ to[i][0] = m0 * ox + m4 * oy + m12;
+ to[i][1] = m1 * ox + m5 * oy + m13;
+ to[i][2] = m2 * ox + m6 * oy + m14;
+ to[i][3] = m3 * ox + m7 * oy + m15;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points2_identity)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start;
GLuint count = from_vec->count;
GLuint i;
- (void) mask;
- (void) flag;
if (to_vec == from_vec) return;
STRIDE_LOOP {
- CLIP_CHECK {
- to[i][0] = from[0];
- to[i][1] = from[1];
- }
+ to[i][0] = from[0];
+ to[i][1] = from[1];
}
to_vec->size = 2;
to_vec->flags |= VEC_SIZE_2;
static void _XFORMAPI
TAG(transform_points2_2d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m1 = m[1], m4 = m[4], m5 = m[5];
const GLfloat m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1];
- to[i][0] = m0 * ox + m4 * oy + m12;
- to[i][1] = m1 * ox + m5 * oy + m13;
- }
+ const GLfloat ox = from[0], oy = from[1];
+ to[i][0] = m0 * ox + m4 * oy + m12;
+ to[i][1] = m1 * ox + m5 * oy + m13;
}
-
to_vec->size = 2;
to_vec->flags |= VEC_SIZE_2;
to_vec->count = from_vec->count;
static void _XFORMAPI
TAG(transform_points2_2d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
const GLfloat m0 = m[0], m5 = m[5], m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m5 * oy + m13;
- }
+ const GLfloat ox = from[0], oy = from[1];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m5 * oy + m13;
}
-
to_vec->size = 2;
to_vec->flags |= VEC_SIZE_2;
to_vec->count = from_vec->count;
static void _XFORMAPI
TAG(transform_points2_3d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m1 = m[1], m2 = m[2], m4 = m[4], m5 = m[5];
const GLfloat m6 = m[6], m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1];
- to[i][0] = m0 * ox + m4 * oy + m12;
- to[i][1] = m1 * ox + m5 * oy + m13;
- to[i][2] = m2 * ox + m6 * oy + m14;
- }
+ const GLfloat ox = from[0], oy = from[1];
+ to[i][0] = m0 * ox + m4 * oy + m12;
+ to[i][1] = m1 * ox + m5 * oy + m13;
+ to[i][2] = m2 * ox + m6 * oy + m14;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points2_3d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m5 = m[5];
const GLfloat m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1];
- to[i][0] = m0 * ox + m12;
- to[i][1] = m5 * oy + m13;
- to[i][2] = m14;
- }
+ const GLfloat ox = from[0], oy = from[1];
+ to[i][0] = m0 * ox + m12;
+ to[i][1] = m5 * oy + m13;
+ to[i][2] = m14;
}
if (m14 == 0) {
to_vec->size = 2;
static void _XFORMAPI
TAG(transform_points2_perspective)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
const GLfloat m0 = m[0], m5 = m[5], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1];
- to[i][0] = m0 * ox ;
- to[i][1] = m5 * oy ;
- to[i][2] = m14;
- to[i][3] = 0;
- }
+ const GLfloat ox = from[0], oy = from[1];
+ to[i][0] = m0 * ox ;
+ to[i][1] = m5 * oy ;
+ to[i][2] = m14;
+ to[i][3] = 0;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points3_general)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m2 = m[2], m6 = m[6], m10 = m[10], m14 = m[14];
const GLfloat m3 = m[3], m7 = m[7], m11 = m[11], m15 = m[15];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2];
- to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12;
- to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13;
- to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14;
- to[i][3] = m3 * ox + m7 * oy + m11 * oz + m15;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2];
+ to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12;
+ to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13;
+ to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14;
+ to[i][3] = m3 * ox + m7 * oy + m11 * oz + m15;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points3_identity)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start;
GLuint count = from_vec->count;
GLuint i;
- (void) mask;
- (void) flag;
if (to_vec == from_vec) return;
STRIDE_LOOP {
- CLIP_CHECK {
- to[i][0] = from[0];
- to[i][1] = from[1];
- to[i][2] = from[2];
- }
+ to[i][0] = from[0];
+ to[i][1] = from[1];
+ to[i][2] = from[2];
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points3_2d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m1 = m[1], m4 = m[4], m5 = m[5];
const GLfloat m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2];
- to[i][0] = m0 * ox + m4 * oy + m12 ;
- to[i][1] = m1 * ox + m5 * oy + m13 ;
- to[i][2] = + oz ;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2];
+ to[i][0] = m0 * ox + m4 * oy + m12 ;
+ to[i][1] = m1 * ox + m5 * oy + m13 ;
+ to[i][2] = + oz ;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points3_2d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
const GLfloat m0 = m[0], m5 = m[5], m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2];
- to[i][0] = m0 * ox + m12 ;
- to[i][1] = m5 * oy + m13 ;
- to[i][2] = + oz ;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2];
+ to[i][0] = m0 * ox + m12 ;
+ to[i][1] = m5 * oy + m13 ;
+ to[i][2] = + oz ;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points3_3d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m6 = m[6], m8 = m[8], m9 = m[9], m10 = m[10];
const GLfloat m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2];
- to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 ;
- to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 ;
- to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 ;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2];
+ to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 ;
+ to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 ;
+ to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 ;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points3_3d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m5 = m[5];
const GLfloat m10 = m[10], m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2];
- to[i][0] = m0 * ox + m12 ;
- to[i][1] = m5 * oy + m13 ;
- to[i][2] = m10 * oz + m14 ;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2];
+ to[i][0] = m0 * ox + m12 ;
+ to[i][1] = m5 * oy + m13 ;
+ to[i][2] = m10 * oz + m14 ;
}
to_vec->size = 3;
to_vec->flags |= VEC_SIZE_3;
static void _XFORMAPI
TAG(transform_points3_perspective)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m5 = m[5], m8 = m[8], m9 = m[9];
const GLfloat m10 = m[10], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2];
- to[i][0] = m0 * ox + m8 * oz ;
- to[i][1] = m5 * oy + m9 * oz ;
- to[i][2] = m10 * oz + m14 ;
- to[i][3] = -oz ;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2];
+ to[i][0] = m0 * ox + m8 * oz ;
+ to[i][1] = m5 * oy + m9 * oz ;
+ to[i][2] = m10 * oz + m14 ;
+ to[i][3] = -oz ;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_general)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m2 = m[2], m6 = m[6], m10 = m[10], m14 = m[14];
const GLfloat m3 = m[3], m7 = m[7], m11 = m[11], m15 = m[15];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
- to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 * ow;
- to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 * ow;
- to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 * ow;
- to[i][3] = m3 * ox + m7 * oy + m11 * oz + m15 * ow;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
+ to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 * ow;
+ to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 * ow;
+ to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 * ow;
+ to[i][3] = m3 * ox + m7 * oy + m11 * oz + m15 * ow;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_identity)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLfloat (*to)[4] = (GLfloat (*)[4])to_vec->start;
GLuint count = from_vec->count;
GLuint i;
- (void) mask;
- (void) flag;
if (to_vec == from_vec) return;
STRIDE_LOOP {
- CLIP_CHECK {
- to[i][0] = from[0];
- to[i][1] = from[1];
- to[i][2] = from[2];
- to[i][3] = from[3];
- }
+ to[i][0] = from[0];
+ to[i][1] = from[1];
+ to[i][2] = from[2];
+ to[i][3] = from[3];
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_2d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m1 = m[1], m4 = m[4], m5 = m[5];
const GLfloat m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
- to[i][0] = m0 * ox + m4 * oy + m12 * ow;
- to[i][1] = m1 * ox + m5 * oy + m13 * ow;
- to[i][2] = + oz ;
- to[i][3] = ow;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
+ to[i][0] = m0 * ox + m4 * oy + m12 * ow;
+ to[i][1] = m1 * ox + m5 * oy + m13 * ow;
+ to[i][2] = + oz ;
+ to[i][3] = ow;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_2d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
GLuint count = from_vec->count;
const GLfloat m0 = m[0], m5 = m[5], m12 = m[12], m13 = m[13];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
- to[i][0] = m0 * ox + m12 * ow;
- to[i][1] = m5 * oy + m13 * ow;
- to[i][2] = + oz ;
- to[i][3] = ow;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
+ to[i][0] = m0 * ox + m12 * ow;
+ to[i][1] = m5 * oy + m13 * ow;
+ to[i][2] = + oz ;
+ to[i][3] = ow;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_3d)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m6 = m[6], m8 = m[8], m9 = m[9], m10 = m[10];
const GLfloat m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
- to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 * ow;
- to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 * ow;
- to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 * ow;
- to[i][3] = ow;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
+ to[i][0] = m0 * ox + m4 * oy + m8 * oz + m12 * ow;
+ to[i][1] = m1 * ox + m5 * oy + m9 * oz + m13 * ow;
+ to[i][2] = m2 * ox + m6 * oy + m10 * oz + m14 * ow;
+ to[i][3] = ow;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_3d_no_rot)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m5 = m[5];
const GLfloat m10 = m[10], m12 = m[12], m13 = m[13], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
- to[i][0] = m0 * ox + m12 * ow;
- to[i][1] = m5 * oy + m13 * ow;
- to[i][2] = m10 * oz + m14 * ow;
- to[i][3] = ow;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
+ to[i][0] = m0 * ox + m12 * ow;
+ to[i][1] = m5 * oy + m13 * ow;
+ to[i][2] = m10 * oz + m14 * ow;
+ to[i][3] = ow;
}
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
static void _XFORMAPI
TAG(transform_points4_perspective)( GLvector4f *to_vec,
const GLfloat m[16],
- const GLvector4f *from_vec,
- const GLubyte *mask,
- const GLubyte flag )
+ const GLvector4f *from_vec )
{
const GLuint stride = from_vec->stride;
GLfloat *from = from_vec->start;
const GLfloat m0 = m[0], m5 = m[5], m8 = m[8], m9 = m[9];
const GLfloat m10 = m[10], m14 = m[14];
GLuint i;
- (void) mask;
- (void) flag;
STRIDE_LOOP {
- CLIP_CHECK {
- const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
- to[i][0] = m0 * ox + m8 * oz ;
- to[i][1] = m5 * oy + m9 * oz ;
- to[i][2] = m10 * oz + m14 * ow ;
- to[i][3] = -oz ;
- }
+ const GLfloat ox = from[0], oy = from[1], oz = from[2], ow = from[3];
+ to[i][0] = m0 * ox + m8 * oz ;
+ to[i][1] = m5 * oy + m9 * oz ;
+ to[i][2] = m10 * oz + m14 * ow ;
+ to[i][3] = -oz ;
}
-
to_vec->size = 4;
to_vec->flags |= VEC_SIZE_4;
to_vec->count = from_vec->count;
*/
static void _XFORMAPI TAG(init_c_transformations)( void )
{
-#define TAG_TAB _mesa_transform_tab[IDX]
+#define TAG_TAB _mesa_transform_tab
#define TAG_TAB_1 TAG(transform_tab_1)
#define TAG_TAB_2 TAG(transform_tab_2)
#define TAG_TAB_3 TAG(transform_tab_3)
TAG_TAB_1[MATRIX_GENERAL] = TAG(transform_points1_general);
TAG_TAB_1[MATRIX_IDENTITY] = TAG(transform_points1_identity);
TAG_TAB_1[MATRIX_3D_NO_ROT] = TAG(transform_points1_3d_no_rot);
- TAG_TAB_1[MATRIX_PERSPECTIVE] = TAG(transform_points1_perspective) ;
+ TAG_TAB_1[MATRIX_PERSPECTIVE] = TAG(transform_points1_perspective);
TAG_TAB_1[MATRIX_2D] = TAG(transform_points1_2d);
TAG_TAB_1[MATRIX_2D_NO_ROT] = TAG(transform_points1_2d_no_rot);
TAG_TAB_1[MATRIX_3D] = TAG(transform_points1_3d);
TAG_TAB_2[MATRIX_GENERAL] = TAG(transform_points2_general);
TAG_TAB_2[MATRIX_IDENTITY] = TAG(transform_points2_identity);
TAG_TAB_2[MATRIX_3D_NO_ROT] = TAG(transform_points2_3d_no_rot);
- TAG_TAB_2[MATRIX_PERSPECTIVE] = TAG(transform_points2_perspective) ;
+ TAG_TAB_2[MATRIX_PERSPECTIVE] = TAG(transform_points2_perspective);
TAG_TAB_2[MATRIX_2D] = TAG(transform_points2_2d);
TAG_TAB_2[MATRIX_2D_NO_ROT] = TAG(transform_points2_2d_no_rot);
TAG_TAB_2[MATRIX_3D] = TAG(transform_points2_3d);
-/* $Id: t_vb_fog.c,v 1.9 2001/03/19 02:25:37 keithw Exp $ */
+/* $Id: t_vb_fog.c,v 1.10 2001/03/30 14:44:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
/* Full eye coords weren't required, just calculate the
* eye Z values.
*/
- _mesa_dotprod_tab[0][VB->ObjPtr->size](input->data, sizeof(GLfloat),
- VB->ObjPtr, plane, 0 );
+ _mesa_dotprod_tab[VB->ObjPtr->size]( input->data,
+ sizeof(GLfloat),
+ VB->ObjPtr, plane );
input->count = VB->ObjPtr->count;
}
-/* $Id: t_vb_normals.c,v 1.7 2001/03/12 00:48:44 gareth Exp $ */
+/* $Id: t_vb_normals.c,v 1.8 2001/03/30 14:44:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
struct normal_stage_data {
- normal_func *NormalTransform;
+ normal_func NormalTransform;
GLvector3f normal;
};
ASSERT(store->NormalTransform);
if (stage->changed_inputs)
- (store->NormalTransform[0])(&ctx->ModelView,
- ctx->_ModelViewInvScale,
- VB->NormalPtr,
- 0,
- 0,
- &store->normal);
+ store->NormalTransform( &ctx->ModelView,
+ ctx->_ModelViewInvScale,
+ VB->NormalPtr,
+ 0,
+ &store->normal );
VB->NormalPtr = &store->normal;
return GL_TRUE;
static GLboolean run_validate_normal_stage( GLcontext *ctx,
- struct gl_pipeline_stage *stage)
+ struct gl_pipeline_stage *stage )
{
struct normal_stage_data *store = NORMAL_STAGE_DATA(stage);
-/* $Id: t_vb_texgen.c,v 1.7 2001/03/29 21:16:26 keithw Exp $ */
+/* $Id: t_vb_texgen.c,v 1.8 2001/03/30 14:44:44 gareth Exp $ */
/*
* Mesa 3-D graphics library
/*
*/
-static void build_m3(GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
- const GLvector4f *eye )
+static void build_m3( GLfloat f[][3], GLfloat m[],
+ const GLvector3f *normal,
+ const GLvector4f *eye )
{
GLuint stride = eye->stride;
GLfloat *coord = (GLfloat *)eye->start;
const GLfloat *norm = normal->start;
GLuint i;
-
/* KW: Had to rearrange this loop to avoid a compiler bug with gcc
* 2.7.3.1 at -O3 optimization. Using -fno-strength-reduce
* also fixed the bug - is this generally necessary?
-static void build_m2(GLfloat f[][3], GLfloat m[],
- const GLvector3f *normal,
- const GLvector4f *eye )
+static void build_m2( GLfloat f[][3], GLfloat m[],
+ const GLvector3f *normal,
+ const GLvector4f *eye )
{
GLuint stride = eye->stride;
GLfloat *coord = eye->start;
-typedef void (*build_m_func)(GLfloat f[][3],
- GLfloat m[],
- const GLvector3f *normal,
- const GLvector4f *eye );
-
+typedef void (*build_m_func)( GLfloat f[][3],
+ GLfloat m[],
+ const GLvector3f *normal,
+ const GLvector4f *eye );
static build_m_func build_m_tab[5] = {
out->count = in->count;
out->size = MAX2(in->size, 3);
if (in->size == 4)
- _mesa_copy_tab[0][0x8](out, in, 0);
+ _mesa_copy_tab[0x8]( out, in );
}
else {
out->flags |= VEC_SIZE_3;
out->count = in->count;
out->size = MAX2(in->size, 3);
if (in->size == 4)
- _mesa_copy_tab[0][0x8](out, in, 0);
+ _mesa_copy_tab[0x8]( out, in );
}
else {
out->flags |= VEC_SIZE_3;
out->count = in->count;
out->flags |= (in->flags & VEC_SIZE_FLAGS) | VEC_SIZE_2;
if (in->size > 2)
- _mesa_copy_tab[0][all_bits[in->size] & ~0x3](out, in, 0);
+ _mesa_copy_tab[all_bits[in->size] & ~0x3]( out, in );
} else {
out->size = 2;
out->flags |= VEC_SIZE_2;
else {
GLuint copy = (all_bits[in->size] & ~texUnit->TexGenEnabled);
if (copy)
- _mesa_copy_tab[0][copy](out, in, 0);
+ _mesa_copy_tab[copy]( out, in );
out->size = MAX2(in->size, store->TexgenSize[unit]);
out->flags |= (in->flags & VEC_SIZE_FLAGS) | texUnit->TexGenEnabled;
GLuint i;
switch (texUnit->GenModeS) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])((GLfloat *)out->data,
- sizeof(out->data[0]), obj,
- texUnit->ObjectPlaneS, 0);
+ _mesa_dotprod_tab[obj->size]( (GLfloat *)out->data,
+ sizeof(out->data[0]), obj,
+ texUnit->ObjectPlaneS );
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])((GLfloat *)out->data,
- sizeof(out->data[0]), eye,
- texUnit->EyePlaneS, 0);
+ _mesa_dotprod_tab[eye->size]( (GLfloat *)out->data,
+ sizeof(out->data[0]), eye,
+ texUnit->EyePlaneS );
break;
case GL_SPHERE_MAP:
for (indata=in->start,i=0 ; i<count ;i++, STRIDE_F(indata,in->stride))
GLuint i;
switch (texUnit->GenModeT) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][1]),
- sizeof(out->data[0]), obj,
- texUnit->ObjectPlaneT, 0);
+ _mesa_dotprod_tab[obj->size]( &(out->data[0][1]),
+ sizeof(out->data[0]), obj,
+ texUnit->ObjectPlaneT );
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][1]),
- sizeof(out->data[0]), eye,
- texUnit->EyePlaneT, 0);
+ _mesa_dotprod_tab[eye->size]( &(out->data[0][1]),
+ sizeof(out->data[0]), eye,
+ texUnit->EyePlaneT );
break;
case GL_SPHERE_MAP:
for (indata=in->start,i=0; i<count ;i++,STRIDE_F(indata,in->stride))
GLuint i;
switch (texUnit->GenModeR) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][2]),
- sizeof(out->data[0]), obj,
- texUnit->ObjectPlaneR, 0);
+ _mesa_dotprod_tab[obj->size]( &(out->data[0][2]),
+ sizeof(out->data[0]), obj,
+ texUnit->ObjectPlaneR );
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][2]),
- sizeof(out->data[0]), eye,
- texUnit->EyePlaneR, 0);
+ _mesa_dotprod_tab[eye->size]( &(out->data[0][2]),
+ sizeof(out->data[0]), eye,
+ texUnit->EyePlaneR );
break;
case GL_REFLECTION_MAP_NV:
for (i=0;i<count;i++)
if (texUnit->TexGenEnabled & Q_BIT) {
switch (texUnit->GenModeQ) {
case GL_OBJECT_LINEAR:
- (_mesa_dotprod_tab[0][obj->size])(&(out->data[0][3]),
- sizeof(out->data[0]), obj,
- texUnit->ObjectPlaneQ, 0);
+ _mesa_dotprod_tab[obj->size]( &(out->data[0][3]),
+ sizeof(out->data[0]), obj,
+ texUnit->ObjectPlaneQ );
break;
case GL_EYE_LINEAR:
- (_mesa_dotprod_tab[0][eye->size])(&(out->data[0][3]),
- sizeof(out->data[0]), eye,
- texUnit->EyePlaneQ, 0);
+ _mesa_dotprod_tab[eye->size]( &(out->data[0][3]),
+ sizeof(out->data[0]), eye,
+ texUnit->EyePlaneQ );
break;
default:
_mesa_problem(ctx, "Bad Q texgen");
-/* $Id: 3dnow.c,v 1.18 2001/03/29 06:46:15 gareth Exp $ */
+/* $Id: 3dnow.c,v 1.19 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
-#include "mtypes.h"
-#include "3dnow.h"
-
#include "math/m_vertices.h"
#include "math/m_xform.h"
-
#include "tnl/t_context.h"
+#include "3dnow.h"
+#include "common_x86_macros.h"
+
#ifdef DEBUG
#include "math/m_debug.h"
#endif
-#define XFORM_ARGS GLvector4f *to_vec, \
- const GLfloat m[16], \
- const GLvector4f *from_vec, \
- const GLubyte *mask, \
- const GLubyte flag
-
-
-#define DECLARE_XFORM_GROUP( pfx, sz ) \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
-
-
-#define ASSIGN_XFORM_GROUP( pfx, sz ) \
- _mesa_transform_tab[0][sz][MATRIX_GENERAL] = \
- _mesa_##pfx##_transform_points##sz##_general; \
- _mesa_transform_tab[0][sz][MATRIX_IDENTITY] = \
- _mesa_##pfx##_transform_points##sz##_identity; \
- _mesa_transform_tab[0][sz][MATRIX_3D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_PERSPECTIVE] = \
- _mesa_##pfx##_transform_points##sz##_perspective; \
- _mesa_transform_tab[0][sz][MATRIX_2D] = \
- _mesa_##pfx##_transform_points##sz##_2d; \
- _mesa_transform_tab[0][sz][MATRIX_2D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_3D] = \
- _mesa_##pfx##_transform_points##sz##_3d;
-
-
-
-#define NORM_ARGS const GLmatrix *mat, \
- GLfloat scale, \
- const GLvector3f *in, \
- const GLfloat *lengths, \
- const GLubyte mask[], \
- GLvector3f *dest
-
-
-#define DECLARE_NORM_GROUP( pfx ) \
-extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
-
-
-#define ASSIGN_NORM_GROUP( pfx ) \
- _mesa_normal_tab[NORM_RESCALE][0] = \
- _mesa_##pfx##_rescale_normals; \
- _mesa_normal_tab[NORM_NORMALIZE][0] = \
- _mesa_##pfx##_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM][0] = \
- _mesa_##pfx##_transform_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][0] = \
- _mesa_##pfx##_transform_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM|NORM_RESCALE][0] = \
- _mesa_##pfx##_transform_rescale_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_RESCALE][0] = \
- _mesa_##pfx##_transform_rescale_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM|NORM_NORMALIZE][0] = \
- _mesa_##pfx##_transform_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_NORMALIZE][0] = \
- _mesa_##pfx##_transform_normalize_normals_no_rot;
-
-
#ifdef USE_3DNOW_ASM
DECLARE_XFORM_GROUP( 3dnow, 2 )
DECLARE_XFORM_GROUP( 3dnow, 3 )
--- /dev/null
+/* $Id: common_x86_macros.h,v 1.1 2001/03/30 14:44:43 gareth Exp $ */
+
+/*
+ * Mesa 3-D graphics library
+ * Version: 3.5
+ *
+ * Copyright (C) 1999-2001 Brian Paul All Rights Reserved.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors:
+ * Gareth Hughes <gareth@valinux.com>
+ */
+
+#ifndef __COMMON_X86_MACROS_H__
+#define __COMMON_X86_MACROS_H__
+
+
+/* =============================================================
+ * Transformation function declarations:
+ */
+
+#define XFORM_ARGS GLvector4f *to_vec, \
+ const GLfloat m[16], \
+ const GLvector4f *from_vec
+
+#define DECLARE_XFORM_GROUP( pfx, sz ) \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
+
+#define ASSIGN_XFORM_GROUP( pfx, sz ) \
+ _mesa_transform_tab[sz][MATRIX_GENERAL] = \
+ _mesa_##pfx##_transform_points##sz##_general; \
+ _mesa_transform_tab[sz][MATRIX_IDENTITY] = \
+ _mesa_##pfx##_transform_points##sz##_identity; \
+ _mesa_transform_tab[sz][MATRIX_3D_NO_ROT] = \
+ _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
+ _mesa_transform_tab[sz][MATRIX_PERSPECTIVE] = \
+ _mesa_##pfx##_transform_points##sz##_perspective; \
+ _mesa_transform_tab[sz][MATRIX_2D] = \
+ _mesa_##pfx##_transform_points##sz##_2d; \
+ _mesa_transform_tab[sz][MATRIX_2D_NO_ROT] = \
+ _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
+ _mesa_transform_tab[sz][MATRIX_3D] = \
+ _mesa_##pfx##_transform_points##sz##_3d;
+
+
+/* =============================================================
+ * Normal transformation function declarations:
+ */
+
+#define NORM_ARGS const GLmatrix *mat, \
+ GLfloat scale, \
+ const GLvector3f *in, \
+ const GLfloat *lengths, \
+ GLvector3f *dest
+
+#define DECLARE_NORM_GROUP( pfx ) \
+extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \
+extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
+
+#define ASSIGN_NORM_GROUP( pfx ) \
+ _mesa_normal_tab[NORM_RESCALE] = \
+ _mesa_##pfx##_rescale_normals; \
+ _mesa_normal_tab[NORM_NORMALIZE] = \
+ _mesa_##pfx##_normalize_normals; \
+ _mesa_normal_tab[NORM_TRANSFORM] = \
+ _mesa_##pfx##_transform_normals; \
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] = \
+ _mesa_##pfx##_transform_normals_no_rot; \
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] = \
+ _mesa_##pfx##_transform_rescale_normals; \
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] = \
+ _mesa_##pfx##_transform_rescale_normals_no_rot; \
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_NORMALIZE] = \
+ _mesa_##pfx##_transform_normalize_normals; \
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_NORMALIZE] = \
+ _mesa_##pfx##_transform_normalize_normals_no_rot;
+
+
+#endif
-/* $Id: norm_args.h,v 1.1 2001/03/28 20:44:44 gareth Exp $ */
+/* $Id: norm_args.h,v 1.2 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
* GLfloat scale,
* CONST GLvector3f *in,
* CONST GLfloat lengths[],
- * CONST GLubyte mask[],
* GLvector3f *dest );
*/
#define OFFSET_MAT 4
#define OFFSET_SCALE 8
#define OFFSET_IN 12
#define OFFSET_LENGTHS 16
-#define OFFSET_MASK 20
-#define OFFSET_DEST 24
+#define OFFSET_DEST 20
#define ARG_MAT REGOFF(FRAME_OFFSET+OFFSET_MAT, ESP)
#define ARG_SCALE REGOFF(FRAME_OFFSET+OFFSET_SCALE, ESP)
#define ARG_IN REGOFF(FRAME_OFFSET+OFFSET_IN, ESP)
#define ARG_LENGTHS REGOFF(FRAME_OFFSET+OFFSET_LENGTHS, ESP)
-#define ARG_MASK REGOFF(FRAME_OFFSET+OFFSET_MASK, ESP)
#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
#endif
-/* $Id: sse.c,v 1.1 2001/03/29 06:46:16 gareth Exp $ */
+/* $Id: sse.c,v 1.2 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
-#include "mtypes.h"
-#include "sse.h"
-
#include "math/m_vertices.h"
#include "math/m_xform.h"
-
#include "tnl/t_context.h"
+#include "sse.h"
+#include "common_x86_macros.h"
+
#ifdef DEBUG
#include "math/m_debug.h"
#endif
-#define XFORM_ARGS GLvector4f *to_vec, \
- const GLfloat m[16], \
- const GLvector4f *from_vec, \
- const GLubyte *mask, \
- const GLubyte flag
-
-
-#define DECLARE_XFORM_GROUP( pfx, sz ) \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
-
-
-#define ASSIGN_XFORM_GROUP( pfx, sz ) \
- _mesa_transform_tab[0][sz][MATRIX_GENERAL] = \
- _mesa_##pfx##_transform_points##sz##_general; \
- _mesa_transform_tab[0][sz][MATRIX_IDENTITY] = \
- _mesa_##pfx##_transform_points##sz##_identity; \
- _mesa_transform_tab[0][sz][MATRIX_3D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_PERSPECTIVE] = \
- _mesa_##pfx##_transform_points##sz##_perspective; \
- _mesa_transform_tab[0][sz][MATRIX_2D] = \
- _mesa_##pfx##_transform_points##sz##_2d; \
- _mesa_transform_tab[0][sz][MATRIX_2D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_3D] = \
- _mesa_##pfx##_transform_points##sz##_3d;
-
-
-
-#define NORM_ARGS const GLmatrix *mat, \
- GLfloat scale, \
- const GLvector3f *in, \
- const GLfloat *lengths, \
- const GLubyte mask[], \
- GLvector3f *dest
-
-
-#define DECLARE_NORM_GROUP( pfx ) \
-extern void _ASMAPI _mesa_##pfx##_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_rescale_normals_no_rot( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals( NORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_normalize_normals_no_rot( NORM_ARGS );
-
-
-#define ASSIGN_NORM_GROUP( pfx ) \
- _mesa_normal_tab[NORM_RESCALE][0] = \
- _mesa_##pfx##_rescale_normals; \
- _mesa_normal_tab[NORM_NORMALIZE][0] = \
- _mesa_##pfx##_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM][0] = \
- _mesa_##pfx##_transform_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][0] = \
- _mesa_##pfx##_transform_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM|NORM_RESCALE][0] = \
- _mesa_##pfx##_transform_rescale_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_RESCALE][0] = \
- _mesa_##pfx##_transform_rescale_normals_no_rot; \
- _mesa_normal_tab[NORM_TRANSFORM|NORM_NORMALIZE][0] = \
- _mesa_##pfx##_transform_normalize_normals; \
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_NORMALIZE][0] = \
- _mesa_##pfx##_transform_normalize_normals_no_rot;
-
-
#ifdef USE_SSE_ASM
DECLARE_XFORM_GROUP( sse, 2 )
DECLARE_XFORM_GROUP( sse, 3 )
#if 1
/* TODO: Finish these off.
*/
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT][0] =
- _mesa_sse_transform_normals_no_rot;
- _mesa_normal_tab[NORM_TRANSFORM|NORM_RESCALE][0] =
- _mesa_sse_transform_rescale_normals;
- _mesa_normal_tab[NORM_TRANSFORM_NO_ROT|NORM_RESCALE][0] =
- _mesa_sse_transform_rescale_normals_no_rot;
-
- _mesa_transform_tab[0][4][MATRIX_GENERAL] =
+ _mesa_transform_tab[4][MATRIX_GENERAL] =
_mesa_sse_transform_points4_general;
- _mesa_transform_tab[0][4][MATRIX_3D] =
+ _mesa_transform_tab[4][MATRIX_3D] =
_mesa_sse_transform_points4_3d;
- _mesa_transform_tab[0][4][MATRIX_IDENTITY] =
+ _mesa_transform_tab[4][MATRIX_IDENTITY] =
_mesa_sse_transform_points4_identity;
+
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT] =
+ _mesa_sse_transform_normals_no_rot;
+ _mesa_normal_tab[NORM_TRANSFORM | NORM_RESCALE] =
+ _mesa_sse_transform_rescale_normals;
+ _mesa_normal_tab[NORM_TRANSFORM_NO_ROT | NORM_RESCALE] =
+ _mesa_sse_transform_rescale_normals_no_rot;
#else
+ ASSIGN_XFORM_GROUP( sse, 4 );
+
ASSIGN_NORM_GROUP( sse );
#endif
-/* $Id: x86.c,v 1.20 2001/03/29 06:46:27 gareth Exp $ */
+/* $Id: x86.c,v 1.21 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
#include "glheader.h"
#include "context.h"
-#include "mtypes.h"
-#include "x86.h"
-
#include "math/m_vertices.h"
#include "math/m_xform.h"
-
#include "tnl/t_context.h"
+#include "x86.h"
+#include "common_x86_macros.h"
+
#ifdef DEBUG
#include "math/m_debug.h"
#endif
-#define XFORM_ARGS GLvector4f *to_vec, \
- const GLfloat m[16], \
- const GLvector4f *from_vec, \
- const GLubyte *mask, \
- const GLubyte flag
-
-
-#define DECLARE_XFORM_GROUP( pfx, sz ) \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_general( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_identity( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_perspective( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_2d_no_rot( XFORM_ARGS ); \
-extern void _ASMAPI _mesa_##pfx##_transform_points##sz##_3d( XFORM_ARGS );
-
-
-#define ASSIGN_XFORM_GROUP( pfx, sz ) \
- _mesa_transform_tab[0][sz][MATRIX_GENERAL] = \
- _mesa_##pfx##_transform_points##sz##_general; \
- _mesa_transform_tab[0][sz][MATRIX_IDENTITY] = \
- _mesa_##pfx##_transform_points##sz##_identity; \
- _mesa_transform_tab[0][sz][MATRIX_3D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_3d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_PERSPECTIVE] = \
- _mesa_##pfx##_transform_points##sz##_perspective; \
- _mesa_transform_tab[0][sz][MATRIX_2D] = \
- _mesa_##pfx##_transform_points##sz##_2d; \
- _mesa_transform_tab[0][sz][MATRIX_2D_NO_ROT] = \
- _mesa_##pfx##_transform_points##sz##_2d_no_rot; \
- _mesa_transform_tab[0][sz][MATRIX_3D] = \
- _mesa_##pfx##_transform_points##sz##_3d;
-
-
#ifdef USE_X86_ASM
DECLARE_XFORM_GROUP( x86, 2 )
DECLARE_XFORM_GROUP( x86, 3 )
-/* $Id: xform_args.h,v 1.3 2001/03/28 20:44:44 gareth Exp $ */
+/* $Id: xform_args.h,v 1.4 2001/03/30 14:44:43 gareth Exp $ */
/*
* Mesa 3-D graphics library
*
* typedef void (*transform_func)( GLvector4f *to_vec,
* const GLfloat m[16],
- * const GLvector4f *from_vec,
- * const GLubyte *clipmask,
- * const GLubyte flag );
+ * const GLvector4f *from_vec );
*/
#define OFFSET_DEST 4
#define OFFSET_MATRIX 8
#define OFFSET_SOURCE 12
-#define OFFSET_CLIP 16
-#define OFFSET_FLAG 20
#define ARG_DEST REGOFF(FRAME_OFFSET+OFFSET_DEST, ESP)
#define ARG_MATRIX REGOFF(FRAME_OFFSET+OFFSET_MATRIX, ESP)
#define ARG_SOURCE REGOFF(FRAME_OFFSET+OFFSET_SOURCE, ESP)
-#define ARG_CLIP REGOFF(FRAME_OFFSET+OFFSET_CLIP, ESP)
-#define ARG_FLAG REGOFF(FRAME_OFFSET+OFFSET_FLAG, ESP)
#endif