diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b830b468c1..3400f8f0f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,7 @@ jobs: strategy: fail-fast: false matrix: - name: [windows-latest, ubuntu-24.04] + name: [windows-latest, ubuntu-24.04, macos-latest] include: - name: windows-latest os: windows-latest @@ -34,6 +34,13 @@ jobs: physx: linux physxkey: linux gpulang: linux + anyfx: anyfxcompiler-linux + - name: macos-latest + os: macos-latest + config: darwin-ninja-debug + physx: linux + physxkey: linux + anyfx: anyfxcompiler-macos # Steps represent a sequence of tasks that will be executed as part of the job steps: diff --git a/code/foundation/CMakeLists.txt b/code/foundation/CMakeLists.txt index 8f0dfc59ff..1da9c9fe05 100644 --- a/code/foundation/CMakeLists.txt +++ b/code/foundation/CMakeLists.txt @@ -2,10 +2,14 @@ # Foundation #------------------------------------------------------------------------------- -if(FIPS_LINUX OR FIPS_MACOS) +if(FIPS_LINUX OR FIPS_OSX) FIND_PACKAGE(CURL) endif() +if(FIPS_OSX) +find_library(COCOA_LIBRARY Cocoa) +endif() + if (EXISTS "${NROOT}/syswork/export.zip") create_resource("${NROOT}/syswork/" "${NROOT}/syswork/export.zip" system_resources) set_target_properties(system_resources PROPERTIES FOLDER Resources) @@ -18,6 +22,9 @@ nebula_begin_module(foundation) if(FIPS_LINUX) fips_libs(uuid stdc++fs) endif() + if (FIPS_OSX) + fips_libs(${COCOA_LIBRARY}) + endif() target_include_directories(foundation PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) fips_deps(nebula-libs zlib tinyxml nflatbuffer) if(TARGET system_resources) @@ -525,12 +532,12 @@ nebula_begin_module(foundation) jobs2.cc jobs2.h ) - fips_dir(fibers) - fips_files( - fiber.h - fibers.cc - fibers.h - ) + #fips_dir(fibers) + #fips_files( + # fiber.h + # fibers.cc + # fibers.h + #) fips_dir(framesync) fips_files( framesynctimer.cc @@ -611,10 +618,10 @@ nebula_begin_module(foundation) win32/win32systeminfo.cc win32/win32systeminfo.h ) - fips_dir(fibers GROUP "fibers/win32") - fips_files( - win32/win32fiber.cc - ) + #fips_dir(fibers GROUP "fibers/win32") + # fips_files( + # win32/win32fiber.cc + # ) fips_dir(.) endif() if (FIPS_POSIX) @@ -623,7 +630,7 @@ nebula_begin_module(foundation) core/posix/posixsingleton.h core/posix/posixsysfunc.cc core/posix/posixsysfunc.h - fibers/posix/posixfiber.cc + #fibers/posix/posixfiber.cc memory/posix/posixmemory.h memory/posix/posixheap.cc memory/posix/posixheap.h @@ -688,6 +695,18 @@ nebula_begin_module(foundation) ) fips_dir(threading/gcc GROUP "threading/gcc") fips_files(gccinterlocked.cc) + elseif(FIPS_MACOS) + fips_dir(threading/posix GROUP "threading/posix") + fips_files( + posixbarrier.h + posixcriticalsection.h + posixevent.h + + posixthread.cc + posixthread.h + ) + fips_dir(threading/gcc GROUP "threading/gcc") + fips_files(gccinterlocked.cc) else() fips_dir(threading/posix GROUP "threading/posix") fips_files( diff --git a/code/foundation/core/posix/posixsysfunc.cc b/code/foundation/core/posix/posixsysfunc.cc index 4e7d9b6ee5..b91e924e1f 100644 --- a/code/foundation/core/posix/posixsysfunc.cc +++ b/code/foundation/core/posix/posixsysfunc.cc @@ -43,15 +43,11 @@ SysFunc::Setup() if (!SetupCalled) { SetupCalled = true; - #if !__MAYA__ //Threading::Thread::SetMyThreadName("MainThread"); - #endif Memory::SetupHeaps(); Memory::Heap::Setup(); Blob::Setup(); - #if !__MAYA__ Net::Socket::InitNetwork(); - #endif globalStringAtomTable = new Util::GlobalStringAtomTable; #if NEBULA_ENABLE_THREADLOCAL_STRINGATOM_TABLES diff --git a/code/foundation/core/posix/precompiled.h b/code/foundation/core/posix/precompiled.h index be7b3d3e5c..20f3c6672f 100644 --- a/code/foundation/core/posix/precompiled.h +++ b/code/foundation/core/posix/precompiled.h @@ -3,7 +3,7 @@ #define CORE_POSIX_PRECOMPILED_H //------------------------------------------------------------------------------ /** - @file core/win32/precompiled.h + @file core/posix/precompiled.h Contains precompiled headers on the Posix platform. @@ -28,12 +28,16 @@ #include // sse intrinsics +#ifdef __linux__ #if __SSE2__ || __SSE4_1__ || __AVX2__ #include #include #elif __aarc64__ #include #endif +#elif __APPLE__ +#include +#endif //------------------------------------------------------------------------------ #endif diff --git a/code/foundation/core/singleton.h b/code/foundation/core/singleton.h index 507d4feffc..d278b1a6a4 100644 --- a/code/foundation/core/singleton.h +++ b/code/foundation/core/singleton.h @@ -11,9 +11,7 @@ */ #if __WIN32__ #include "core/win32/win32singleton.h" -#elif __OSX__ -#include "core/osx/osxsingleton.h" -#elif __linux__ +#elif __linux__ || __APPLE__ #include "core/posix/posixsingleton.h" #else #error "IMPLEMENT ME!" diff --git a/code/foundation/core/types.h b/code/foundation/core/types.h index e1db13c6f4..f34364f825 100644 --- a/code/foundation/core/types.h +++ b/code/foundation/core/types.h @@ -34,6 +34,7 @@ typedef unsigned int uint; typedef unsigned short ushort; typedef unsigned char uchar; typedef unsigned char ubyte; +typedef signed char byte; typedef uintptr_t uintptr; typedef ptrdiff_t ptrdiff; @@ -109,7 +110,7 @@ OnlyBits(const FLAGS flags, const BITS bits) #define BITS_TO_BYTES(x) (((x)+7)>>3) #define BYTES_TO_BITS(x) ((x)<<3) -#if (__OSX__ || __linux__) +#if (__APPLE__ || __linux__) inline ushort _byteswap_ushort(ushort x) { return ((x>>8) | (x<<8)); } inline ulong _byteswap_ulong(ulong x) { return ((x&0xff000000)>>24) | ((x&0x00ff0000)>>8) | ((x&0x00000ff00)<<8) | ((x&0x000000ff)<<24); } inline unsigned long long _byteswap_uint64(unsigned long long x) { return ((((unsigned long long)_byteswap_ulong((ulong)(x & 0xffffffff))) << 32) | ((unsigned long long)_byteswap_ulong((ulong)(x >> 32)))); } @@ -121,7 +122,7 @@ typedef unsigned char byte; #if __WIN32__ #define n_stricmp stricmp #define n_snprintf StringCchPrintf -#elif (__OSX__ || __APPLE__ || __linux__ ) +#elif __APPLE__ || __linux__ #define n_stricmp strcasecmp #define n_snprintf sprintf #else @@ -132,7 +133,7 @@ typedef unsigned char byte; #define ThreadLocal __declspec(thread) #elif __linux__ #define ThreadLocal __thread -#elif (__OSX__ || __APPLE__) +#elif __APPLE__ #define ThreadLocal thread_local #else #error "Unsupported platform!" diff --git a/code/foundation/io/archfs/archive.cc b/code/foundation/io/archfs/archive.cc index 92fb210ca1..31229d8310 100644 --- a/code/foundation/io/archfs/archive.cc +++ b/code/foundation/io/archfs/archive.cc @@ -8,7 +8,7 @@ namespace IO { -#if __WIN32__ || __linux__ +#if __WIN32__ || __linux__ || __APPLE__ __ImplementClass(IO::Archive, 'ARCV', IO::ZipArchive); #else #error "IO::Archive not implemented on this platform!" diff --git a/code/foundation/io/archfs/archive.h b/code/foundation/io/archfs/archive.h index 3a91fee849..42ec504fb8 100644 --- a/code/foundation/io/archfs/archive.h +++ b/code/foundation/io/archfs/archive.h @@ -9,7 +9,7 @@ (C) 2009 Radon Labs GmbH (C) 2013-2020 Individual contributors, see AUTHORS file */ -#if __WIN32__ || __linux__ +#if __WIN32__ || __linux__ || __APPLE__ #include "io/zipfs/ziparchive.h" namespace IO { diff --git a/code/foundation/io/archfs/archivefilesystem.cc b/code/foundation/io/archfs/archivefilesystem.cc index f627d692cd..eabdc42546 100644 --- a/code/foundation/io/archfs/archivefilesystem.cc +++ b/code/foundation/io/archfs/archivefilesystem.cc @@ -8,7 +8,7 @@ namespace IO { -#if __WIN32__ || __linux__ +#if __WIN32__ || __linux__ || __APPLE__ __ImplementClass(IO::ArchiveFileSystem, 'ARFS', IO::ZipFileSystem); __ImplementInterfaceSingleton(IO::ArchiveFileSystem); #else diff --git a/code/foundation/io/archfs/archivefilesystem.h b/code/foundation/io/archfs/archivefilesystem.h index e3625bd094..fce642e5ed 100644 --- a/code/foundation/io/archfs/archivefilesystem.h +++ b/code/foundation/io/archfs/archivefilesystem.h @@ -9,7 +9,7 @@ (C) 2009 Radon Labs GmbH (C) 2013-2020 Individual contributors, see AUTHORS file */ -#if __WIN32__ || __linux__ +#if __WIN32__ || __linux__ || __APPLE__ #include "io/zipfs/zipfilesystem.h" namespace IO { diff --git a/code/foundation/io/console.cc b/code/foundation/io/console.cc index c07f53a1c2..ec27da29c0 100644 --- a/code/foundation/io/console.cc +++ b/code/foundation/io/console.cc @@ -8,9 +8,7 @@ #include "threading/thread.h" #if __WIN32__ #include "io/win32/win32consolehandler.h" -#elif __OSX__ -#include "io/osx/osxconsolehandler.h" -#elif __linux__ +#elif __linux__ || __APPLE__ #include "io/posix/posixconsolehandler.h" #endif @@ -59,9 +57,7 @@ Console::Open() // create default console handlers #if __WIN32__ Ptr consoleHandler = Win32::Win32ConsoleHandler::Create(); - #elif __OSX__ - Ptr consoleHandler = OSX::OSXConsoleHandler::Create(); - #elif __linux__ + #elif __linux__ || __APPLE__ Ptr consoleHandler = Posix::PosixConsoleHandler::Create(); #endif this->AttachHandler(consoleHandler); diff --git a/code/foundation/io/filetime.h b/code/foundation/io/filetime.h index 423fa14b54..454a5350c2 100644 --- a/code/foundation/io/filetime.h +++ b/code/foundation/io/filetime.h @@ -18,13 +18,7 @@ namespace IO { typedef Win32::Win32FileTime FileTime; } -#elif __OSX__ -#include "io/osx/osxfiletime.h" -namespace IO -{ -typedef OSX::OSXFileTime FileTime; -} -#elif __linux__ +#elif __linux__ || __APPLE__ #include "io/posix/posixfiletime.h" namespace IO { diff --git a/code/foundation/io/filewatcher.h b/code/foundation/io/filewatcher.h index ca50f62ffe..51b8a821dc 100644 --- a/code/foundation/io/filewatcher.h +++ b/code/foundation/io/filewatcher.h @@ -22,7 +22,7 @@ #include "util/bitfield.h" #if __WIN32__ #include "io/win32/win32filewatcher.h" -#elif __linux__ +#elif __linux__ || __APPLE__ #include "io/posix/linuxfilewatcher.h" #else #error "not implemented" diff --git a/code/foundation/io/gamecontentserver.cc b/code/foundation/io/gamecontentserver.cc index f6bb8df256..821333d8b4 100644 --- a/code/foundation/io/gamecontentserver.cc +++ b/code/foundation/io/gamecontentserver.cc @@ -8,7 +8,7 @@ namespace IO { -#if (__WIN32__ || __OSX__ || __linux__) +#if (__WIN32__ || __APPLE__ || __linux__) __ImplementClass(IO::GameContentServer, 'IGCS', Base::GameContentServerBase); #else #error "IO::GameContentServer not implemented on this platform!" diff --git a/code/foundation/io/gamecontentserver.h b/code/foundation/io/gamecontentserver.h index a76d7c06b7..579a57a7aa 100644 --- a/code/foundation/io/gamecontentserver.h +++ b/code/foundation/io/gamecontentserver.h @@ -12,7 +12,7 @@ (C) 2013-2020 Individual contributors, see AUTHORS file */ #include "core/config.h" -#if (__WIN32__ || __OSX__ || __linux__) +#if (__WIN32__ || __APPLE__ || __linux__) #include "io/base/gamecontentserverbase.h" namespace IO { diff --git a/code/foundation/math/point.h b/code/foundation/math/point.h index 2f64f61ab1..b4b08a1438 100644 --- a/code/foundation/math/point.h +++ b/code/foundation/math/point.h @@ -231,7 +231,7 @@ point::storeu(scalar* ptr) const __forceinline void point::store3(scalar* ptr) const { - __m128 v = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(2, 2, 2, 2)); _mm_storel_epi64(reinterpret_cast<__m128i*>(ptr), _mm_castps_si128(this->vec)); _mm_store_ss(&ptr[2], v); } @@ -243,8 +243,8 @@ point::store3(scalar* ptr) const __forceinline void point::storeu3(scalar* ptr) const { - __m128 t1 = _mm_permute_ps(this->vec, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 t2 = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t1 = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 t2 = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(2, 2, 2, 2)); _mm_store_ss(&ptr[0], this->vec); _mm_store_ss(&ptr[1], t1); _mm_store_ss(&ptr[2], t2); diff --git a/code/foundation/math/sse.h b/code/foundation/math/sse.h index 547b688c73..4e04137519 100644 --- a/code/foundation/math/sse.h +++ b/code/foundation/math/sse.h @@ -9,7 +9,14 @@ (C) 2018 Individual contributors, see AUTHORS file */ //------------------------------------------------------------------------------ - +#ifdef __WIN32__ || __linux__ +#include +#include +#include +#include +#elif __APPLE__ +#include +#endif namespace Math { diff --git a/code/foundation/math/vec4.h b/code/foundation/math/vec4.h index 3968cb0b8b..d7491bd628 100644 --- a/code/foundation/math/vec4.h +++ b/code/foundation/math/vec4.h @@ -211,7 +211,7 @@ vec4::storeu(scalar* ptr) const __forceinline void vec4::store3(scalar* ptr) const { - __m128 vv = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 vv = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(2, 2, 2, 2)); _mm_storel_epi64(reinterpret_cast<__m128i*>(ptr), _mm_castps_si128(this->vec)); _mm_store_ss(&ptr[2], vv); } @@ -222,8 +222,8 @@ vec4::store3(scalar* ptr) const __forceinline void vec4::storeu3(scalar* ptr) const { - __m128 t1 = _mm_permute_ps(this->vec, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 t2 = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t1 = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 t2 = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(2, 2, 2, 2)); _mm_store_ss(&ptr[0], this->vec); _mm_store_ss(&ptr[1], t1); _mm_store_ss(&ptr[2], t2); @@ -1073,8 +1073,13 @@ permute(const vec4& v0, const vec4& v1, unsigned int i0, unsigned int i1, unsign __m128i vSelect = _mm_cmpgt_epi32(vControl, three); vControl = _mm_and_si128(vControl, three); +#if N_USE_NEON + __m128 shuffled1 = vbslq_f32(vreinterpretq_u32_f32(vControl), v0.vec, v0.vec); + __m128 shuffled2 = vbslq_f32(vreinterpretq_u32_f32(vControl), v1.vec, v1.vec); +#elif N_USE_AVX __m128 shuffled1 = _mm_permutevar_ps(v0.vec, vControl); __m128 shuffled2 = _mm_permutevar_ps(v1.vec, vControl); +#endif __m128 masked1 = _mm_andnot_ps(_mm_castsi128_ps(vSelect), shuffled1); __m128 masked2 = _mm_and_ps(_mm_castsi128_ps(vSelect), shuffled2); diff --git a/code/foundation/math/vector.h b/code/foundation/math/vector.h index c6bac79f61..f490b6877e 100644 --- a/code/foundation/math/vector.h +++ b/code/foundation/math/vector.h @@ -179,7 +179,7 @@ vector::loadu(const scalar* ptr) __forceinline void vector::store(scalar* ptr) const { - __m128 v = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 v = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(2, 2, 2, 2)); _mm_storel_epi64(reinterpret_cast<__m128i*>(ptr), _mm_castps_si128(this->vec)); _mm_store_ss(&ptr[2], v); } @@ -191,8 +191,8 @@ vector::store(scalar* ptr) const __forceinline void vector::storeu(scalar* ptr) const { - __m128 t1 = _mm_permute_ps(this->vec, _MM_SHUFFLE(1, 1, 1, 1)); - __m128 t2 = _mm_permute_ps(this->vec, _MM_SHUFFLE(2, 2, 2, 2)); + __m128 t1 = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(1, 1, 1, 1)); + __m128 t2 = _mm_shuffle_ps(this->vec, this->vec, _MM_SHUFFLE(2, 2, 2, 2)); _mm_store_ss(&ptr[0], this->vec); _mm_store_ss(&ptr[1], t1); _mm_store_ss(&ptr[2], t2); diff --git a/code/foundation/memory/posix/posixmemory.h b/code/foundation/memory/posix/posixmemory.h index 4f341d4ae2..983d1a4e28 100644 --- a/code/foundation/memory/posix/posixmemory.h +++ b/code/foundation/memory/posix/posixmemory.h @@ -16,6 +16,7 @@ #include "core/debug.h" #include "threading/interlocked.h" #include "memory/posix/posixmemoryconfig.h" +#include #include #include @@ -28,6 +29,16 @@ extern int volatile HeapTypeAllocCount[NumHeapTypes]; extern size_t volatile HeapTypeAllocSize[NumHeapTypes]; #endif +#if __APPLE__ +inline void +explicit_bzero(void *buf, size_t len) +{ + volatile char *p = (volatile char*)buf; + + while (len--) *p++ = 0; +} +#endif + #define StackAlloc(size) alloca(size); #define StackFree(ptr) diff --git a/code/foundation/net/socket/ipaddress.h b/code/foundation/net/socket/ipaddress.h index a11cd4f802..d411ca5804 100644 --- a/code/foundation/net/socket/ipaddress.h +++ b/code/foundation/net/socket/ipaddress.h @@ -27,7 +27,7 @@ namespace Net { typedef Win32::Win32IpAddress IpAddress; } -#elif __linux__ +#elif __linux__ || __APPLE__ #include "net/posix/posixipaddress.h" namespace Net { diff --git a/code/foundation/net/socket/socket.cc b/code/foundation/net/socket/socket.cc index 70f2feb03c..5a3c6d8570 100644 --- a/code/foundation/net/socket/socket.cc +++ b/code/foundation/net/socket/socket.cc @@ -10,7 +10,7 @@ namespace Net { #if (__WIN32__) __ImplementClass(Net::Socket, 'SOCK', Win32::Win32Socket); -#elif __linux__ +#elif __linux__ || __APPLE__ __ImplementClass(Net::Socket, 'SOCK', Posix::PosixSocket); #else #error "Socket class not implemented on this platform!" diff --git a/code/foundation/net/socket/socket.h b/code/foundation/net/socket/socket.h index 87b1be73f5..4996e1c843 100644 --- a/code/foundation/net/socket/socket.h +++ b/code/foundation/net/socket/socket.h @@ -18,7 +18,7 @@ class Socket : public Win32::Win32Socket __DeclareClass(Socket); }; } -#elif __linux__ +#elif __linux__ || __APPLE__ #include "net/posix/posixsocket.h" namespace Net { diff --git a/code/foundation/net/tcpclient.cc b/code/foundation/net/tcpclient.cc index 16971a4752..deff23dd8f 100644 --- a/code/foundation/net/tcpclient.cc +++ b/code/foundation/net/tcpclient.cc @@ -8,9 +8,9 @@ namespace Net { -#if (__WIN32__ || __linux__) +#if __WIN32__ || __linux__ || __APPLE__ __ImplementClass(Net::TcpClient, 'TCPC', Net::StdTcpClient); #else #error "Net::TcpClient not implemented on this platform!" #endif -} \ No newline at end of file +} diff --git a/code/foundation/net/tcpclientconnection.cc b/code/foundation/net/tcpclientconnection.cc index 92a90f1124..54e9e902c5 100644 --- a/code/foundation/net/tcpclientconnection.cc +++ b/code/foundation/net/tcpclientconnection.cc @@ -8,9 +8,9 @@ namespace Net { -#if (__WIN32__ || __linux__) +#if __WIN32__ || __linux__ || __APPLE__ __ImplementClass(Net::TcpClientConnection, 'TPCC', Net::StdTcpClientConnection); #else #error "Net::TcpClientConnection not implemented on this platform!" #endif -} \ No newline at end of file +} diff --git a/code/foundation/net/tcpserver.cc b/code/foundation/net/tcpserver.cc index b91e258cf4..69f759ccc5 100644 --- a/code/foundation/net/tcpserver.cc +++ b/code/foundation/net/tcpserver.cc @@ -8,9 +8,9 @@ namespace Net { -#if (__WIN32__ || __linux__) +#if __WIN32__ || __linux__ || __APPLE__ __ImplementClass(Net::TcpServer, 'TCPS', Net::StdTcpServer); #else #error "Net::TcpServer not implemented on this platform!" #endif -} \ No newline at end of file +} diff --git a/code/foundation/profiling/profiling.h b/code/foundation/profiling/profiling.h index 369d036c14..17b3abccd9 100644 --- a/code/foundation/profiling/profiling.h +++ b/code/foundation/profiling/profiling.h @@ -71,8 +71,6 @@ Timing::Time ProfilingGetTime(); /// register a new thread for the profiling void ProfilingRegisterThread(int priority = 0); -/// get all top level scopes based on thread, only run when you know the thread is finished -const Util::Array& ProfilingGetScopes(Threading::ThreadId thread); /// get all profiling contexts const Util::Array ProfilingGetContexts(); /// clear all scopes diff --git a/code/foundation/system/byteorder.h b/code/foundation/system/byteorder.h index e3e2e7da2a..246fc12d13 100644 --- a/code/foundation/system/byteorder.h +++ b/code/foundation/system/byteorder.h @@ -21,10 +21,8 @@ (C) 2013-2020 Individual contributors, see AUTHORS file */ #include "core/types.h" -#if !__OSX__ #include "math/vec4.h" #include "math/mat4.h" -#endif //------------------------------------------------------------------------------ namespace System @@ -650,4 +648,4 @@ ByteOrder::ConvertInPlace(Math::mat4& val) const } // namespace System //------------------------------------------------------------------------------ - \ No newline at end of file + diff --git a/code/foundation/system/nebulasettings.h b/code/foundation/system/nebulasettings.h index 03d656bffd..405516d479 100644 --- a/code/foundation/system/nebulasettings.h +++ b/code/foundation/system/nebulasettings.h @@ -15,7 +15,7 @@ namespace System { typedef Win32::Win32Registry NebulaSettings; } -#elif __LINUX__ +#elif __linux__ || __APPLE__ #include "system/posix/posixsettings.h" namespace System { @@ -25,4 +25,4 @@ typedef Posix::PosixSettings NebulaSettings; #error "System::NebulaSettings not implemented on this platform!" #endif //------------------------------------------------------------------------------ - \ No newline at end of file + diff --git a/code/foundation/threading/event.h b/code/foundation/threading/event.h index 6a2c82e7e0..20ee0640e5 100644 --- a/code/foundation/threading/event.h +++ b/code/foundation/threading/event.h @@ -20,17 +20,7 @@ class Event : public Win32::Win32Event Event(bool manualReset=false) : Win32Event(manualReset) {}; }; } -#elif __linux__ -#include "threading/linux/linuxevent.h" -namespace Threading -{ -class Event : public Linux::LinuxEvent -{ -public: - Event(bool manualReset=false) : LinuxEvent(manualReset) {}; -}; -} -#elif ( __OSX__ || __APPLE__ ) +#elif __linux__ || __OSX__ || __APPLE__ #include "threading/posix/posixevent.h" namespace Threading { diff --git a/code/foundation/threading/posix/posixevent.h b/code/foundation/threading/posix/posixevent.h index 6650cb734c..d086f73621 100644 --- a/code/foundation/threading/posix/posixevent.h +++ b/code/foundation/threading/posix/posixevent.h @@ -1,17 +1,18 @@ #pragma once -#ifndef POSIX_POSIXEVENT_H -#define POSIX_POSIXEVENT_H //------------------------------------------------------------------------------ /** @class Posix::PosixEvent - - Posix implmentation of an event synchronization object. - - (C) 2006 Radon Labs GmbH + + Posix implementation of Event. Uses pthread condition variables. + + (C) 2010 Radon Labs GmbH (C) 2013-2018 Individual contributors, see AUTHORS file */ #include "core/types.h" -#include + +#if __linux__ +#include +#endif //------------------------------------------------------------------------------ namespace Posix @@ -27,33 +28,48 @@ class PosixEvent ~PosixEvent(); /// signal the event void Signal(); - /// reset the event (only if manual reset) - void Reset(); - /// wait for the event to become signalled + /// wait for the event to become signalled, resets the event void Wait() const; - /// wait for the event with timeout in millisecs + /// wait for the event with timeout in millisecs, resets the event bool WaitTimeout(int ms) const; - /// check if event is signalled + /// check if event is signaled bool Peek() const; + /// manually reset the event + void Reset(); /// Returns true if event is manually reset bool IsManual() const; private: - bool manual; - sem_t* semaphore; + // emulate windows event behaviour (*sigh*) + enum EventStatus + { + SIGNAL_NONE = 0, + SIGNAL_ONE = 1, + SIGNAL_ALL = 2, + }; + + mutable pthread_mutex_t mutex; + mutable pthread_cond_t cond; + + bool manualReset; + volatile mutable EventStatus status; }; //------------------------------------------------------------------------------ /** - manual reset is not used, since it's only used for win32events */ inline -PosixEvent::PosixEvent(bool manualReset) - : semaphore(0) - , manual(manualReset) +PosixEvent::PosixEvent(bool manual) + : manualReset(manual) + , status(SIGNAL_NONE) { - this->semaphore = new sem_t; - sem_init(this->semaphore, 0, 0); + // setup the mutex + int res = pthread_mutex_init(&this->mutex, nullptr); + n_assert(0 == res); + + // setup the condition variable + res = pthread_cond_init(&this->cond, nullptr); + n_assert(0 == res); } //------------------------------------------------------------------------------ @@ -62,38 +78,50 @@ PosixEvent::PosixEvent(bool manualReset) inline PosixEvent::PosixEvent(PosixEvent&& ev) { - this->semaphore = ev.semaphore; - this->manual = ev.semaphore; - ev.semaphore = nullptr; + int res = pthread_cond_destroy(&this->cond); + n_assert(0 == res); + res = pthread_mutex_destroy(&this->mutex); + n_assert(0 == res); + + this->mutex = ev.mutex; + this->cond = ev.cond; + this->manualReset = ev.manualReset; + this->status = ev.status; + ev.mutex = pthread_mutex_t{}; + ev.cond = pthread_cond_t{}; + ev.status = SIGNAL_NONE; } //------------------------------------------------------------------------------ /** */ -inline +inline PosixEvent::~PosixEvent() { - sem_destroy(this->semaphore); - delete this->semaphore; - this->semaphore = 0; + int res = pthread_cond_destroy(&this->cond); + n_assert(0 == res); + res = pthread_mutex_destroy(&this->mutex); + n_assert(0 == res); } - + //------------------------------------------------------------------------------ /** */ inline void PosixEvent::Signal() { - sem_post(this->semaphore); -} - -//------------------------------------------------------------------------------ -/** -*/ -inline void -PosixEvent::Reset() -{ - // do nothing, not required for POSIX events + pthread_mutex_lock(&this->mutex); + if(this->manualReset) + { + this->status = SIGNAL_ALL; + pthread_cond_broadcast(&this->cond); + } + else + { + this->status = SIGNAL_ONE; + pthread_cond_signal(&this->cond); + } + pthread_mutex_unlock(&this->mutex); } //------------------------------------------------------------------------------ @@ -102,39 +130,91 @@ PosixEvent::Reset() inline void PosixEvent::Wait() const { - sem_wait(this->semaphore); + pthread_mutex_lock(&this->mutex); + + bool locked = false; + do + { + // dont wait for cond if already triggered + if (this->status == SIGNAL_ONE) + { + this->status = SIGNAL_NONE; + locked = true; + } + else if( this->status == SIGNAL_ALL) + { + // we are in a manual reset event, do nothing + locked = true; + } + else + { + // we actually have to wait + int res = pthread_cond_wait(&this->cond, &this->mutex); + n_assert(res == 0); + } + } while (!locked); + pthread_mutex_unlock(&this->mutex); } //------------------------------------------------------------------------------ /** - Waits for the event to become signaled with a specified timeout - in milli seconds. If the method times out it will return false, - if the event becomes signalled within the timeout it will return - true. */ inline bool -PosixEvent::WaitTimeout(int timeoutInMilliSec) const +PosixEvent::WaitTimeout(int ms) const { - while (timeoutInMilliSec > 0) + bool timeOutOccured = false; + pthread_mutex_lock(&this->mutex); + + bool locked = false; + do { - if (0 == sem_trywait(this->semaphore)) + // dont wait for cond if already triggered + if (this->status == SIGNAL_ONE) { - return true; + this->status = SIGNAL_NONE; + locked = true; } - usleep(1000); - timeoutInMilliSec -= 1; - } - return false; -} + else if( this->status == SIGNAL_ALL) + { + // we are in a manual reset event, do nothing + locked = true; + } + else + { + timespec timeSpec; + timeSpec.tv_sec = ms / 1000; + timeSpec.tv_nsec = (ms - timeSpec.tv_sec * 1000) * 1000000; + + int res = pthread_cond_timedwait(&this->cond, &this->mutex, &timeSpec); + if (ETIMEDOUT == res) + { + timeOutOccured = true; + } + } + } while(!locked && !timeOutOccured); + pthread_mutex_unlock(&this->mutex); + return !timeOutOccured; +} + //------------------------------------------------------------------------------ /** - This checks if the event is signalled and returnes immediately. */ inline bool PosixEvent::Peek() const { - return 0 == sem_trywait(this->semaphore); + return this->status != SIGNAL_NONE; +} + +//------------------------------------------------------------------------------ +/** + */ +inline void +PosixEvent::Reset() +{ + pthread_mutex_lock(&this->mutex); + this->status = SIGNAL_NONE; + pthread_mutex_unlock(&this->mutex); } //------------------------------------------------------------------------------ @@ -143,10 +223,9 @@ PosixEvent::Peek() const inline bool PosixEvent::IsManual() const { - return this->manual; + return this->manualReset; } -}; // namespace Posix +} // namespace Posix //------------------------------------------------------------------------------ -#endif diff --git a/code/foundation/threading/posix/posixthread.cc b/code/foundation/threading/posix/posixthread.cc index e888f2eebb..dc25c54bc3 100644 --- a/code/foundation/threading/posix/posixthread.cc +++ b/code/foundation/threading/posix/posixthread.cc @@ -3,7 +3,7 @@ // (C) 2006 Radon Labs GmbH // (C) 2013-2018 Individual contributors, see AUTHORS file //------------------------------------------------------------------------------ -#include "stdneb.h" +#include "foundation/stdneb.h" #include "threading/posix/posixthread.h" #include @@ -15,6 +15,11 @@ __ImplementClass(Posix::PosixThread, 'THRD', Core::RefCounted); __thread const char* PosixThread::ThreadName = 0; #endif +#if NEBULA_DEBUG +Threading::CriticalSection PosixThread::criticalSection; +Util::List PosixThread::ThreadList; +#endif + //------------------------------------------------------------------------------ /** */ @@ -22,8 +27,7 @@ PosixThread::PosixThread() : threadHandle(0), running(false), priority(Normal), - stackSize(4096), - coreId(System::Cpu::Core0) + stackSize(4096) { // empty } @@ -167,7 +171,11 @@ PosixThread::GetMyThreadName() Threading::ThreadId PosixThread::GetMyThreadId() { +#if __APPLE__ + return reinterpret_cast(pthread_self()); +#else return pthread_self(); +#endif } //------------------------------------------------------------------------------ @@ -185,15 +193,50 @@ Posix::PosixThread::YieldThread() #endif } +//------------------------------------------------------------------------------ +/** + Returns an array with infos about all currently existing thread objects. +*/ +#if NEBULA_DEBUG +Util::Array +PosixThread::GetRunningThreadDebugInfos() +{ + // NOTE: Portions of this loop aren't completely thread-safe + // (getting the thread-name for instance), but since those + // attributes don't change when the thread has been started + // this shouldn't be a problem. + Util::Array infos; + PosixThread::criticalSection.Enter(); + Util::List::Iterator iter; + for (iter = ThreadList.Begin(); iter != ThreadList.End(); iter++) + { + PosixThread* cur = *iter; + if (cur->IsRunning()) + { + ThreadDebugInfo info; + info.threadName = cur->GetName(); + info.threadPriority = cur->GetPriority(); + info.threadCoreId = (System::Cpu::CoreId)cur->GetThreadAffinity(); + info.threadStackSize = cur->GetStackSize(); + infos.Append(info); + } + } + PosixThread::criticalSection.Leave(); + return infos; +} +#endif + //------------------------------------------------------------------------------ /** */ void PosixThread::SetThreadAffinity(uint mask) { - n_assert(this->threadHandle != 0); - CPU_SET(mask, &this->affinity); - pthread_set_affinity_np(this->threadHandle, sizeof(cpu_set_t), &this->affinity); + if (this->threadHandle != 0) + { + + } + // TODO: MacOS doesn't seem to support this } }; diff --git a/code/foundation/threading/posix/posixthread.h b/code/foundation/threading/posix/posixthread.h index 366e692bdb..6af6435a92 100644 --- a/code/foundation/threading/posix/posixthread.h +++ b/code/foundation/threading/posix/posixthread.h @@ -64,6 +64,18 @@ class PosixThread : public Core::RefCounted /// get the thread ID of this thread static Threading::ThreadId GetMyThreadId(); +#if NEBULA_DEBUG + struct ThreadDebugInfo + { + Util::String threadName; + PosixThread::Priority threadPriority; + System::Cpu::CoreId threadCoreId; + SizeT threadStackSize; + }; + /// query thread stats (debug mode only) + static Util::Array GetRunningThreadDebugInfos(); +#endif + protected: /// override this method if your thread loop needs a wakeup call before stopping virtual void EmitWakeupSignal(); @@ -77,13 +89,18 @@ class PosixThread : public Core::RefCounted static void* ThreadProc(void* self); pthread_t threadHandle; - cpu_set_t affinity; PosixEvent stopRequestEvent; bool running; Priority priority; unsigned int stackSize; - Util::String name; + Util::String name; static ThreadLocal const char* ThreadName; + +#if NEBULA_DEBUG + static Threading::CriticalSection criticalSection; + static Util::List ThreadList; + Util::List::Iterator threadListIterator; +#endif }; //------------------------------------------------------------------------------ diff --git a/code/foundation/threading/posix/posixthreadid.h b/code/foundation/threading/posix/posixthreadid.h index 8e46b84bf7..c5ddece303 100644 --- a/code/foundation/threading/posix/posixthreadid.h +++ b/code/foundation/threading/posix/posixthreadid.h @@ -11,7 +11,11 @@ namespace Threading { -typedef pthread_t ThreadId; +#if __APPLE__ + typedef uint64_t ThreadId; +#else + typedef pthread_t ThreadId; +#endif static const ThreadId InvalidThreadId = 0; typedef int64_t ThreadIdStorage; static_assert(sizeof(ThreadId) == sizeof(ThreadIdStorage)); diff --git a/code/foundation/threading/thread.cc b/code/foundation/threading/thread.cc index 31e6bd6324..84255e5029 100644 --- a/code/foundation/threading/thread.cc +++ b/code/foundation/threading/thread.cc @@ -10,8 +10,8 @@ namespace Threading { #if __WIN32__ __ImplementClass(Threading::Thread, 'TRED', Win32::Win32Thread); -#elif __OSX__ -__ImplementClass(Threading::Thread, 'TRED', OSX::OSXThread); +#elif __APPLE__ +__ImplementClass(Threading::Thread, 'TRED', Posix::PosixThread); #elif __linux__ __ImplementClass(Threading::Thread, 'TRED', Linux::LinuxThread); #else diff --git a/code/foundation/threading/threadid.h b/code/foundation/threading/threadid.h index c636566725..5041a877be 100644 --- a/code/foundation/threading/threadid.h +++ b/code/foundation/threading/threadid.h @@ -13,8 +13,8 @@ */ #if __WIN32__ #include "threading/win32/win32threadid.h" -#elif __OSX__ -#include "threading/osx/osxthreadid.h" +#elif __APPLE__ +#include "threading/posix/posixthreadid.h" #elif __linux__ #include "threading/linux/linuxthreadid.h" #else diff --git a/code/foundation/timing/calendartime.h b/code/foundation/timing/calendartime.h index 654406ed92..98a9d11e71 100644 --- a/code/foundation/timing/calendartime.h +++ b/code/foundation/timing/calendartime.h @@ -19,7 +19,7 @@ namespace Timing class CalendarTime : public Win32::Win32CalendarTime { }; } -#elif __linux__ +#elif __linux__ || __APPLE__ #include "timing/posix/posixcalendartime.h" namespace Timing { diff --git a/code/foundation/timing/timer.h b/code/foundation/timing/timer.h index 550f40d3c5..e9d92dd0d4 100644 --- a/code/foundation/timing/timer.h +++ b/code/foundation/timing/timer.h @@ -18,7 +18,7 @@ namespace Timing class Timer : public Win32::Win32Timer { }; } -#elif __linux__ +#elif __linux__ || __APPLE__ #include "timing/posix/posixtimer.h" namespace Timing { diff --git a/code/foundation/util/arrayallocatorsafe.h b/code/foundation/util/arrayallocatorsafe.h index 34e4eeedc3..d8923413ca 100644 --- a/code/foundation/util/arrayallocatorsafe.h +++ b/code/foundation/util/arrayallocatorsafe.h @@ -27,6 +27,7 @@ #include "threading/readwritelock.h" #include "threading/spinlock.h" #include +#include "threading/interlocked.h" #include "tupleutility.h" #include "ids/id.h" diff --git a/code/foundation/util/string.cc b/code/foundation/util/string.cc index d7e02c6448..e1f2fb8eba 100644 --- a/code/foundation/util/string.cc +++ b/code/foundation/util/string.cc @@ -62,7 +62,7 @@ String::Format(const char* fmtString, ...) #if __WIN32__ // need to use non-CRT thread safe function under Win32 StringCchVPrintf(buf, sizeof(buf), fmtString, argList); - #elif (__OSX__ || __linux__) + #elif (__APPLE__ || __linux__) vsnprintf(buf, sizeof(buf), fmtString, argList); #else _vsnprintf(buf, sizeof(buf), fmtString, argList); @@ -81,7 +81,7 @@ String::FormatArgList(const char* fmtString, va_list argList) #if __WIN32__ // need to use non-CRT thread safe function under Win32 StringCchVPrintf(buf, sizeof(buf), fmtString, argList); - #elif (__OSX__ || __linux__) + #elif (__APPLE__ || __linux__) vsnprintf(buf, sizeof(buf), fmtString, argList); #else _vsnprintf(buf, sizeof(buf), fmtString, argList); diff --git a/code/render/CMakeLists.txt b/code/render/CMakeLists.txt index 9e9d0f33e8..13692a41c6 100644 --- a/code/render/CMakeLists.txt +++ b/code/render/CMakeLists.txt @@ -4,7 +4,7 @@ FIND_PROGRAM(GPULANGC NAMES gpulangc.exe gpulangc - PATHS ${FIPS_DEPLOY_DIR}/gpulang/win64 ${FIPS_DEPLOY_DIR}/gpulang/linux + PATHS ${FIPS_DEPLOY_DIR}/gpulang/win64 ${FIPS_DEPLOY_DIR}/gpulang/linux ${FIPS_DEPLOY_DIR}/gpulang/macos NO_DEFAULT_PATH ) diff --git a/fips-files/configs/darwin-ninja-debug.yml b/fips-files/configs/darwin-ninja-debug.yml new file mode 100644 index 0000000000..3258be8cd8 --- /dev/null +++ b/fips-files/configs/darwin-ninja-debug.yml @@ -0,0 +1,12 @@ +--- +platform: osx +generator: Ninja +build_tool: ninja +build_type: Debug +defines: + N_USE_MOLTEN_VK: ON + N_USE_VULKAN: ON + FIPS_RTTI: ON + FIPS_EXCEPTIONS: ON + N_USE_CURL: OFF + diff --git a/fips-files/configs/darwin-ninja-release.yml b/fips-files/configs/darwin-ninja-release.yml new file mode 100644 index 0000000000..835526bf55 --- /dev/null +++ b/fips-files/configs/darwin-ninja-release.yml @@ -0,0 +1,11 @@ +--- +platform: osx +generator: Ninja +build_tool: ninja +build_type: Release +defines: + N_USE_MOLTEN_VK: ON + N_USE_VULKAN: ON + FIPS_RTTI: ON + FIPS_EXCEPTIONS: ON + N_USE_CURL: OFF diff --git a/fips-files/configs/darwin-xcode-debug.yml b/fips-files/configs/darwin-xcode-debug.yml new file mode 100644 index 0000000000..28c21d5e78 --- /dev/null +++ b/fips-files/configs/darwin-xcode-debug.yml @@ -0,0 +1,12 @@ +--- +platform: osx +generator: Xcode +build_tool: cmake +build_type: Debug +defines: + N_USE_MOLTEN_VK: ON + N_USE_VULKAN: ON + FIPS_RTTI: ON + FIPS_EXCEPTIONS: ON + N_USE_CURL: OFF + diff --git a/fips-files/configs/darwin-xcode-release.yml b/fips-files/configs/darwin-xcode-release.yml index 6c07704476..d5feb57877 100644 --- a/fips-files/configs/darwin-xcode-release.yml +++ b/fips-files/configs/darwin-xcode-release.yml @@ -4,6 +4,8 @@ generator: Xcode build_tool: cmake build_type: Release defines: - N_USE_VULKAN: ON - FIPS_RTTI: ON - FIPS_EXCEPTIONS: ON + N_USE_MOLTEN_VK: ON + N_USE_VULKAN: ON + FIPS_RTTI: ON + FIPS_EXCEPTIONS: ON + N_USE_CURL: OFF diff --git a/fips-files/include.cmake b/fips-files/include.cmake index d3e4223e69..a330e52eb2 100644 --- a/fips-files/include.cmake +++ b/fips-files/include.cmake @@ -92,7 +92,12 @@ elseif(FIPS_LINUX) set(CXX_WARNING_FLAGS "-Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-copy -Wno-deprecated-volatile -Wno-unused-function -Wno-reorder-ctor -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-missing-braces -Wno-overloaded-virtual -Wno-unused-variable -Wno-tautological-constant-out-of-range-compare -Wno-unused-but-set-variable -Wno-inconsistent-missing-override -Wno-switch -Wno-nontrivial-memcall -Wno-deprecated-literal-operator -Wno-nan-infinity-disabled -Wno-unknown-warning-option") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CXX_WARNING_FLAGS} ") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -z noexecstack") - +elseif(FIPS_MACOS) + INCLUDE_DIRECTORIES(${FIPS_ROOT_DIR}/../sse2neon) + SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -msse4.2 -march=armv8-a+fp+simd+crypto+crc -ffast-math -fPIC -fno-trapping-math -funsafe-math-optimizations -ffinite-math-only -mrecip=all -Wall") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -march=armv8-a+fp+simd+crypto+crc -ffast-math -fPIC -fno-trapping-math -funsafe-math-optimizations -ffinite-math-only -mrecip=all -Wall") + set(CXX_WARNING_FLAGS "-Wno-sign-compare -Wno-unused-parameter -Wno-deprecated-copy -Wno-deprecated-volatile -Wno-unused-function -Wno-unknown-pragmas -Wno-ignored-pragmas -Wno-missing-braces -Wno-overloaded-virtual -Wno-unused-variable -Wno-tautological-constant-out-of-range-compare -w") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4 -mavx ${CXX_WARNING_FLAGS} ") endif() @@ -105,6 +110,11 @@ OPTION(N_USE_AVX "Use AVX instructionset" ON) OPTION(N_USE_FMA "Use FMA instructionset" OFF) OPTION(N_USE_CURL "Use libcurl for httpclient" ON) +if (FIPS_MACOS) + set(N_USE_AVX OFF) + set(N_USE_NEON ON) +endif() + if (N_USE_CURL) add_definitions(-DUSE_CURL) endif() @@ -115,6 +125,9 @@ endif() if (N_USE_FMA) add_definitions(-DN_USE_FMA) endif() +if (N_USE_NEON) + add_definitions(-DN_USE_NEON) +endif() add_definitions(-DIL_STATIC_LIB=1) find_package(Python 3.7 COMPONENTS Development REQUIRED) diff --git a/fips-files/verbs/anyfx.py b/fips-files/verbs/anyfx.py index 89b428fa40..49043d73f5 100644 --- a/fips-files/verbs/anyfx.py +++ b/fips-files/verbs/anyfx.py @@ -12,7 +12,9 @@ def run(fips_dir, proj_dir, args) : """run the 'anyfx' verb""" if sys.platform == "win32" : target = "anyfxcompiler-windows/anyfxcompiler.exe" - else : + elif sys.platform == "darwin": + target = "anyfxcompiler-darwin/anyfxcompiler" + else: target = "anyfxcompiler-linux/anyfxcompiler" if len(args) > 0 : noun = args[0] @@ -26,8 +28,10 @@ def run(fips_dir, proj_dir, args) : log.info(log.YELLOW + "Compiling anyfxcompiler") if sys.platform == "win32" : ext = ".bat" + elif sys.platform == "darwin": + ext = "-macos.sh" else: - ext = ".sh" + ext = "-linux.sh" if (len(args) > 2 and args[2] == 'quiet'): ret_code = subprocess.call(proj_dir + "/../fips-anyfx/anyfxcompiler/build{}".format(ext), stdout=subprocess.DEVNULL) diff --git a/fips-files/verbs/bootstrap.py b/fips-files/verbs/bootstrap.py index 6d7b3e323e..ddb87acf93 100644 --- a/fips-files/verbs/bootstrap.py +++ b/fips-files/verbs/bootstrap.py @@ -33,7 +33,10 @@ def run(fips_dir, proj_dir, args) : log.info("[BOOTSTRAP]: " + log.BLUE + "-- Python Deps --" + log.DEF) log.info(log.YELLOW + "Installing required python dependencies..." + log.DEF) - subprocess.call("pip install py7zr", stdout=subprocess.DEVNULL) + if sys.platform == "win32": + subprocess.call("pip install py7zr", stdout=subprocess.DEVNULL) + elif sys.platform == "darwin": + subprocess.call("brew install p7zip", shell=True) # TODO: we should build the assetbatcher as well, without support for fbx unless we have the SDK installed. diff --git a/fips.yml b/fips.yml index 3f7724957d..1eff9106a4 100644 --- a/fips.yml +++ b/fips.yml @@ -46,6 +46,9 @@ imports: gpulang: git: https://github.com/gscept/GPULang.git group: gpulang + sse2neon: + git: https://github.com/DLTcollab/sse2neon.git + cond: "FIPS_MACOS" fips-recast: git: https://github.com/gscept/fips-recast.git