mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-30 16:58:40 -04:00
LINMATH_VECTORIZE -> LINMATH_ALIGN
This commit is contained in:
parent
56fb33bf00
commit
787742c93e
@ -321,15 +321,15 @@
|
||||
// If this is provided, Panda will use this library as the fundamental
|
||||
// implementation of its own linmath library; otherwise, it will use
|
||||
// its own internal implementation. The primary advantage of using
|
||||
// Eigen is SSE2 support, which is only activated if LINMATH_VECTORIZE
|
||||
// is also enabled. (However, activating LINMATH_VECTORIZE does
|
||||
// Eigen is SSE2 support, which is only activated if LINMATH_ALIGN
|
||||
// is also enabled. (However, activating LINMATH_ALIGN does
|
||||
// constrain most objects in Panda to 16-byte alignment, which could
|
||||
// impact memory usage on very-low-memory platforms.) Currently
|
||||
// experimental.
|
||||
#define EIGEN_IPATH
|
||||
#define EIGEN_CFLAGS
|
||||
#defer HAVE_EIGEN $[isdir $[EIGEN_IPATH]/Eigen]
|
||||
#define LINMATH_VECTORIZE 1
|
||||
#define LINMATH_ALIGN 1
|
||||
|
||||
// Is Python installed, and should Python interfaces be generated? If
|
||||
// Python is installed, which directory is it in?
|
||||
|
@ -13,7 +13,7 @@
|
||||
#print Configuring support for the following optional third-party packages:
|
||||
#if $[HAVE_EIGEN]
|
||||
#print + Eigen linear algebra library
|
||||
#if $[LINMATH_VECTORIZE]
|
||||
#if $[LINMATH_ALIGN]
|
||||
#print + (vectorization enabled in build)
|
||||
#else
|
||||
#print - (vectorization NOT enabled in build)
|
||||
@ -274,7 +274,7 @@ $[cdefine NDEBUG]
|
||||
|
||||
/* Define if we have Eigen available. */
|
||||
$[cdefine HAVE_EIGEN]
|
||||
$[cdefine LINMATH_VECTORIZE]
|
||||
$[cdefine LINMATH_ALIGN]
|
||||
|
||||
/* Define if we have Python installed. */
|
||||
$[cdefine HAVE_PYTHON]
|
||||
|
@ -449,7 +449,7 @@ DEFAULT_MMAP_THRESHOLD default: 256K
|
||||
|
||||
*/
|
||||
|
||||
#ifdef LINMATH_VECTORIZE
|
||||
#ifdef LINMATH_ALIGN
|
||||
// drose: We require 16-byte alignment of certain structures, to
|
||||
// support SSE2. We don't strictly have to align *everything*, but
|
||||
// it's just easier to do so.
|
||||
|
@ -110,8 +110,8 @@
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_EIGEN
|
||||
// If we don't have the Eigen library, don't define LINMATH_VECTORIZE.
|
||||
#undef LINMATH_VECTORIZE
|
||||
// If we don't have the Eigen library, don't define LINMATH_ALIGN.
|
||||
#undef LINMATH_ALIGN
|
||||
#endif
|
||||
|
||||
#include "dtoolsymbols.h"
|
||||
|
@ -51,7 +51,7 @@ dec_heap(size_t size) {
|
||||
////////////////////////////////////////////////////////////////////
|
||||
INLINE size_t MemoryHook::
|
||||
get_memory_alignment() {
|
||||
#ifdef LINMATH_VECTORIZE
|
||||
#ifdef LINMATH_ALIGN
|
||||
// We require 16-byte alignment of certain structures, to support
|
||||
// SSE2. We don't strictly have to align *everything*, but it's just
|
||||
// easier to do so.
|
||||
|
@ -36,7 +36,7 @@ class DeletedBufferChain;
|
||||
// alignment.
|
||||
#undef MEMORY_HOOK_DO_ALIGN
|
||||
|
||||
#elif !defined(LINMATH_VECTORIZE)
|
||||
#elif !defined(LINMATH_ALIGN)
|
||||
// We don't actually require any special memory-alignment beyond what
|
||||
// the underlying implementation is likely to provide anyway.
|
||||
#undef MEMORY_HOOK_DO_ALIGN
|
||||
|
@ -749,7 +749,7 @@ extern "C" {
|
||||
are optimized for the case of 8-byte alignment.
|
||||
*/
|
||||
|
||||
#ifdef LINMATH_VECTORIZE
|
||||
#ifdef LINMATH_ALIGN
|
||||
// drose: We require 16-byte alignment of certain structures, to
|
||||
// support SSE2. We don't strictly have to align *everything*, but
|
||||
// it's just easier to do so.
|
||||
|
@ -186,7 +186,7 @@ ConfigVariableInt egg_vertex_max_num_joints
|
||||
|
||||
ConfigVariableBool egg_vertex_animation_align_16
|
||||
("egg-vertex-animation-align-16",
|
||||
#ifdef LINMATH_VECTORIZE
|
||||
#ifdef LINMATH_ALIGN
|
||||
true,
|
||||
#else
|
||||
false,
|
||||
|
@ -1939,7 +1939,7 @@ table_xform_vector3f(unsigned char *datat, size_t num_rows, size_t stride,
|
||||
void GeomVertexData::
|
||||
table_xform_vecbase4f(unsigned char *datat, size_t num_rows, size_t stride,
|
||||
const LMatrix4f &matf) {
|
||||
#if defined(HAVE_EIGEN) && defined(LINMATH_VECTORIZE)
|
||||
#if defined(HAVE_EIGEN) && defined(LINMATH_ALIGN)
|
||||
// Check if the table is unaligned. If it is, we can't use the
|
||||
// LVecBase4f object directly, which assumes 16-byte alignment.
|
||||
if (((size_t)datat & 0xf) != 0 || (stride & 0xf) != 0) {
|
||||
|
@ -47,22 +47,22 @@ private:
|
||||
|
||||
// Now, do we actually use LSimpleMatrix, or do we use Eigen::Matrix?
|
||||
#ifdef HAVE_EIGEN
|
||||
#ifdef LINMATH_VECTORIZE
|
||||
#ifdef LINMATH_ALIGN
|
||||
#define LINMATH_MATRIX(FloatType, NumRows, NumCols) Eigen::Matrix<FloatType, NumRows, NumCols, Eigen::RowMajor>
|
||||
#else // LINMATH_VECTORIZE
|
||||
#else // LINMATH_ALIGN
|
||||
#define LINMATH_MATRIX(FloatType, NumRows, NumCols) Eigen::Matrix<FloatType, NumRows, NumCols, Eigen::DontAlign | Eigen::RowMajor>
|
||||
#endif // LINMATH_VECTORIZE
|
||||
#endif // LINMATH_ALIGN
|
||||
|
||||
#else // HAVE_EIGEN
|
||||
#define LINMATH_MATRIX(FloatType, NumRows, NumCols) LSimpleMatrix<FloatType, NumRows, NumCols>
|
||||
#endif // HAVE_EIGEN
|
||||
|
||||
// This is as good a place as any to define this alignment macro.
|
||||
#ifdef LINMATH_VECTORIZE
|
||||
#ifdef LINMATH_ALIGN
|
||||
#define LINMATH_ALIGN ALIGN_16BYTE
|
||||
#else
|
||||
#define LINMATH_ALIGN
|
||||
#endif // LINMATH_VECTORIZE
|
||||
#endif // LINMATH_ALIGN
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user