Fixed DISABLE_SSE config flag in CMakelists. Added <algorithm> to vectors.h, <cstdint> to hw_collision.cpp

Made include statement case-compatible for Linux
This commit is contained in:
deviant-syndrome 2023-12-23 16:09:52 +02:00 committed by Magnus Norddahl
parent 38cdc880d1
commit 08f280b54a
7 changed files with 11 additions and 9 deletions

View file

@ -135,7 +135,7 @@ if(${TARGET_ARCHITECTURE} MATCHES "x86_64")
set_source_files_properties(src/nodebuilder/nodebuild_classify_sse1.cpp PROPERTIES COMPILE_FLAGS "${SSE1_ENABLE}") set_source_files_properties(src/nodebuilder/nodebuild_classify_sse1.cpp PROPERTIES COMPILE_FLAGS "${SSE1_ENABLE}")
set_source_files_properties(src/nodebuilder/nodebuild_classify_sse2.cpp PROPERTIES COMPILE_FLAGS "${SSE2_ENABLE}") set_source_files_properties(src/nodebuilder/nodebuild_classify_sse2.cpp PROPERTIES COMPILE_FLAGS "${SSE2_ENABLE}")
else() else()
add_definitions(-DNO_SSE) add_definitions(-DDISABLE_SSE)
endif() endif()
CHECK_FUNCTION_EXISTS(stricmp STRICMP_EXISTS) CHECK_FUNCTION_EXISTS(stricmp STRICMP_EXISTS)

View file

@ -29,7 +29,7 @@ typedef double FLOATTYPE;
typedef float FLOATTYPE; typedef float FLOATTYPE;
#endif #endif
#ifndef NO_SSE #ifndef DISABLE_SSE
#include <emmintrin.h> #include <emmintrin.h>
#endif #endif
@ -108,7 +108,7 @@ class VSMatrix {
FVector4 operator *(const FVector4& v) const FVector4 operator *(const FVector4& v) const
{ {
#ifdef NO_SSE #ifdef DISABLE_SSE
FVector4 result; FVector4 result;
result.X = mMatrix[0 * 4 + 0] * v.X + mMatrix[1 * 4 + 0] * v.Y + mMatrix[2 * 4 + 0] * v.Z + mMatrix[3 * 4 + 0] * v.W; result.X = mMatrix[0 * 4 + 0] * v.X + mMatrix[1 * 4 + 0] * v.Y + mMatrix[2 * 4 + 0] * v.Z + mMatrix[3 * 4 + 0] * v.W;
result.Y = mMatrix[0 * 4 + 1] * v.X + mMatrix[1 * 4 + 1] * v.Y + mMatrix[2 * 4 + 1] * v.Z + mMatrix[3 * 4 + 1] * v.W; result.Y = mMatrix[0 * 4 + 1] * v.X + mMatrix[1 * 4 + 1] * v.Y + mMatrix[2 * 4 + 1] * v.Z + mMatrix[3 * 4 + 1] * v.W;

View file

@ -44,6 +44,7 @@
#include <math.h> #include <math.h>
#include <float.h> #include <float.h>
#include <string.h> #include <string.h>
#include <algorithm>
// this is needed to properly normalize angles. We cannot do that with compiler provided conversions because they differ too much // this is needed to properly normalize angles. We cannot do that with compiler provided conversions because they differ too much
#include "xs_Float.h" #include "xs_Float.h"

View file

@ -24,7 +24,8 @@
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <cfloat> #include <cfloat>
#ifndef NO_SSE #include <cstdint>
#ifndef DISABLE_SSE
#include <immintrin.h> #include <immintrin.h>
#endif #endif
@ -285,7 +286,7 @@ float TriangleMeshShape::intersect_triangle_ray(TriangleMeshShape *shape, const
shape->vertices[shape->elements[start_element + 2]] shape->vertices[shape->elements[start_element + 2]]
}; };
// MoellerTrumbore ray-triangle intersection algorithm: // Moeller<EFBFBD>Trumbore ray-triangle intersection algorithm:
FVector3 D = ray.end - ray.start; FVector3 D = ray.end - ray.start;
@ -784,7 +785,7 @@ static const uint32_t clearsignbitmask[] = { 0x7fffffff, 0x7fffffff, 0x7fffffff,
IntersectionTest::OverlapResult IntersectionTest::ray_aabb(const RayBBox &ray, const CollisionBBox &aabb) IntersectionTest::OverlapResult IntersectionTest::ray_aabb(const RayBBox &ray, const CollisionBBox &aabb)
{ {
#ifndef NO_SSE #ifndef DISABLE_SSE
__m128 v = _mm_loadu_ps(&ray.v.X); __m128 v = _mm_loadu_ps(&ray.v.X);
__m128 w = _mm_loadu_ps(&ray.w.X); __m128 w = _mm_loadu_ps(&ray.w.X);

View file

@ -22,7 +22,7 @@
#pragma once #pragma once
#include "Framework/vectors.h" #include "framework/vectors.h"
#include <vector> #include <vector>
#include <cmath> #include <cmath>

View file

@ -3,7 +3,7 @@
#include "vk_renderdevice.h" #include "vk_renderdevice.h"
#include "vk_raytrace.h" #include "vk_raytrace.h"
#include "zvulkan/vulkanbuilders.h" #include "zvulkan/vulkanbuilders.h"
#include "Framework/halffloat.h" #include "framework/halffloat.h"
#include "framework/zstring.h" #include "framework/zstring.h"
#include <map> #include <map>

View file

@ -3,7 +3,7 @@
#include "zvulkan/vulkanobjects.h" #include "zvulkan/vulkanobjects.h"
#include "hw_levelmesh.h" #include "hw_levelmesh.h"
#include "Framework/matrix.h" #include "framework/matrix.h"
class VulkanRenderDevice; class VulkanRenderDevice;