Add conditional test includes and fix inconsistent file naming
This commit is contained in:
parent
bdd44757ec
commit
9559815380
@ -14,9 +14,10 @@ message("Compiling MTL for ${CMAKE_SYSTEM_PROCESSOR}")
|
|||||||
file(GLOB mtl_sources_common LIST_DIRECTORIES false CONFIGURE_DEPENDS src/common/*.cpp src/common/*.c src/common/*.s)
|
file(GLOB mtl_sources_common LIST_DIRECTORIES false CONFIGURE_DEPENDS src/common/*.cpp src/common/*.c src/common/*.s)
|
||||||
file(GLOB mtl_sources_armv4t LIST_DIRECTORIES false CONFIGURE_DEPENDS src/armv4t/*.cpp src/armv4t/*.c src/armv4t/*.s)
|
file(GLOB mtl_sources_armv4t LIST_DIRECTORIES false CONFIGURE_DEPENDS src/armv4t/*.cpp src/armv4t/*.c src/armv4t/*.s)
|
||||||
file(GLOB mtl_sources_gba LIST_DIRECTORIES false CONFIGURE_DEPENDS src/gba/*.cpp src/gba/*.c src/gba/*.s)
|
file(GLOB mtl_sources_gba LIST_DIRECTORIES false CONFIGURE_DEPENDS src/gba/*.cpp src/gba/*.c src/gba/*.s)
|
||||||
file(GLOB mtl_sources_test LIST_DIRECTORIES false CONFIGURE_DEPENDS src/tests/*.cpp)
|
file(GLOB mtl_sources_test LIST_DIRECTORIES false CONFIGURE_DEPENDS src/test/*.cpp)
|
||||||
|
|
||||||
set(mtl_include_common "include")
|
set(mtl_include_common "include")
|
||||||
|
set(mtl_include_test "include/test")
|
||||||
set(mtl_include_gba "include/gba")
|
set(mtl_include_gba "include/gba")
|
||||||
set(mtl_include_armv4t "include/armv4t")
|
set(mtl_include_armv4t "include/armv4t")
|
||||||
|
|
||||||
@ -46,6 +47,7 @@ if (BUILD_TESTS STREQUAL "ON")
|
|||||||
add_library(${PROJECT_NAME}_test OBJECT)
|
add_library(${PROJECT_NAME}_test OBJECT)
|
||||||
target_sources(${PROJECT_NAME}_test PRIVATE "${mtl_sources_test}")
|
target_sources(${PROJECT_NAME}_test PRIVATE "${mtl_sources_test}")
|
||||||
target_include_directories(${PROJECT_NAME}_test PUBLIC "${mtl_include_common}")
|
target_include_directories(${PROJECT_NAME}_test PUBLIC "${mtl_include_common}")
|
||||||
|
target_include_directories(${PROJECT_NAME}_test PUBLIC "${mtl_include_test}")
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_test)
|
target_link_libraries(${PROJECT_NAME} PUBLIC ${PROJECT_NAME}_test)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
#include "mtl/tests/fixed.hpp"
|
#include "mtl/test/fixed.hpp"
|
||||||
|
|
||||||
#include "mtl/target.hpp"
|
#include "mtl/target.hpp"
|
||||||
#include "mtl/fixed.hpp"
|
#include "mtl/fixed.hpp"
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "mtl/tests/mat.hpp"
|
#include "mtl/test/mat.hpp"
|
||||||
|
|
||||||
#include "mtl/target.hpp"
|
#include "mtl/target.hpp"
|
||||||
#include "mtl/mat.hpp"
|
#include "mtl/mat.hpp"
|
||||||
@ -398,7 +398,7 @@ bool mat_suite::projection_build_m4() {
|
|||||||
NOINLINE GBA_IWRAM ARM_MODE
|
NOINLINE GBA_IWRAM ARM_MODE
|
||||||
mat<4, 4> operator()(vec4 b) {
|
mat<4, 4> operator()(vec4 b) {
|
||||||
start_timer();
|
start_timer();
|
||||||
mat<4, 4> r = b * b.transpose() / b.magnitude_sqr();
|
mat<4, 4> r = b * b.transpose() * (fixed(64) / b.magnitude_sqr()) * fixed(1.0 / 64.0);
|
||||||
end_timer();
|
end_timer();
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
@ -424,7 +424,7 @@ bool mat_suite::projection_calc_m4() {
|
|||||||
vec4 a(8, 3, 7, 0);
|
vec4 a(8, 3, 7, 0);
|
||||||
vec4 b(-3, 4, 14, 0);
|
vec4 b(-3, 4, 14, 0);
|
||||||
|
|
||||||
mat<4, 4> A = b * b.transpose() / b.magnitude_sqr();
|
mat<4, 4> A = b * b.transpose() * (fixed(64) / b.magnitude_sqr()) * fixed(1.0 / 64.0);
|
||||||
|
|
||||||
vec4 c = f(A, a);
|
vec4 c = f(A, a);
|
||||||
|
|
||||||
@ -1,4 +1,4 @@
|
|||||||
#include "mtl/tests/vec.hpp"
|
#include "mtl/test/vec.hpp"
|
||||||
|
|
||||||
#include "mtl/target.hpp"
|
#include "mtl/target.hpp"
|
||||||
#include "mtl/vec.hpp"
|
#include "mtl/vec.hpp"
|
||||||
Loading…
x
Reference in New Issue
Block a user