From b3aefd1cfb6aacd1695c52911dd39da50d893ece Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 19 Sep 2005 20:12:32 +0000 Subject: additional wrapper updates, bug 4468 --- src/mesa/tnl/t_vb_arbprogram.c | 2 +- src/mesa/tnl/t_vb_fog.c | 2 +- src/mesa/tnl/t_vertex_generic.c | 2 +- src/mesa/tnl/t_vp_build.c | 6 +++--- src/mesa/tnl/t_vtx_exec.c | 6 +++++- src/mesa/tnl/t_vtx_x86.c | 17 ++++++++++++++--- 6 files changed, 25 insertions(+), 10 deletions(-) (limited to 'src/mesa/tnl') diff --git a/src/mesa/tnl/t_vb_arbprogram.c b/src/mesa/tnl/t_vb_arbprogram.c index 9fc49a2cee..08b9ffc889 100644 --- a/src/mesa/tnl/t_vb_arbprogram.c +++ b/src/mesa/tnl/t_vb_arbprogram.c @@ -97,7 +97,7 @@ static GLfloat RoughApproxPower(GLfloat x, GLfloat y) */ static GLfloat ApproxLog2(GLfloat t) { - return (GLfloat) (log(t) * 1.442695F); + return (GLfloat) (LOGF(t) * 1.442695F); } static GLfloat ApproxExp2(GLfloat t) diff --git a/src/mesa/tnl/t_vb_fog.c b/src/mesa/tnl/t_vb_fog.c index 91c3591f5b..ddf849a658 100644 --- a/src/mesa/tnl/t_vb_fog.c +++ b/src/mesa/tnl/t_vb_fog.c @@ -80,7 +80,7 @@ init_static_data( void ) GLfloat f = 0.0F; GLint i = 0; for ( ; i < FOG_EXP_TABLE_SIZE ; i++, f += FOG_INCR) { - exp_table[i] = (GLfloat) exp(-f); + exp_table[i] = EXPF(-f); } inited = 1; } diff --git a/src/mesa/tnl/t_vertex_generic.c b/src/mesa/tnl/t_vertex_generic.c index 3f94458053..236a5bedc8 100644 --- a/src/mesa/tnl/t_vertex_generic.c +++ b/src/mesa/tnl/t_vertex_generic.c @@ -203,7 +203,7 @@ static INLINE void insert_3f_xyw_4( const struct tnl_clipspace_attr *a, GLubyte static INLINE void insert_3f_xyw_err( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) { (void) a; (void) v; (void) in; - abort(); + _mesa_exit(1); } static INLINE void insert_3f_3( const struct tnl_clipspace_attr *a, GLubyte *v, const GLfloat *in ) diff --git a/src/mesa/tnl/t_vp_build.c b/src/mesa/tnl/t_vp_build.c index 3e77758edb..68bd7b7a9a 100644 --- a/src/mesa/tnl/t_vp_build.c +++ b/src/mesa/tnl/t_vp_build.c @@ -326,10 +326,10 @@ static struct ureg swizzle1( struct ureg reg, int x ) static struct ureg get_temp( struct tnl_program *p ) { - int bit = ffs( ~p->temp_in_use ); + int bit = _mesa_ffs( ~p->temp_in_use ); if (!bit) { - fprintf(stderr, "%s: out of temporaries\n", __FILE__); - exit(1); + _mesa_problem(NULL, "%s: out of temporaries\n", __FILE__); + _mesa_exit(1); } p->temp_in_use |= 1<<(bit-1); diff --git a/src/mesa/tnl/t_vtx_exec.c b/src/mesa/tnl/t_vtx_exec.c index ef609781c5..b296e439d2 100644 --- a/src/mesa/tnl/t_vtx_exec.c +++ b/src/mesa/tnl/t_vtx_exec.c @@ -113,8 +113,12 @@ static void _tnl_vb_bind_vtx( GLcontext *ctx ) GLuint count = tnl->vtx.initial_counter - tnl->vtx.counter; GLuint attr, i; - if (0) fprintf(stderr, "_tnl_vb_bind_vtx(): %d verts %d vertsize\n", +#undef DEBUG_VTX + +#ifdef DEBUG_VTX + fprintf(stderr, "_tnl_vb_bind_vtx(): %d verts %d vertsize\n", count, tnl->vtx.vertex_size); +#endif /* Setup constant data in the VB. diff --git a/src/mesa/tnl/t_vtx_x86.c b/src/mesa/tnl/t_vtx_x86.c index 1812cfa471..99a0550932 100644 --- a/src/mesa/tnl/t_vtx_x86.c +++ b/src/mesa/tnl/t_vtx_x86.c @@ -44,7 +44,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "t_vtx_api.h" #include "simple_list.h" - #if defined(USE_X86_ASM) && !defined(HAVE_NONSTANDARD_GLAPIENTRY) #define EXTERN( FUNC ) \ @@ -94,6 +93,18 @@ EXTERN( _tnl_x86_choose_fv ); +#undef DEBUG_VTX + +#ifdef DEBUG_VTX +#define FIXUP_PRINTF( offset, NEWVAL ) \ + fprintf(stderr, "%s/%d: offset %d, new value: 0x%x\n", __FILE__, __LINE__, offset, (int)(NEWVAL)) +#define FIXUPREL_PRINTF( offset, NEWVAL, CODE ) \ + fprintf(stderr, "%s/%d: offset %d, new value: 0x%x\n", __FILE__, __LINE__, offset, (int)(NEWVAL) - ((int)(CODE)+offset) - 4) +#else +#define FIXUP_PRINTF( offset, NEWVAL ) +#define FIXUPREL_PRINTF( offset, NEWVAL, CODE ) +#endif + #define FIXUP( CODE, KNOWN_OFFSET, CHECKVAL, NEWVAL ) \ do { \ GLint subst = 0x10101010 + CHECKVAL; \ @@ -101,7 +112,7 @@ do { \ if (DONT_KNOW_OFFSETS) { \ while (*(int *)(CODE+offset) != subst) offset++; \ *(int *)(CODE+offset) = (int)(NEWVAL); \ - if (0) fprintf(stderr, "%s/%d: offset %d, new value: 0x%x\n", __FILE__, __LINE__, offset, (int)(NEWVAL)); \ + FIXUP_PRINTF(offset, NEWVAL); \ offset += 4; \ } \ else { \ @@ -120,7 +131,7 @@ do { \ if (DONT_KNOW_OFFSETS) { \ while (*(int *)(CODE+offset) != subst) offset++; \ *(int *)(CODE+offset) = (int)(NEWVAL) - ((int)(CODE)+offset) - 4; \ - if (0) fprintf(stderr, "%s/%d: offset %d, new value: 0x%x\n", __FILE__, __LINE__, offset, (int)(NEWVAL) - ((int)(CODE)+offset) - 4); \ + FIXUPREL_PRINTF(offset, NEWVAL, CODE); \ offset += 4; \ } \ else { \ -- cgit v1.2.3