Commit Graph

33 Commits

Author SHA1 Message Date
Brian Paul 50db812915 mesa: loosen small matrix determinant check
When computing a matrix inverse, if the determinant is too small we could hit
a divide by zero.  There's a check to prevent this (we basically give up on
computing the inverse and return the identity matrix.)  This patch loosens
this test to fix a lighting bug reported by Lars Henning Wendt.

v2: use abs(det) to handle negative values

NOTE: This is a candidate for the 8.0 branch.

Tested-by: Lars Henning Wendt <lars.henning.wendt@gris.tu-darmstadt.de>
2012-07-26 13:59:43 -06:00
Nicolas Kaiser bad10b961a math: remove duplicated includes
Remove duplicated includes.

Signed-off-by: Brian Paul <brianp@vmware.com>
2010-09-30 09:36:31 -06:00
Eric Anholt 165694ad65 mesa: Remove no-op wrappers around trig functions. 2010-05-13 13:02:09 -07:00
Jeff Smith fab1f07d6a Grammar and spelling fixes
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
2010-03-12 08:55:05 -07:00
Kristian Høgsberg 99ae9e8d7d Drop macro wrappers for the aligned memory functions 2010-02-19 13:30:22 -05:00
Brian Paul e197de56cd mesa: replace old MEMCPY macro with memcpy 2010-02-19 08:09:01 -07:00
Brian Paul ce461ffc5a mesa: only clear matrix MAT_DIRTY_INVERSE flag when we actually compute the inverse
If _math_matrix_analyse() got called before we allocated the inverse
matrix array we could lose the flag indicating that we needed to compute
the inverse.  This could happen with certain vertex shader cases.
2009-04-03 12:49:03 -06:00
Brian Paul 987aedd7dc mesa: move _mesa_transform_vector() from m_xform.c to m_matrix.c
m_xform.c is omitted from gallium builds but _mesa_transform_vector() is
still needed.
2009-02-12 09:23:46 -07:00
Brian Paul bbd287103d mesa: prefix a bunch of #include lines with "main/".
This is another step toward removing a whole bunch of -I flags from
the cc commands.  Still need to address driver code...
2008-09-18 12:26:54 -06:00
Brian Paul b3aefd1cfb additional wrapper updates, bug 4468 2005-09-19 20:12:32 +00:00
Brian Paul aa2069586d use mesa import wrappers, bug 4468 2005-09-16 18:14:24 +00:00
Brian Paul 049e320f46 Add a set of predicate functions for testing matrices instead of directly
testing the flags field.
Move definition of all the MAT_FLAGs into the m_matrix.c file since they're
now private.
2005-06-30 14:22:23 +00:00
Brian Paul 522ea42718 add MAT_DIRTY_FLAGS in _math_matrix_mul_floats(), (bug 2696) 2005-03-11 14:54:51 +00:00
Brian Paul 2dab997cb9 fix a bug in analyse_from_scratch() reported by Wes Bethel 2004-09-09 19:58:03 +00:00
Brian Paul e2e9dc221d bring in Keith's _math_matrix_ortho() compiler work-around 2004-02-05 15:05:09 +00:00
Keith Whitwell 6dc8557500 Merge Jose's documentation and core Mesa changes from embedded branch 2003-07-17 13:43:59 +00:00
Ian Romanick 9ac51f57ef Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything. 2003-06-05 00:50:18 +00:00
Brian Paul 27558a160a Killed mmath.[ch]. Moved low-level functions/assembly code into imports.[ch]
Moved type conversion and interpolation macros into macros.h
Updated all the files that used to include mmath.h
2003-03-01 01:50:20 +00:00
Brian Paul 1e091f48f0 fix typo in rotation code (bug 659677) 2003-01-08 16:42:47 +00:00
Brian Paul 3c63452e64 Header file clean-up:
1. Remove all.h and PC_HEADER junk.
2. Rolled mem.c and mem.h into imports.c and imports.h
3. Include imports.h instead of mem.h
Restore _mesa_create/initialize_context() to be like they were in 4.0.4
New wrappers for a few std C functions: _mesa_atoi(), _mesa_strstr(), etc.
2002-10-24 23:57:19 +00:00
Brian Paul 4991d0f9f3 optimizations to _math_matrix_rotate() (Rudolf Opalla) 2002-09-12 16:26:04 +00:00
Brian Paul 4e9676fb13 Applied Matt Sealey's patch to remove/isolate all stdio.h function calls.
Instead of mstdio.[ch], use imports.[ch] to isolate these functions.
2002-06-29 19:48:15 +00:00
Brian Paul a68b8dfd76 Use invert_matrix_general() instead of invert_matrix_perspective() because
the later fails for some projection matrices (ala Vis5D with Chromium).
2002-03-29 17:18:08 +00:00
Brian Paul 30f51ae067 Replace old matrix stacks with new code based on struct matrix_stack.
Moved vertex program hash table into shared context state.
Implemented reference counting for vertex programs.
Replaced tnl "ProjectedClip" with "Ndc" (normalized device coordinates).
2001-12-18 04:06:44 +00:00
Karl Schultz 7b9fe820a3 more compiler warning fixes 2001-09-18 23:06:14 +00:00
Gareth Hughes 22144ab755 Consistent copyright info (version number, date) across all files. 2001-03-12 00:48:37 +00:00
Brian Paul b51b0a847d fixed a bunch of g++ warnings/errors. Compiling with g++ can help find lots of potential problems 2001-03-07 05:06:11 +00:00
Brian Paul d8bc5a9eba replaced frustrum with frustum 2001-02-05 18:48:52 +00:00
Keith Whitwell f4b02d1a26 various compilation/warning fixes 2001-01-05 05:31:42 +00:00
Keith Whitwell ad2ac216fa Support for swappable t&l modules, including an example one in the FX
driver (enable with FX_ALLOW_VTXFMT=t).
2000-11-24 10:25:05 +00:00
Brian Paul ce2733b7cc removed #include <tgmath.h> 2000-11-20 15:16:33 +00:00
Jon Taylor 912d3a04c1 * Auto* build fixes
* Added missing includes to math/*
2000-11-18 08:10:21 +00:00
Keith Whitwell 23caf20169 Move the transform and lighting code to two new directories
math:  Provides basic matrix and vector functionality that
               might be useful to multiple software t&l
	       implementations, and is used by core mesa to
	       manage the Model, Project, etc matrices.

	tnl:   The real transform & lighting code from core mesa,
	       including everything from glVertex3f through vertex
	       buffer handling, transformation, clipping, lighting
	       and handoff to a driver for rasterization.

The interfaces of these can be further tightened up, but the basic
splitting up of state and code move is done.
2000-11-16 21:05:34 +00:00