aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/math
Commit message (Collapse)AuthorAgeFilesLines
* mesa: Add function to calculate an orthographic projectionIan Romanick2020-05-142-10/+38
| | | | | | | | | | | | | Unlike the existing _math_matrix_ortho, the new _math_float_ortho function just stores the calculated matrix in an array of floats. It does not multiply the new matrix with data already stored. text data bss dec hex filename 12243486 1344936 1290748 14879170 e309c2 before/lib64/dri/i965_dri.so 12243510 1344936 1290748 14879194 e309da after/lib64/dri/i965_dri.so Reviewed-by: Jason Ekstrand <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/856>
* remove final imports.h and imports.c bitsDylan Baker2020-04-211-1/+1
| | | | | | | | | | | This moves the fi_types to a new mesa_private.h and removes the imports.c file. The vast majority of this patch is just removing pound includes of imports.h and fixing up the recursive includes. Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* replace imports memory functions with utils memory functionsDylan Baker2020-04-214-44/+44
| | | | | | | Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Matt Turner <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3024>
* Move compiler.h and imports.h/c from src/mesa/main into src/utilMarek Olšák2020-03-276-6/+6
| | | | | Reviewed-by: Timothy Arceri <[email protected] Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4324>
* mesa/math: delete duplicate extern symbolEric Engestrom2019-10-161-2/+0
| | | | | | | | It's already defined in `m_debug_util.h`, along with an explanation of what it is and how to use it. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa/math: delete leftover... from 18 years ago (!)Eric Engestrom2019-10-161-4/+0
| | | | | | | Left over from 0a79baf1bff93718e50a ("remove dead vertex assembly"). Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: add stddef include in preparation for dropping p_compiler.hLionel Landwerlin2019-08-092-0/+2
| | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]> Acked-by: Eric Engestrom <[email protected]>
* mesa: Replace gen_matypes with a simple header for V4F/mat layout.Eric Anholt2019-07-014-9/+71
| | | | | | | | We can greatly simplify our builds by just hardcoding GLvector4f and GLmatrix's layouts. Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* mesa: include mtypes.h lessMarek Olšák2018-04-121-0/+1
| | | | | | | | | | - remove mtypes.h from most header files - add main/menums.h for often used definitions - remove main/core.h v2: fix radv build Reviewed-by: Brian Paul <[email protected]>
* tree-wide: remove trailing backslashEric Engestrom2017-06-071-1/+1
| | | | | | | | | Simple search for a backslash followed by two newlines. If one of the newlines were to be removed, this would cause issues, so let's just remove these trailing backslashes. Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Ian Romanick <[email protected]>
* mesa: Remove every double semi-colonJakob Sinclair2016-04-261-1/+1
| | | | | | Signed-off-by: Jakob Sinclair <[email protected]> Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* 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 <[email protected]> Reviewed-by: Ilia Mirkin <[email protected]> Cc: Brian Paul <[email protected]>
* mesa: minor clean-up of some memcpy/sizeof() calls in m_matrix.cBrian Paul2016-01-051-7/+7
| | | | Reviewed-by: Charmaine Lee <[email protected]>
* mesa/math: Avoid double promotion.Matt Turner2015-07-293-46/+46
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* mesa: Use floats for viewport bounds.Matt Turner2015-07-292-4/+4
| | | | | | | | | | | | | | | | | | 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 <[email protected]>
* doxygen: Link GLvector4f struct members properly, avoiding invalid XML/HTML ↵Rhys Kidd2015-07-231-1/+1
| | | | | | | | warning Signed-off-by: Rhys Kidd <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* doxygen: Correct grammatical typo in math/m_vector.hRhys Kidd2015-07-231-1/+1
| | | | | | Signed-off-by: Rhys Kidd <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* Fix a few typosZoë Blade2015-04-271-1/+1
| | | | Reviewed-by: Francisco Jerez <[email protected]>
* mesa: remove _XFORMAPIBrian Paul2015-03-124-64/+56
| | | | Reviewed-by: Ian Romanick <[email protected]>
* mesa: include stdio.h where neededBrian Paul2015-03-051-0/+1
| | | | | | | Instead of relying on glapi.h or some other header to provide it. Acked-by: Matt Turner <[email protected]> Reviewed-by: José Fonseca <[email protected]>
* mesa: trim down includes of compiler.hBrian Paul2015-03-021-1/+0
| | | | | | | In some cases, glheader.h is the right #include. Also remove some instances of struct _glapi_table declarations. Acked-by: Matt Turner <[email protected]>
* mesa: remove _NORMAPI, _NORMAPIP macrosBrian Paul2015-02-281-1/+1
| | | | | | Was only used in one place. Use equivalent _XFORMAPIP there instead. Reviewed-by: Ian Romanick <[email protected]>
* mesa: remove DEG2RAD macroBrian Paul2015-02-241-2/+2
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: remove INV_SQRTF() macroBrian Paul2015-02-243-5/+7
| | | | | Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* mesa: replace FABSF with fabsfBrian Paul2015-02-241-8/+9
| | | | Reviewed-by: Matt Turner <[email protected]>
* mesa: replace FREXPF, LDEXPF with frexpf, ldexpfBrian Paul2015-02-241-3/+6
| | | | | | Start getting rid of some imports.h macros. Use the c99 functions instead. Reviewed-by: Matt Turner <[email protected]>
* mesa: Use assert() instead of ASSERT wrapper.Matt Turner2015-02-232-6/+6
| | | | Acked-by: Eric Anholt <[email protected]>
* mesa: Remove CHECK macro.Matt Turner2015-02-232-52/+30
| | | | | | | There's some commentary about how it's defined by other "modules", and maybe that was true in 2000 when the code was added. Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove unused _math_trans_4chan()Brian Paul2015-02-192-31/+0
| | | | | Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* mesa: Refactor viewport transform computation.Mathias Fröhlich2014-10-242-11/+10
| | | | | | | | | | This is for preparation of ARB_clip_control. v3: Add comments. Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Mathias Froehlich <[email protected]>
* mesa: Drop _mesa_getenv() wrapper.Matt Turner2014-09-243-3/+3
| | | | | | Reviewed-by: Ian Romanick <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* mesa: Converty gl_viewport_attrib::X, ::Y, ::Width, and ::Height to floatCourtney Goeltzenleuchter2014-01-202-4/+5
| | | | | | | | | | 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 <[email protected]> Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* mesa: Convert gl_viewport_attrib::Near and ::Far to doubleCourtney Goeltzenleuchter2014-01-202-4/+4
| | | | | | | v4: Split out from a single megapatch. Suggested by Ken. Signed-off-by: Ian Romanick <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* 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 <[email protected]>
* mesa: remove macintosh preprocessor stuffBrian Paul2013-11-041-6/+6
| | | | | | IIRC, this is MacOS 9.x stuff. Reviewed-by: Matt Turner <[email protected]>
* mesa: remove Watcom C supportBrian Paul2013-11-041-2/+0
| | | | Reviewed-by: Eric Anholt <[email protected]>
* mesa: remove outdated version lines in commentsRico Schüller2013-06-0521-21/+0
| | | | Signed-off-by: Brian Paul <[email protected]>
* mesa: Restore 78-column wrapping of license text in C-style comments.Kenneth Graunke2013-04-2321-63/+84
| | | | | | | | | | | | | | 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 <[email protected]>
* mesa: Add "OR COPYRIGHT HOLDERS" to license text disclaiming liability.Kenneth Graunke2013-04-2321-21/+21
| | | | | | | | | | | | | | | 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 <[email protected]>
* mesa: Change "BRIAN PAUL" to "THE AUTHORS" in license text.Kenneth Graunke2013-04-2321-21/+21
| | | | | | | | | | | | | | | | 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 <[email protected]>
* Remove OpenVMS supportMatt Turner2012-11-161-47/+0
| | | | | | | | | | Not maintained since 2008. Doubtful that it's worked in quite a while. Also see commit 32ac8cb05 which removed VMS stuff from Makefile in 2009. Cc: Jouk Jansen <[email protected]> Reviewed-by: Brian Paul <[email protected]> Signed-off-by: Andreas Boll <[email protected]>
* Don't cast the return value of malloc/reallocMatt Turner2012-09-053-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: s/CONST/const/ in math/ filesBrian Paul2012-09-054-42/+42
| | | | | | The CONST macro hack will go away soon. Reviewed-by: Matt Turner <[email protected]>
* 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 <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* 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 <[email protected]> Signed-off-by: Brian Paul <[email protected]>
* 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-262-44/+12
| | | | | | | 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 <[email protected]>
* 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 <[email protected]>