Skip to content

Commit

Permalink
Use fast_math matrix multiplication for culling and sw transform
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Mar 22, 2014
1 parent cbc46be commit bc12124
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
7 changes: 3 additions & 4 deletions GPU/Math3D.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
#include <cmath>
#include "Common/Common.h"

#include "math/fast/fast_matrix.h"

#if defined(_M_SSE)
#include <emmintrin.h>
#endif
Expand Down Expand Up @@ -828,10 +830,7 @@ inline void Norm3ByMatrix43(float vecOut[3], const float v[3], const float m[12]
}

inline void Matrix4ByMatrix4(float out[16], const float a[16], const float b[16]) {
Vec4ByMatrix44(out, a, b);
Vec4ByMatrix44(out + 4, a + 4, b);
Vec4ByMatrix44(out + 8, a + 8, b);
Vec4ByMatrix44(out + 12, a + 12, b);
fast_matrix_mul_4x4(out, b, a);
}

inline void ConvertMatrix4x3To4x4(float *m4x4, const float *m4x3) {
Expand Down
6 changes: 6 additions & 0 deletions UI/NativeApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
#include "gfx/texture.h"
#include "i18n/i18n.h"
#include "input/input_state.h"
#include "math/fast/fast_math.h"
#include "math/math_util.h"
#include "math/lin/matrix4x4.h"
#include "ui/ui.h"
Expand All @@ -56,6 +57,7 @@
#include "ui/view.h"
#include "util/text/utf8.h"

#include "Common/CPUDetect.h"
#include "Common/FileUtil.h"
#include "Common/LogManager.h"
#include "Core/Config.h"
Expand Down Expand Up @@ -211,6 +213,10 @@ void NativeInit(int argc, const char *argv[],
monstartup("ppsspp_jni.so");
#endif

#ifdef ANDROID
InitFastMath(cpu_info.bNEON);
#endif

bool skipLogo = false;
EnableFZ();
setlocale( LC_ALL, "C" );
Expand Down

0 comments on commit bc12124

Please sign in to comment.