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