summaryrefslogtreecommitdiffstats
path: root/src/mesa/math/m_matrix.c
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Mark Identity as constIan Romanick2016-01-111-1/+1
| | | | | | | | | | | | | | | I was going to send this as review for dce1e1a8, but I missed that window. This saves 64 bytes of unshared data and prelaces it with 96 bytes shared text. My guess is that some of the calls to memcpy get optimized to something else. text data bss dec hex filename 7847613 220208 27432 8095253 7b8615 i965_dri.so before 7847709 220144 27432 8095285 7b8635 i965_dri.so after Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: Brian Paul <brianp@vmware.com>
* mesa: minor clean-up of some memcpy/sizeof() calls in m_matrix.cBrian Paul2016-01-051-7/+7
| | | | Reviewed-by: Charmaine Lee <charmainel@vmware.com>
* mesa/math: Avoid double promotion.Matt Turner2015-07-291-35/+35
| | | | Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
* mesa: Use floats for viewport bounds.Matt Turner2015-07-291-2/+2
| | | | | | | | | | | | | | | | | | ARB_viewport_array specifies that DEPTH_RANGE consists of double- precision parameters (corresponding commit d4dc35987), and a preparatory commit (6340e609a) added _mesa_get_viewport_xform() which returned double-precision scale[3] and translate[3] vectors, even though X, Y, Width, and Height were still floats. All users of _mesa_get_viewport_xform() immediately convert the double scale and translation vectors into floats (which were floats originally, but were converted to doubles in _mesa_get_viewport_xform(), sigh). i965 at least cannot consume doubles (see SF_CLIP_VIEWPORT). If we want to pass doubles to hardware, we should have a different function that does that. Acked-by: Mathias Froehlich <Mathias.Froehlich@web.de>
* Fix a few typosZoë Blade2015-04-271-1/+1
| | | | Reviewed-by: Francisco Jerez <currojerez@riseup.net>
* mesa: remove DEG2RAD macroBrian Paul2015-02-241-2/+2
| | | | Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa: replace FABSF with fabsfBrian Paul2015-02-241-8/+9
| | | | Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa: Refactor viewport transform computation.Mathias Fröhlich2014-10-241-9/+8
| | | | | | | | | | This is for preparation of ARB_clip_control. v3: Add comments. Reviewed-by: Brian Paul <brianp@vmware.com> Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
* mesa: Converty gl_viewport_attrib::X, ::Y, ::Width, and ::Height to floatCourtney Goeltzenleuchter2014-01-201-3/+4
| | | | | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Also make meta's save_state::ViewportX, ::ViewportY, ::ViewportW, and ::ViewportH to match gl_viewport_attrib. Signed-off-by: Courtney Goeltzenleuchter <courtney@LunarG.com> Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: Convert gl_viewport_attrib::Near and ::Far to doubleCourtney Goeltzenleuchter2014-01-201-3/+3
| | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: modified _mesa_align_free() to accept NULL pointerSiavash Eliasi2013-12-041-8/+5
| | | | | | | | | | | So that it acts like ordinary free(). This lets us remove a bunch of if statements where the function is called. v2: - Avoiding compile error on MSVC and possible warnings on other compilers. - Added comment regards passing NULL pointer being safe. Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-051-1/+0
| | | | Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-231-3/+4
| | | | | | | | | | | | | | The previous commit introduced extra words, breaking the formatting. This text transformation was done automatically via the following shell command: $ git grep 'THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY' | sed 's/:.*$//' | xargs -I {} sh -c 'vim -e -s {} < vimscript where 'vimscript' is a file containing: /THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY/;/\*\// !fmt -w 78 -p ' * ' :wq Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | This brings the license text in line with the MIT License as published on the Open Source Initiative website: http://opensource.org/licenses/mit-license.php Generated automatically be the following shell command: $ git grep 'THE AUTHORS BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/THE AUTHORS/THE AUTHORS OR COPYRIGHT HOLDERS/' {} This introduces some wrapping issues, to be fixed in the next commit. Reviewed-by: Brian Paul <brianp@vmware.com>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-231-1/+1
| | | | | | | | | | | | | | | | Generated automatically be the following shell command: $ git grep 'BRIAN PAUL BE LIABLE' | sed 's/:.*$//g' | xargs -I '{}' \ sed -i 's/BRIAN PAUL/THE AUTHORS/' {} The intention here is to protect all authors, not just Brian Paul. I believe that was already the sensible interpretation, but spelling it out is probably better. More practically, it also prevents people from accidentally copy & pasting the license into a new file which says Brian is not liable when he isn't even one of the authors. Reviewed-by: Brian Paul <brianp@vmware.com>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch has been generated by the following Coccinelle semantic patch: // Don't cast the return value of malloc/realloc. // // Casting the return value of malloc/realloc only stands to hide // errors. @@ type T; expression E1, E2; @@ - (T) ( _mesa_align_calloc(E1, E2) | _mesa_align_malloc(E1, E2) | calloc(E1, E2) | malloc(E1) | realloc(E1, E2) )
* mesa: remove SQRTF, use sqrtf. Convert INV_SQRT() to inline function.Brian Paul2012-09-031-1/+1
| | | | | | | We were already defining sqrtf where we don't have the C99 version. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
* mesa: fix _math_matrix_copy(), againBrian Paul2012-07-301-1/+1
| | | | | The matrix is 16 GLfloats in size. Since from->inv is just a pointer (not an array), sizeof(*from->inv) wasn't right.
* mesa: Fix wrong sizeof argument in _math_matrix_copy.Vinson Lee2012-07-301-1/+1
| | | | | | | Fixes Coverity wrong sizeof argument defect. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: remove obsolete matrix commentBrian Paul2012-07-261-1/+0
|
* mesa: fix comment typo: s/pointer/point/Brian Paul2012-07-261-1/+1
|
* mesa: remove _math_matrix_alloc_inv()Brian Paul2012-07-261-40/+11
| | | | | | | Always allocate space for the inverse matrix in _math_matrix_ctr() since we were always calling _math_matrix_alloc_inv() anyway. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* mesa: loosen small matrix determinant checkBrian Paul2012-07-261-1/+1
| | | | | | | | | | | | | 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>
* math: remove duplicated includesNicolas Kaiser2010-09-301-1/+0
| | | | | | Remove duplicated includes. Signed-off-by: Brian Paul <brianp@vmware.com>
* mesa: Remove no-op wrappers around trig functions.Eric Anholt2010-05-131-2/+2
|
* Grammar and spelling fixesJeff Smith2010-03-121-1/+1
| | | | | Signed-off-by: Jeff Smith <whydoubt@yahoo.com> Signed-off-by: Brian Paul <brianp@vmware.com>
* Drop macro wrappers for the aligned memory functionsKristian Høgsberg2010-02-191-4/+4
|
* mesa: replace old MEMCPY macro with memcpyBrian Paul2010-02-191-14/+14
|
* mesa: only clear matrix MAT_DIRTY_INVERSE flag when we actually compute the ↵Brian Paul2009-04-031-3/+2
| | | | | | | | 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.
* mesa: move _mesa_transform_vector() from m_xform.c to m_matrix.cBrian Paul2009-02-121-0/+21
| | | | | m_xform.c is omitted from gallium builds but _mesa_transform_vector() is still needed.
* mesa: prefix a bunch of #include lines with "main/".Brian Paul2008-09-181-4/+4
| | | | | This is another step toward removing a whole bunch of -I flags from the cc commands. Still need to address driver code...
* additional wrapper updates, bug 4468Brian Paul2005-09-191-7/+7
|
* use mesa import wrappers, bug 4468Brian Paul2005-09-161-2/+2
|
* Add a set of predicate functions for testing matrices instead of directlyBrian Paul2005-06-301-0/+134
| | | | | | testing the flags field. Move definition of all the MAT_FLAGs into the m_matrix.c file since they're now private.
* add MAT_DIRTY_FLAGS in _math_matrix_mul_floats(), (bug 2696)Brian Paul2005-03-111-3/+4
|
* fix a bug in analyse_from_scratch() reported by Wes BethelBrian Paul2004-09-091-12/+13
|
* bring in Keith's _math_matrix_ortho() compiler work-aroundBrian Paul2004-02-051-15/+21
|
* Merge Jose's documentation and core Mesa changes from embedded branchKeith Whitwell2003-07-171-130/+431
|
* Removed all RCS / CVS tags (Id, Header, Date, etc.) from everything.Ian Romanick2003-06-051-1/+0
|
* Killed mmath.[ch]. Moved low-level functions/assembly code into imports.[ch]Brian Paul2003-03-011-3/+2
| | | | | Moved type conversion and interpolation macros into macros.h Updated all the files that used to include mmath.h
* fix typo in rotation code (bug 659677)Brian Paul2003-01-081-4/+4
|
* Header file clean-up:Brian Paul2002-10-241-4/+2
| | | | | | | | 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.
* optimizations to _math_matrix_rotate() (Rudolf Opalla)Brian Paul2002-09-121-97/+155
|
* Applied Matt Sealey's patch to remove/isolate all stdio.h function calls.Brian Paul2002-06-291-6/+10
| | | | Instead of mstdio.[ch], use imports.[ch] to isolate these functions.
* Use invert_matrix_general() instead of invert_matrix_perspective() becauseBrian Paul2002-03-291-3/+10
| | | | the later fails for some projection matrices (ala Vis5D with Chromium).
* Replace old matrix stacks with new code based on struct matrix_stack.Brian Paul2001-12-181-13/+13
| | | | | | Moved vertex program hash table into shared context state. Implemented reference counting for vertex programs. Replaced tnl "ProjectedClip" with "Ndc" (normalized device coordinates).
* more compiler warning fixesKarl Schultz2001-09-181-40/+40
|
* Consistent copyright info (version number, date) across all files.Gareth Hughes2001-03-121-86/+86
|
* fixed a bunch of g++ warnings/errors. Compiling with g++ can help find lots ↵Brian Paul2001-03-071-6/+6
| | | | of potential problems
* replaced frustrum with frustumBrian Paul2001-02-051-6/+6
|