From 882cd6c839e56a3eceb8edf62f83893f6b531d35 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 22 May 2009 07:30:05 -0600 Subject: mesa: remove MAX_VERTEX_PROGRAM_ATTRIBS Use MAX_VERTEX_GENERIC_ATTRIBS instead. No need for two #defines for the same quantity. --- src/mesa/tnl/t_vb_program.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/mesa/tnl/t_vb_program.c') diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index 1795f62c32..c35eaf1538 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -207,7 +207,7 @@ init_machine(GLcontext *ctx, struct gl_program_machine *machine) { /* Input registers get initialized from the current vertex attribs */ MEMCPY(machine->VertAttribs, ctx->Current.Attrib, - MAX_VERTEX_PROGRAM_ATTRIBS * 4 * sizeof(GLfloat)); + MAX_VERTEX_GENERIC_ATTRIBS * 4 * sizeof(GLfloat)); if (ctx->VertexProgram._Current->IsNVProgram) { GLuint i; -- cgit v1.2.3 From 4f4280b4356210e503aa5756db0a13dfb8253661 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 3 Jun 2009 15:36:24 -0600 Subject: tnl: add some floating point sanity checks (disabled) --- src/mesa/tnl/t_vb_program.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'src/mesa/tnl/t_vb_program.c') diff --git a/src/mesa/tnl/t_vb_program.c b/src/mesa/tnl/t_vb_program.c index c35eaf1538..66c5e13729 100644 --- a/src/mesa/tnl/t_vb_program.c +++ b/src/mesa/tnl/t_vb_program.c @@ -1,8 +1,9 @@ /* * Mesa 3-D graphics library - * Version: 7.1 + * Version: 7.6 * - * Copyright (C) 1999-2007 Brian Paul All Rights Reserved. + * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. + * Copyright (C) 2009 VMware, Inc. 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"), @@ -46,6 +47,16 @@ #include "tnl/t_pipeline.h" +#ifdef NAN_CHECK +/** Check for NaNs and very large values */ +static INLINE void +check_float(float x) +{ + assert(!IS_INF_OR_NAN(x)); + assert(1.0e-15 <= x && x <= 1.0e15); +} +#endif + /*! * Private storage for the vertex program pipeline stage. @@ -351,6 +362,12 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) const GLuint size = VB->AttribPtr[attr]->size; const GLuint stride = VB->AttribPtr[attr]->stride; const GLfloat *data = (GLfloat *) (ptr + stride * i); +#ifdef NAN_CHECK + check_float(data[0]); + check_float(data[1]); + check_float(data[2]); + check_float(data[3]); +#endif COPY_CLEAN_4V(machine.VertAttribs[attr], size, data); } } @@ -361,6 +378,12 @@ run_vp( GLcontext *ctx, struct tnl_pipeline_stage *stage ) /* copy the output registers into the VB->attribs arrays */ for (j = 0; j < numOutputs; j++) { const GLuint attr = outputs[j]; +#ifdef NAN_CHECK + check_float(machine.Outputs[attr][0]); + check_float(machine.Outputs[attr][1]); + check_float(machine.Outputs[attr][2]); + check_float(machine.Outputs[attr][3]); +#endif COPY_4V(store->results[attr].data[i], machine.Outputs[attr]); } #if 0 -- cgit v1.2.3