diff --git a/.buckconfig b/.buckconfig index 7b39418a90..16b3030b2e 100644 --- a/.buckconfig +++ b/.buckconfig @@ -28,9 +28,8 @@ [project] ignore = .git - [tf] memory-tracking = 1 log-level = eAll build = debug - fxc = C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64 \ No newline at end of file + fxc = C:\Program Files (x86)\Windows Kits\10\bin\10.0.22621.0\x64 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..c75f5e43d2 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,23 @@ +name: CI + +on: [push, pull_request] + +jobs: + linux: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install rustup libgtk-3-dev libudev-dev libx11-dev libxrandr-dev + rustup install nightly-2024-04-28 + cargo +nightly-2024-04-28 install --git https://github.com/facebook/buck2.git buck2 + - name: Run Test + run: | + export PATH=$HOME/.cargo/bin:$PATH + cd ${{ github.workspace }} + buck2 test --target-platforms tf_platform//:linux_x86_64 tf//... diff --git a/Forge/BUCK b/Forge/BUCK index 7e0a7ed610..d91ff6289c 100644 --- a/Forge/BUCK +++ b/Forge/BUCK @@ -171,7 +171,9 @@ cxx_library( "Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/hid/hidparsers/*.cpp", ]) }) + [ - "TF_Log.c" + "TF_Log.c", + "TF_String.cpp", + "Mem/TF_Allocators.cpp" ], deps = select({ "tf_platform//target:linux": [ @@ -216,6 +218,8 @@ cxx_library( exported_headers = { "Forge/TF_Config.h":":TF_Config", + "Forge/TF_Types.h":"TF_Types.h", + "Forge/TF_String.h":"TF_String.h", "Forge/Config.h": "Config.h", "Forge/TF_FileSystem.h": "TF_FileSystem.h", "Forge/TF_Log.h": "TF_Log.h", @@ -224,10 +228,15 @@ cxx_library( } | { file: file for file in glob(["Common_3/**/*.h", "Common_3/**/*.hpp"]) } | { paths.join("Forge",file): file for file in glob([ + "Mem/*.h", + "stb/*.h", "Core/**/*.h", "Core/*.h", "System/*.h", + "Math/*.hpp", + "Math/**/*.hpp", + "Graphics/*.h", "Graphics/**/*.h", "Graphics/*.inl", diff --git a/Forge/Common_3/Application/CameraController.cpp b/Forge/Common_3/Application/CameraController.cpp index e5700c602c..226e2e9942 100644 --- a/Forge/Common_3/Application/CameraController.cpp +++ b/Forge/Common_3/Application/CameraController.cpp @@ -27,7 +27,7 @@ #include "Interfaces/ICameraController.h" // Include this file as last include in all cpp files allocating memory -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static const float k_scrollSpeed = -5.0f; diff --git a/Forge/Common_3/Application/Fonts/FontSystem.cpp b/Forge/Common_3/Application/Fonts/FontSystem.cpp index cbe92299c4..0ee2f6e1bf 100644 --- a/Forge/Common_3/Application/Fonts/FontSystem.cpp +++ b/Forge/Common_3/Application/Fonts/FontSystem.cpp @@ -31,7 +31,7 @@ // include Fontstash (should be after MemoryTracking so that it also detects memory free/remove in fontstash) #define FONTSTASH_IMPLEMENTATION #include "Forge/Graphics/tinyimageformat/tinyimageformat_query.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "../ThirdParty/OpenSource/Fontstash/src/fontstash.h" @@ -40,7 +40,7 @@ #include "../../Utilities/RingBuffer.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef ENABLE_FORGE_FONTS diff --git a/Forge/Common_3/Application/Fonts/stbtt.cpp b/Forge/Common_3/Application/Fonts/stbtt.cpp index bf3e90e965..f73c72db67 100644 --- a/Forge/Common_3/Application/Fonts/stbtt.cpp +++ b/Forge/Common_3/Application/Fonts/stbtt.cpp @@ -36,10 +36,10 @@ #ifndef STB_RECT_PACK_IMPLEMENTATION #define STB_RECT_PACK_IMPLEMENTATION #define STBRP_ASSERT(x) ASSERT(x) -#include "Forge/Core/Nothings/stb_rectpack.h" +#include "Forge/stb/stb_rectpack.h" #endif -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifndef STB_TRUETYPE_IMPLEMENTATION #define STB_TRUETYPE_IMPLEMENTATION @@ -60,7 +60,7 @@ static void stbtt_dealloc_func(void* ptr, void* user_data) #define STBTT_malloc(x, u) stbtt_alloc_func(x, u) #define STBTT_free(x, u) stbtt_dealloc_func(x, u) -#include "Forge/Core/Nothings/stb_truetype.h" +#include "Forge/stb/stb_truetype.h" #endif #endif // UI OR FONTS diff --git a/Forge/Common_3/Application/InputSystem.cpp b/Forge/Common_3/Application/InputSystem.cpp index e8a1751593..462720f2d3 100644 --- a/Forge/Common_3/Application/InputSystem.cpp +++ b/Forge/Common_3/Application/InputSystem.cpp @@ -23,7 +23,7 @@ * under the License. */ -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Graphics/GraphicsConfig.h" @@ -70,7 +70,7 @@ #include "Interfaces/IInput.h" #include "Interfaces/IUI.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef GAINPUT_PLATFORM_GGP namespace gainput diff --git a/Forge/Common_3/Application/Interfaces/IUI.h b/Forge/Common_3/Application/Interfaces/IUI.h index 3631968355..325860217e 100644 --- a/Forge/Common_3/Application/Interfaces/IUI.h +++ b/Forge/Common_3/Application/Interfaces/IUI.h @@ -36,7 +36,7 @@ // e.g., "X" variable will have "SetX" and "GetX" pair of functions // To add global Lua functions, independent of Unit Tests, add definition in UIApp::Init (Check LOGINFO there for example). -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "../../Utilities/Math/MathTypes.h" diff --git a/Forge/Common_3/Application/Profiler/GpuProfiler.cpp b/Forge/Common_3/Application/Profiler/GpuProfiler.cpp index 43b9c8185e..447c0ef34a 100644 --- a/Forge/Common_3/Application/Profiler/GpuProfiler.cpp +++ b/Forge/Common_3/Application/Profiler/GpuProfiler.cpp @@ -53,7 +53,7 @@ void removeGpuProfiler(ProfileToken nProfileToken) {} #include "ProfilerBase.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" DECLARE_RENDERER_FUNCTION(void, mapBuffer, Renderer* pRenderer, Buffer* pBuffer, ReadRange* pRange) DECLARE_RENDERER_FUNCTION(void, unmapBuffer, Renderer* pRenderer, Buffer* pBuffer) diff --git a/Forge/Common_3/Application/Profiler/ProfilerBase.cpp b/Forge/Common_3/Application/Profiler/ProfilerBase.cpp index df5fc68660..f46e8d75ec 100644 --- a/Forge/Common_3/Application/Profiler/ProfilerBase.cpp +++ b/Forge/Common_3/Application/Profiler/ProfilerBase.cpp @@ -42,7 +42,7 @@ #include "../../Utilities/Math/Algorithms.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef ENABLE_PROFILER ///////////////////////////////////////////////////////////////////////////// diff --git a/Forge/Common_3/Application/Screenshot.cpp b/Forge/Common_3/Application/Screenshot.cpp index efa0720c57..d959dc491b 100644 --- a/Forge/Common_3/Application/Screenshot.cpp +++ b/Forge/Common_3/Application/Screenshot.cpp @@ -46,7 +46,7 @@ #define STBIW_REALLOC tf_realloc #define STBIW_FREE tf_free #define STBIW_ASSERT ASSERT -#include "Forge/Core/Nothings/stb_image_write.h" +#include "Forge/stb/stb_image_write.h" static Cmd* gCmd = 0; static CmdPool* pCmdPool = 0; diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/Fontstash/src/fontstash.h b/Forge/Common_3/Application/ThirdParty/OpenSource/Fontstash/src/fontstash.h index 3c9edfa9cf..e7e24a9a99 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/Fontstash/src/fontstash.h +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/Fontstash/src/fontstash.h @@ -20,7 +20,7 @@ #define FONS_H #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef __cplusplus extern "C" { @@ -261,7 +261,7 @@ static int fons__tt_getGlyphKernAdvance(FONSttFontImpl *font, int glyph1, int gl // Using a unified stbtt implementation for fontstash and imgui // All we need is the header for the function declarations since they're compiled in Core/stbtt.cpp -#include "Forge/Core/Nothings/stb_truetype.h" +#include "Forge/stb/stb_truetype.h" //Previous implementation: //#define STB_TRUETYPE_IMPLEMENTATION diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/include/gainput/GainputAllocator.h b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/include/gainput/GainputAllocator.h index 5130361d79..4ffa4d0899 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/include/gainput/GainputAllocator.h +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/include/gainput/GainputAllocator.h @@ -3,7 +3,7 @@ #define GAINPUTALLOCATOR_H_ #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" namespace gainput { diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputGCKit.mm b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputGCKit.mm index a6872eff56..52435d6046 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputGCKit.mm +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputGCKit.mm @@ -28,7 +28,7 @@ #if defined(GAINPUT_PLATFORM_IOS) || defined(GAINPUT_PLATFORM_MAC) #include "../../../include/gainput/apple/GainputGCKit.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef GAINPUT_GC_HAPTICS diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputIos.mm b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputIos.mm index 77832561ea..96ab992211 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputIos.mm +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/gainput/apple/GainputIos.mm @@ -32,7 +32,7 @@ #include "GainputInputDeviceTouchIos.h" #include "GainputInputDeviceKeyboardIOS.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" @implementation KeyboardView diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/linux/hid.c b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/linux/hid.c index cce8a5549d..d98ccb3c8f 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/linux/hid.c +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/linux/hid.c @@ -42,7 +42,7 @@ #include "../hidapi.h" #define bool int -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef HIDAPI_ALLOW_BUILD_WORKAROUND_KERNEL_2_6_39 diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/mac/hid.c b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/mac/hid.c index 6c92e58537..698db4ff9e 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/mac/hid.c +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/mac/hid.c @@ -31,7 +31,7 @@ #include "../hidapi.h" #include "Forge/TF_Thread.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /* As defined in AppKit.h, but we don't need the entire AppKit for a single constant. */ extern const double NSAppKitVersionNumber; diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/windows/hid.c b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/windows/hid.c index 6032473d33..dcae702a02 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/windows/hid.c +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/gainput/lib/source/hidapi/windows/hid.c @@ -76,7 +76,7 @@ extern "C" { #include "../hidapi.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #undef MIN #define MIN(x,y) ((x) < (y)? (x): (y)) diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imconfig.h b/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imconfig.h index b0602cbc1f..4f9f12d9d9 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imconfig.h +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imconfig.h @@ -70,8 +70,8 @@ //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version // By default the embedded implementations are declared static and not available outside of Dear ImGui sources files. -#define IMGUI_STB_TRUETYPE_FILENAME "Forge/Core/Nothings/stb_truetype.h" -#define IMGUI_STB_RECT_PACK_FILENAME "Forge/Core/Nothings/stb_rectpack.h" +#define IMGUI_STB_TRUETYPE_FILENAME "Forge/stb/stb_truetype.h" +#define IMGUI_STB_RECT_PACK_FILENAME "Forge/stb/stb_rectpack.h" //#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if IMGUI_USE_STB_SPRINTF is defined. //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_internal.h b/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_internal.h index f83c46a755..0bfa78ae8f 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_internal.h +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_internal.h @@ -208,7 +208,7 @@ namespace ImStb #define STB_TEXTEDIT_GETWIDTH_NEWLINE (-1.0f) #define STB_TEXTEDIT_UNDOSTATECOUNT 99 #define STB_TEXTEDIT_UNDOCHARCOUNT 999 -#include "Forge/Core/Nothings/stb_textedit.h" +#include "Forge/stb/stb_textedit.h" } // namespace ImStb diff --git a/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_widgets.cpp b/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_widgets.cpp index 1735af6277..9405e8fc68 100644 --- a/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_widgets.cpp +++ b/Forge/Common_3/Application/ThirdParty/OpenSource/imgui/imgui_widgets.cpp @@ -3836,7 +3836,7 @@ static bool STB_TEXTEDIT_INSERTCHARS(ImGuiInputTextState* obj, int pos, const Im #define STB_TEXTEDIT_IMPLEMENTATION #define STB_TEXTEDIT_memmove memmove -#include "Forge/Core/Nothings/stb_textedit.h" +#include "Forge/stb/stb_textedit.h" // stb_textedit internally allows for a single undo record to do addition and deletion, but somehow, calling // the stb_textedit_paste() function creates two separate records, so we perform it manually. (FIXME: Report to nothings/stb?) diff --git a/Forge/Common_3/Application/UI/UI.cpp b/Forge/Common_3/Application/UI/UI.cpp index 11b30cee75..e08c800601 100644 --- a/Forge/Common_3/Application/UI/UI.cpp +++ b/Forge/Common_3/Application/UI/UI.cpp @@ -35,7 +35,7 @@ #include "../../Utilities/Math/Algorithms.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(TARGET_IOS) || defined(__ANDROID__) || defined(NX64) #define TOUCH_INPUT 1 diff --git a/Forge/Common_3/Graphics/CommonShaderReflection.cpp b/Forge/Common_3/Graphics/CommonShaderReflection.cpp index 82b263dd84..c2a7782224 100644 --- a/Forge/Common_3/Graphics/CommonShaderReflection.cpp +++ b/Forge/Common_3/Graphics/CommonShaderReflection.cpp @@ -22,12 +22,12 @@ * under the License. */ -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Forge/TF_Log.h" #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // This file contains shader reflection code that is the same for all platforms. // We know it's the same for all platforms since it only interacts with the diff --git a/Forge/Common_3/Graphics/GraphicsConfig.cpp b/Forge/Common_3/Graphics/GraphicsConfig.cpp index 9b3d24f819..ce2f7e0571 100644 --- a/Forge/Common_3/Graphics/GraphicsConfig.cpp +++ b/Forge/Common_3/Graphics/GraphicsConfig.cpp @@ -24,13 +24,13 @@ #include "Common_3/Graphics/GraphicsConfig.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/TF_FileSystem.h" #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /////////////////////////////////////////////////////////// // HELPER DECLARATIONS diff --git a/Forge/Common_3/Graphics/Interfaces/IRay.h b/Forge/Common_3/Graphics/Interfaces/IRay.h index 593e036d07..9a78a40a84 100644 --- a/Forge/Common_3/Graphics/Interfaces/IRay.h +++ b/Forge/Common_3/Graphics/Interfaces/IRay.h @@ -25,7 +25,7 @@ #pragma once #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/TF_Types.h" +#include "Forge/TF_Types.h" #ifdef METAL #import diff --git a/Forge/Common_3/Graphics/Metal/MetalRaytracing.mm b/Forge/Common_3/Graphics/Metal/MetalRaytracing.mm index 7ace5aea21..257041baa8 100644 --- a/Forge/Common_3/Graphics/Metal/MetalRaytracing.mm +++ b/Forge/Common_3/Graphics/Metal/MetalRaytracing.mm @@ -39,7 +39,7 @@ #import "../../Resources/ResourceLoader/Interfaces/IResourceLoader.h" #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(MTL_RAYTRACING_AVAILABLE) diff --git a/Forge/Common_3/Graphics/Metal/MetalRenderer.mm b/Forge/Common_3/Graphics/Metal/MetalRenderer.mm index 22cfb8deec..56aa3e0ca0 100644 --- a/Forge/Common_3/Graphics/Metal/MetalRenderer.mm +++ b/Forge/Common_3/Graphics/Metal/MetalRenderer.mm @@ -65,7 +65,7 @@ #include "MetalCapBuilder.h" #include "MetalMemoryAllocatorImpl.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(AUTOMATED_TESTING) #include "IScreenshot.h" diff --git a/Forge/Common_3/Graphics/Metal/MetalShaderReflection.mm b/Forge/Common_3/Graphics/Metal/MetalShaderReflection.mm index 06b8a9703f..bdf1fdf28b 100644 --- a/Forge/Common_3/Graphics/Metal/MetalShaderReflection.mm +++ b/Forge/Common_3/Graphics/Metal/MetalShaderReflection.mm @@ -28,13 +28,13 @@ #include -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/Graphics/TF_Graphics.h" #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define MAX_REFLECT_STRING_LENGTH 128 #define MAX_BUFFER_BINDINGS 31 diff --git a/Forge/Common_3/Graphics/OpenGLES/EGLContextCreator.cpp b/Forge/Common_3/Graphics/OpenGLES/EGLContextCreator.cpp index 9902f3ee36..5a15e58a7c 100644 --- a/Forge/Common_3/Graphics/OpenGLES/EGLContextCreator.cpp +++ b/Forge/Common_3/Graphics/OpenGLES/EGLContextCreator.cpp @@ -33,7 +33,7 @@ #include "GLESContextCreator.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" void* gDisplay = EGL_NO_DISPLAY; thread_local EGLSurface gPlaceholderSurface = EGL_NO_SURFACE; diff --git a/Forge/Common_3/Graphics/OpenGLES/GLES.cpp b/Forge/Common_3/Graphics/OpenGLES/GLES.cpp index c9ff6a98a6..13b5320b3f 100644 --- a/Forge/Common_3/Graphics/OpenGLES/GLES.cpp +++ b/Forge/Common_3/Graphics/OpenGLES/GLES.cpp @@ -34,7 +34,7 @@ #include "Forge/Graphics/tinyimageformat/tinyimageformat_apis.h" #include "Forge/Graphics/tinyimageformat/tinyimageformat_base.h" #include "Forge/Graphics/tinyimageformat/tinyimageformat_query.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/TF_Log.h" @@ -51,7 +51,7 @@ #include "OpenGL/GLES2/gl2.h" #include "OpenGL/GLES2/gl2ext.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" extern void gles_createShaderReflection(Shader* pProgram, ShaderReflection* pOutReflection, const BinaryShaderDesc* pDesc); diff --git a/Forge/Common_3/Graphics/OpenGLES/GLESShaderReflection.cpp b/Forge/Common_3/Graphics/OpenGLES/GLESShaderReflection.cpp index a200d9aeae..611499cf80 100644 --- a/Forge/Common_3/Graphics/OpenGLES/GLESShaderReflection.cpp +++ b/Forge/Common_3/Graphics/OpenGLES/GLESShaderReflection.cpp @@ -31,7 +31,7 @@ #include "Forge/TF_Log.h" #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" inline const char* util_get_enum_string(GLenum value) { diff --git a/Forge/Common_3/Graphics/Quest/VrApiHooks.cpp b/Forge/Common_3/Graphics/Quest/VrApiHooks.cpp index 76f5caf469..df601b11d8 100644 --- a/Forge/Common_3/Graphics/Quest/VrApiHooks.cpp +++ b/Forge/Common_3/Graphics/Quest/VrApiHooks.cpp @@ -33,7 +33,7 @@ #include "../../OS/Quest/VrApi.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" Queue* pSynchronisationQueue = NULL; RenderTarget* pFragmentDensityMask = NULL; diff --git a/Forge/Common_3/Graphics/ThirdParty/OpenSource/VulkanMemoryAllocator/TFVulkanMemoryAllocatorConfig.h b/Forge/Common_3/Graphics/ThirdParty/OpenSource/VulkanMemoryAllocator/TFVulkanMemoryAllocatorConfig.h index e98e8ca5f8..35c9d4b084 100644 --- a/Forge/Common_3/Graphics/ThirdParty/OpenSource/VulkanMemoryAllocator/TFVulkanMemoryAllocatorConfig.h +++ b/Forge/Common_3/Graphics/ThirdParty/OpenSource/VulkanMemoryAllocator/TFVulkanMemoryAllocatorConfig.h @@ -39,7 +39,7 @@ #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "Forge/TF_Log.h" #include "Forge/TF_Thread.h" diff --git a/Forge/Common_3/OS/Android/AndroidBase.cpp b/Forge/Common_3/OS/Android/AndroidBase.cpp index 2f40c7f1b6..ddf284396c 100644 --- a/Forge/Common_3/OS/Android/AndroidBase.cpp +++ b/Forge/Common_3/OS/Android/AndroidBase.cpp @@ -60,7 +60,7 @@ #include "../Quest/VrApi.h" #endif -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static IApp* pApp = NULL; static WindowDesc* gWindowDesc = nullptr; diff --git a/Forge/Common_3/OS/Android/AndroidFileSystem.cpp b/Forge/Common_3/OS/Android/AndroidFileSystem.cpp index a43475686d..5c71b8d210 100644 --- a/Forge/Common_3/OS/Android/AndroidFileSystem.cpp +++ b/Forge/Common_3/OS/Android/AndroidFileSystem.cpp @@ -33,7 +33,7 @@ #include "Forge/TF_Log.h" #include "Common_3/OS/Interfaces/IOperatingSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" extern "C" { diff --git a/Forge/Common_3/OS/Android/AndroidLog.c b/Forge/Common_3/OS/Android/AndroidLog.c index a9d7bd9287..8935a2db73 100644 --- a/Forge/Common_3/OS/Android/AndroidLog.c +++ b/Forge/Common_3/OS/Android/AndroidLog.c @@ -35,7 +35,7 @@ #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static bool gIsInteractiveMode = true; diff --git a/Forge/Common_3/OS/Android/AndroidThread.c b/Forge/Common_3/OS/Android/AndroidThread.c index aefb132efc..8f6ad5d197 100644 --- a/Forge/Common_3/OS/Android/AndroidThread.c +++ b/Forge/Common_3/OS/Android/AndroidThread.c @@ -37,7 +37,7 @@ #include "../../Utilities/Threading/UnixThreadID.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define NSEC_PER_USEC 1000ull #define USEC_PER_SEC 1000000ull diff --git a/Forge/Common_3/OS/Darwin/CocoaFileSystem.mm b/Forge/Common_3/OS/Darwin/CocoaFileSystem.mm index 593fe57526..a3da10c0e1 100644 --- a/Forge/Common_3/OS/Darwin/CocoaFileSystem.mm +++ b/Forge/Common_3/OS/Darwin/CocoaFileSystem.mm @@ -30,7 +30,7 @@ #include "Forge/TF_Log.h" #include "Common_3/OS/Interfaces/IOperatingSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static bool gInitialized = false; static const char* gResourceMounts[RM_COUNT]; diff --git a/Forge/Common_3/OS/Darwin/CocoaToolsFileSystem.mm b/Forge/Common_3/OS/Darwin/CocoaToolsFileSystem.mm index 082dcace33..1237bc0ef9 100644 --- a/Forge/Common_3/OS/Darwin/CocoaToolsFileSystem.mm +++ b/Forge/Common_3/OS/Darwin/CocoaToolsFileSystem.mm @@ -27,7 +27,7 @@ #include "Forge/TF_Log.h" #include "../../Utilities/Interfaces/IToolFileSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #pragma mark - FileWatcher diff --git a/Forge/Common_3/OS/Darwin/DarwinLog.c b/Forge/Common_3/OS/Darwin/DarwinLog.c index 210d9c30df..709407f246 100644 --- a/Forge/Common_3/OS/Darwin/DarwinLog.c +++ b/Forge/Common_3/OS/Darwin/DarwinLog.c @@ -32,7 +32,7 @@ // interfaces #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static bool gIsInteractiveMode = true; diff --git a/Forge/Common_3/OS/Darwin/DarwinThread.c b/Forge/Common_3/OS/Darwin/DarwinThread.c index a78294f67c..6a5bf0b3ca 100644 --- a/Forge/Common_3/OS/Darwin/DarwinThread.c +++ b/Forge/Common_3/OS/Darwin/DarwinThread.c @@ -35,7 +35,7 @@ #include "../../Utilities/Threading/UnixThreadID.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(ENABLE_THREAD_PERFORMANCE_STATS) #include diff --git a/Forge/Common_3/OS/Darwin/iOSBase.mm b/Forge/Common_3/OS/Darwin/iOSBase.mm index 8cf27b67af..f933dee98c 100644 --- a/Forge/Common_3/OS/Darwin/iOSBase.mm +++ b/Forge/Common_3/OS/Darwin/iOSBase.mm @@ -55,7 +55,7 @@ #import "iOSAppDelegate.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define FORGE_WINDOW_CLASS L"The Forge" #define MAX_KEYS 256 diff --git a/Forge/Common_3/OS/Darwin/iOSWindow.mm b/Forge/Common_3/OS/Darwin/iOSWindow.mm index f30930223f..9e66fd05f1 100644 --- a/Forge/Common_3/OS/Darwin/iOSWindow.mm +++ b/Forge/Common_3/OS/Darwin/iOSWindow.mm @@ -31,7 +31,7 @@ #import #import -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Application/Interfaces/IApp.h" #include "Forge/TF_Log.h" diff --git a/Forge/Common_3/OS/Darwin/macOSBase.mm b/Forge/Common_3/OS/Darwin/macOSBase.mm index 4d25a67edc..44b8963713 100644 --- a/Forge/Common_3/OS/Darwin/macOSBase.mm +++ b/Forge/Common_3/OS/Darwin/macOSBase.mm @@ -56,7 +56,7 @@ #endif #include "../../Utilities/Math/MathTypes.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define FORGE_WINDOW_CLASS L"The Forge" #define MAX_KEYS 256 diff --git a/Forge/Common_3/OS/Darwin/macOSWindow.mm b/Forge/Common_3/OS/Darwin/macOSWindow.mm index 4207c4e653..5570187056 100644 --- a/Forge/Common_3/OS/Darwin/macOSWindow.mm +++ b/Forge/Common_3/OS/Darwin/macOSWindow.mm @@ -33,7 +33,7 @@ #import #include // Needed for debugger check -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Application/Interfaces/IApp.h" #include "Forge/TF_Log.h" diff --git a/Forge/Common_3/OS/Interfaces/IOperatingSystem.h b/Forge/Common_3/OS/Interfaces/IOperatingSystem.h index de4c48a059..ec9f54a1a5 100644 --- a/Forge/Common_3/OS/Interfaces/IOperatingSystem.h +++ b/Forge/Common_3/OS/Interfaces/IOperatingSystem.h @@ -93,7 +93,7 @@ typedef uint64_t uint64; //#endif #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if !defined(_WINDOWS) && !defined(XBOX) #include diff --git a/Forge/Common_3/OS/Linux/LinuxBase.cpp b/Forge/Common_3/OS/Linux/LinuxBase.cpp index 6d22922a34..187bed98a6 100644 --- a/Forge/Common_3/OS/Linux/LinuxBase.cpp +++ b/Forge/Common_3/OS/Linux/LinuxBase.cpp @@ -56,7 +56,7 @@ #include "../../Utilities/Math/MathTypes.h" #include "Common_3/OS/CPUConfig.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static IApp* pApp = NULL; static WindowDesc* gWindowDesc = NULL; diff --git a/Forge/Common_3/OS/Linux/LinuxThread.c b/Forge/Common_3/OS/Linux/LinuxThread.c index a11d762cca..4ff704b880 100644 --- a/Forge/Common_3/OS/Linux/LinuxThread.c +++ b/Forge/Common_3/OS/Linux/LinuxThread.c @@ -34,7 +34,7 @@ #include "../../Utilities/Threading/UnixThreadID.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(ENABLE_THREAD_PERFORMANCE_STATS) #include diff --git a/Forge/Common_3/OS/Linux/LinuxToolsFileSystem.c b/Forge/Common_3/OS/Linux/LinuxToolsFileSystem.c index 2936f02fb6..f91cd9eb1e 100644 --- a/Forge/Common_3/OS/Linux/LinuxToolsFileSystem.c +++ b/Forge/Common_3/OS/Linux/LinuxToolsFileSystem.c @@ -37,7 +37,7 @@ #include "Forge/TF_Thread.h" #include "../../Utilities/Interfaces/IToolFileSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" struct FileWatcher { diff --git a/Forge/Common_3/OS/Linux/LinuxWindow.cpp b/Forge/Common_3/OS/Linux/LinuxWindow.cpp index 6aa98023d1..6888ea543d 100644 --- a/Forge/Common_3/OS/Linux/LinuxWindow.cpp +++ b/Forge/Common_3/OS/Linux/LinuxWindow.cpp @@ -47,7 +47,7 @@ #include "../../Utilities/Math/MathTypes.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" //------------------------------------------------------------------------ // STATIC STRUCTS diff --git a/Forge/Common_3/OS/Quest/VrApi.cpp b/Forge/Common_3/OS/Quest/VrApi.cpp index 171ed3b368..7aa5099c3f 100644 --- a/Forge/Common_3/OS/Quest/VrApi.cpp +++ b/Forge/Common_3/OS/Quest/VrApi.cpp @@ -35,7 +35,7 @@ #include "VrApi.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" QuestVR* pQuest = NULL; diff --git a/Forge/Common_3/OS/Windows/WindowsBase.cpp b/Forge/Common_3/OS/Windows/WindowsBase.cpp index 652b24a4cc..515e6874a7 100644 --- a/Forge/Common_3/OS/Windows/WindowsBase.cpp +++ b/Forge/Common_3/OS/Windows/WindowsBase.cpp @@ -35,7 +35,7 @@ #pragma comment(lib, "shlwapi.lib") #endif -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "../../Utilities/ThirdParty/OpenSource/rmem/inc/rmem.h" @@ -58,7 +58,7 @@ #endif #include "../../Utilities/Math/MathTypes.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef ENABLE_FORGE_STACKTRACE_DUMP #include "WindowsStackTraceDump.h" diff --git a/Forge/Common_3/OS/Windows/WindowsFileSystem.cpp b/Forge/Common_3/OS/Windows/WindowsFileSystem.cpp index bb0c09b2ec..017999bc40 100644 --- a/Forge/Common_3/OS/Windows/WindowsFileSystem.cpp +++ b/Forge/Common_3/OS/Windows/WindowsFileSystem.cpp @@ -41,7 +41,7 @@ #include "Forge/TF_Thread.h" #include "Common_3/OS/Interfaces/IOperatingSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" template static inline T withUTF16Path(const char* path, T (*function)(const wchar_t*)) diff --git a/Forge/Common_3/OS/Windows/WindowsThread.c b/Forge/Common_3/OS/Windows/WindowsThread.c index c0d85bf7a0..96f1e38e20 100644 --- a/Forge/Common_3/OS/Windows/WindowsThread.c +++ b/Forge/Common_3/OS/Windows/WindowsThread.c @@ -30,7 +30,7 @@ #include "Forge/TF_Thread.h" #include "Common_3/OS/Interfaces/IOperatingSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(ENABLE_THREAD_PERFORMANCE_STATS) diff --git a/Forge/Common_3/OS/Windows/WindowsToolsFileSystem.cpp b/Forge/Common_3/OS/Windows/WindowsToolsFileSystem.cpp index 6412977ec7..423977a2c3 100644 --- a/Forge/Common_3/OS/Windows/WindowsToolsFileSystem.cpp +++ b/Forge/Common_3/OS/Windows/WindowsToolsFileSystem.cpp @@ -35,7 +35,7 @@ #include "commdlg.h" #include "shlobj.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // static template diff --git a/Forge/Common_3/OS/Windows/WindowsWindow.cpp b/Forge/Common_3/OS/Windows/WindowsWindow.cpp index c356be23fd..4db37bad8c 100644 --- a/Forge/Common_3/OS/Windows/WindowsWindow.cpp +++ b/Forge/Common_3/OS/Windows/WindowsWindow.cpp @@ -24,7 +24,7 @@ #include "Forge/Config.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "../../Application/Interfaces/IApp.h" diff --git a/Forge/Common_3/Renderer/VisibilityBuffer/VisibilityBuffer.cpp b/Forge/Common_3/Renderer/VisibilityBuffer/VisibilityBuffer.cpp index 7833d8c36a..8c4ab68e38 100644 --- a/Forge/Common_3/Renderer/VisibilityBuffer/VisibilityBuffer.cpp +++ b/Forge/Common_3/Renderer/VisibilityBuffer/VisibilityBuffer.cpp @@ -33,7 +33,7 @@ #include "../VisibilityBuffer/Shaders/FSL/vb_structs.h.fsl" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /************************************************************************/ // Settings diff --git a/Forge/Common_3/Renderer/VisibilityBuffer2/VisibilityBuffer2.cpp b/Forge/Common_3/Renderer/VisibilityBuffer2/VisibilityBuffer2.cpp index df4c7b1810..fe2ddaa2fb 100644 --- a/Forge/Common_3/Renderer/VisibilityBuffer2/VisibilityBuffer2.cpp +++ b/Forge/Common_3/Renderer/VisibilityBuffer2/VisibilityBuffer2.cpp @@ -33,7 +33,7 @@ #define NO_FSL_DEFINITIONS #include "../VisibilityBuffer2/Shaders/FSL/vb_structs.h.fsl" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /************************************************************************/ // Settings diff --git a/Forge/Common_3/Resources/AnimationSystem/Animation/AnimatedObject.cpp b/Forge/Common_3/Resources/AnimationSystem/Animation/AnimatedObject.cpp index f4c0ba7de8..3c4559f1d2 100644 --- a/Forge/Common_3/Resources/AnimationSystem/Animation/AnimatedObject.cpp +++ b/Forge/Common_3/Resources/AnimationSystem/Animation/AnimatedObject.cpp @@ -27,7 +27,7 @@ #include "../ThirdParty/OpenSource/ozz-animation/include/ozz/animation/runtime/ik_aim_job.h" #include "../ThirdParty/OpenSource/ozz-animation/include/ozz/animation/runtime/ik_two_bone_job.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" namespace { diff --git a/Forge/Common_3/Resources/AnimationSystem/Animation/SkeletonBatcher.cpp b/Forge/Common_3/Resources/AnimationSystem/Animation/SkeletonBatcher.cpp index bc1728e00d..6c285df4ec 100644 --- a/Forge/Common_3/Resources/AnimationSystem/Animation/SkeletonBatcher.cpp +++ b/Forge/Common_3/Resources/AnimationSystem/Animation/SkeletonBatcher.cpp @@ -24,7 +24,7 @@ #include "SkeletonBatcher.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" void SkeletonBatcher::Initialize(const SkeletonRenderDesc& skeletonRenderDesc) { diff --git a/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/TressFX/TressFXAsset.cpp b/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/TressFX/TressFXAsset.cpp index eb7fec7fce..ed7fa5bea2 100644 --- a/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/TressFX/TressFXAsset.cpp +++ b/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/TressFX/TressFXAsset.cpp @@ -29,7 +29,7 @@ #include "TressFXAsset.h" #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define AMD_TRESSFX_V4 4 #define AMD_TRESSFX_V3 3 diff --git a/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/include/ozz/base/containers/vector.h b/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/include/ozz/base/containers/vector.h index 9ec4b3e594..6419f47387 100644 --- a/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/include/ozz/base/containers/vector.h +++ b/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/include/ozz/base/containers/vector.h @@ -29,7 +29,7 @@ #define OZZ_OZZ_BASE_CONTAINERS_VECTOR_H_ -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" namespace ozz { diff --git a/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/src/base/memory/allocator.cc b/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/src/base/memory/allocator.cc index 6625af7a6a..1589b2f29e 100644 --- a/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/src/base/memory/allocator.cc +++ b/Forge/Common_3/Resources/AnimationSystem/ThirdParty/OpenSource/ozz-animation/src/base/memory/allocator.cc @@ -35,7 +35,7 @@ #include "../../../include/ozz/base/maths/math_ex.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" namespace ozz { namespace memory { diff --git a/Forge/Common_3/Resources/ResourceLoader/Interfaces/IResourceLoader.h b/Forge/Common_3/Resources/ResourceLoader/Interfaces/IResourceLoader.h index a6e3f0ccf3..14c357b9e5 100644 --- a/Forge/Common_3/Resources/ResourceLoader/Interfaces/IResourceLoader.h +++ b/Forge/Common_3/Resources/ResourceLoader/Interfaces/IResourceLoader.h @@ -25,7 +25,7 @@ #pragma once #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/TF_Types.h" +#include "Forge/TF_Types.h" #include "Common_3/Graphics/GraphicsConfig.h" #include "../../../Utilities/Math/MathTypes.h" diff --git a/Forge/Common_3/Resources/ResourceLoader/ResourceLoader.cpp b/Forge/Common_3/Resources/ResourceLoader/ResourceLoader.cpp index ee6b820036..f91c9c82d1 100644 --- a/Forge/Common_3/Resources/ResourceLoader/ResourceLoader.cpp +++ b/Forge/Common_3/Resources/ResourceLoader/ResourceLoader.cpp @@ -22,7 +22,7 @@ * under the License. */ -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/Graphics/tinyimageformat/tinyimageformat_apis.h" #include "Forge/Graphics/tinyimageformat/tinyimageformat_base.h" @@ -51,7 +51,7 @@ #include "TextureContainers.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifdef NX64 #include "../../Utilities/ThirdParty/OpenSource/murmurhash3/MurmurHash3_32.h" diff --git a/Forge/Common_3/Resources/ResourceLoader/ThirdParty/OpenSource/cgltf/GLTFLoader.h b/Forge/Common_3/Resources/ResourceLoader/ThirdParty/OpenSource/cgltf/GLTFLoader.h index e952d87c3d..19d6c55fdf 100644 --- a/Forge/Common_3/Resources/ResourceLoader/ThirdParty/OpenSource/cgltf/GLTFLoader.h +++ b/Forge/Common_3/Resources/ResourceLoader/ThirdParty/OpenSource/cgltf/GLTFLoader.h @@ -8,7 +8,7 @@ #include "../../../../../Utilities/Math/MathTypes.h" #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // MARK: - Materials diff --git a/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.cpp b/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.cpp index f0f52b649b..4d4b618487 100644 --- a/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.cpp +++ b/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.cpp @@ -68,7 +68,7 @@ #include "../../../Resources/ResourceLoader/TextureContainers.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" extern "C" { diff --git a/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.h b/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.h index 3b34e8e0e1..038d3ac2bb 100644 --- a/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.h +++ b/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline.h @@ -33,7 +33,7 @@ #include "../../../Utilities/Interfaces/IToolFileSystem.h" #include "AssetPipelineConfig.h" -#include "Forge/Core/TF_Types.h" +#include "Forge/TF_Types.h" #define STRCMP(a, b) (stricmp(a, b) == 0) diff --git a/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline_Textures.cpp b/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline_Textures.cpp index 33c65c8a6a..6f5fa24358 100644 --- a/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline_Textures.cpp +++ b/Forge/Common_3/Tools/AssetPipeline/src/AssetPipeline_Textures.cpp @@ -49,12 +49,12 @@ #define STBI_REALLOC(p, newsz) tf_realloc(p, newsz) #define STBI_FREE(p) tf_free(p) #define STB_IMAGE_IMPLEMENTATION -#include "Forge/Core/Nothings/stb_image.h" +#include "Forge/stb/stb_image.h" #define STB_IMAGE_RESIZE_IMPLEMENTATION -#include "Forge/Core/Nothings/stb_ds.h" -#include "Forge/Core/Nothings/stb_image_resize.h" +#include "Forge/stb/stb_ds.h" +#include "Forge/stb/stb_image_resize.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define IS_POWER_OF_TWO(x) ((x) != 0 && ((x) & ((x)-1)) == 0) diff --git a/Forge/Common_3/Tools/BunyArchive/Buny.c b/Forge/Common_3/Tools/BunyArchive/Buny.c index 9c27c78dbf..e395b6289c 100644 --- a/Forge/Common_3/Tools/BunyArchive/Buny.c +++ b/Forge/Common_3/Tools/BunyArchive/Buny.c @@ -25,7 +25,7 @@ #define BUNYAR_LIB_INTERNAL #include "Buny.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Forge/TF_Log.h" #include "Forge/TF_Thread.h" diff --git a/Forge/Common_3/Tools/UIRemoteControl/src/UIRemoteControl.cpp b/Forge/Common_3/Tools/UIRemoteControl/src/UIRemoteControl.cpp index b5ec5d2b58..d03a4b1ceb 100644 --- a/Forge/Common_3/Tools/UIRemoteControl/src/UIRemoteControl.cpp +++ b/Forge/Common_3/Tools/UIRemoteControl/src/UIRemoteControl.cpp @@ -42,7 +42,7 @@ // Math #include "../../../../Common_3/Utilities/Math/MathTypes.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // Remote Control - client functions extern void remoteControlConnect(const char* hostName, uint16_t port); diff --git a/Forge/Common_3/Utilities/FileSystem/FileSystem.c b/Forge/Common_3/Utilities/FileSystem/FileSystem.c index ea88df3b11..0374e11b3e 100644 --- a/Forge/Common_3/Utilities/FileSystem/FileSystem.c +++ b/Forge/Common_3/Utilities/FileSystem/FileSystem.c @@ -31,7 +31,7 @@ #include"Forge/TF_Thread.h" #include "Forge/Core/TF_Time.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // This macro enables custom ZSTD allocator features #define ZSTD_STATIC_LINKING_ONLY diff --git a/Forge/Common_3/Utilities/FileSystem/SystemRun.c b/Forge/Common_3/Utilities/FileSystem/SystemRun.c index 48baf14af4..a99a19b0cb 100644 --- a/Forge/Common_3/Utilities/FileSystem/SystemRun.c +++ b/Forge/Common_3/Utilities/FileSystem/SystemRun.c @@ -25,7 +25,7 @@ #include #include -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Common_3/OS/Interfaces/IOperatingSystem.h" diff --git a/Forge/Common_3/Utilities/Math/Algorithms.c b/Forge/Common_3/Utilities/Math/Algorithms.c index aa88b87226..1247425d1a 100644 --- a/Forge/Common_3/Utilities/Math/Algorithms.c +++ b/Forge/Common_3/Utilities/Math/Algorithms.c @@ -28,7 +28,7 @@ #include "AlgorithmsImpl.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // SIMPLE SORT // Used for array sizes 0..5 diff --git a/Forge/Common_3/Utilities/Math/BStringHashMap.h b/Forge/Common_3/Utilities/Math/BStringHashMap.h index 276f59429f..bb70f9e9eb 100644 --- a/Forge/Common_3/Utilities/Math/BStringHashMap.h +++ b/Forge/Common_3/Utilities/Math/BStringHashMap.h @@ -26,7 +26,7 @@ #include "Forge/Config.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../ThirdParty/OpenSource/bstrlib/bstrlib.h" #ifdef __cplusplus diff --git a/Forge/Common_3/Utilities/Math/Random.h b/Forge/Common_3/Utilities/Math/Random.h index 2cbc40bdc8..f2a047748a 100644 --- a/Forge/Common_3/Utilities/Math/Random.h +++ b/Forge/Common_3/Utilities/Math/Random.h @@ -28,6 +28,8 @@ #include #include +#include "Forge/TF_Types.h" + #include "../../Utilities/ThirdParty/OpenSource/murmurhash3/MurmurHash3_32.h" #define TF_RAND_MAX 0x7FFFFFFF diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/ModifiedSonyMath/common.hpp b/Forge/Common_3/Utilities/ThirdParty/OpenSource/ModifiedSonyMath/common.hpp index acbaffa4a2..fc05497066 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/ModifiedSonyMath/common.hpp +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/ModifiedSonyMath/common.hpp @@ -10,7 +10,7 @@ #include #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "../../../../Utilities/Math/Random.h" #include "Forge/TF_Log.h" diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Include/Platform/Posix/MTFiber.h b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Include/Platform/Posix/MTFiber.h index b6caf6ec6b..95218e910c 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Include/Platform/Posix/MTFiber.h +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Include/Platform/Posix/MTFiber.h @@ -324,7 +324,7 @@ namespace MT #else #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "Forge/TF_Log.h" #define MCO_ALLOC(size) tf_calloc(1, size) #define MCO_DEALLOC(ptr, size) tf_free(ptr) diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Source/MTDefaultAppInterop.cpp b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Source/MTDefaultAppInterop.cpp index 47a41dd564..05583c7bd1 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Source/MTDefaultAppInterop.cpp +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TaskScheduler/Scheduler/Source/MTDefaultAppInterop.cpp @@ -29,7 +29,7 @@ #include #endif -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if MT_PLATFORM_WINDOWS diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.cpp b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.cpp index 0e5cfedef4..ac2ea238bd 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.cpp +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.cpp @@ -29,7 +29,7 @@ distribution. #include #include "Forge/TF_FileSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" namespace tinyxml2 { diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.h b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.h index 2039bbebca..51d9e23fcd 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.h +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/TinyXML2/tinyxml2.h @@ -32,7 +32,7 @@ distribution. #include "Forge/TF_FileSystem.h" #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /* TODO: intern strings instead of allocation. diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.c b/Forge/Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.c index 2d569a8d5d..9a864ea8da 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.c +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.c @@ -13,7 +13,7 @@ #include "Forge/Config.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include #include @@ -51,7 +51,7 @@ bool gIsBstrlibTest = false; #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /* Optionally include a mechanism for debugging memory */ diff --git a/Forge/Common_3/Utilities/ThirdParty/OpenSource/cJSON/cJSON.c b/Forge/Common_3/Utilities/ThirdParty/OpenSource/cJSON/cJSON.c index 87553b7e69..47470c1053 100644 --- a/Forge/Common_3/Utilities/ThirdParty/OpenSource/cJSON/cJSON.c +++ b/Forge/Common_3/Utilities/ThirdParty/OpenSource/cJSON/cJSON.c @@ -58,7 +58,7 @@ #include "cJSON.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" /* define our own boolean type */ #ifdef true diff --git a/Forge/Common_3/Utilities/Threading/ThreadSystem.c b/Forge/Common_3/Utilities/Threading/ThreadSystem.c index 75f28e250e..539a2dcb03 100644 --- a/Forge/Common_3/Utilities/Threading/ThreadSystem.c +++ b/Forge/Common_3/Utilities/Threading/ThreadSystem.c @@ -24,7 +24,7 @@ #include "ThreadSystem.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Forge/TF_Log.h" #include "Forge/TF_Thread.h" diff --git a/Forge/Config.h b/Forge/Config.h index 4d31f51089..674f4792e2 100644 --- a/Forge/Config.h +++ b/Forge/Config.h @@ -69,8 +69,6 @@ #define QUOTE(x) _QUOTE(x) #endif -#define TF_ARRAY_COUNT(array) (sizeof(array) / (sizeof(array[0]) * (sizeof(array) != PTR_SIZE || sizeof(array[0]) <= PTR_SIZE))) - #ifndef TF_MIN #define TF_MIN(a, b) ((a) < (b) ? (a) : (b)) #endif diff --git a/Forge/Core/TF_Core.cpp b/Forge/Core/TF_Core.cpp index e4fbd971a2..518f0dcfc6 100644 --- a/Forge/Core/TF_Core.cpp +++ b/Forge/Core/TF_Core.cpp @@ -2,5 +2,5 @@ //#define STB_DS_IMPLEMENTATION 1 #define STB_TRUETYPE_IMPLEMENTATION 1 //#include "stb/stb_ds.h" -#include "Forge/Core/Nothings/stb_truetype.h" +#include "Forge/stb/stb_truetype.h" diff --git a/Forge/Core/TF_Core.h b/Forge/Core/TF_Core.h deleted file mode 100644 index 0cbab48acd..0000000000 --- a/Forge/Core/TF_Core.h +++ /dev/null @@ -1,16 +0,0 @@ -// core types and libraries - - -#include -#include -#include -#include -#include -#include -#include -#include -#include - - -// stb -#include "Forge/Core/Nothings/stb_ds.h" diff --git a/Forge/Formats/TF_gltf.cpp b/Forge/Formats/TF_gltf.cpp index 7730b91169..9a21ca8c1d 100644 --- a/Forge/Formats/TF_gltf.cpp +++ b/Forge/Formats/TF_gltf.cpp @@ -1,5 +1,5 @@ #include "Forge/Formats/TF_gltf.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define CGLTF_MALLOC tf_malloc #define CGLTF_FREE tf_free diff --git a/Forge/Graphics/Direct3D11/Direct3D11.cpp b/Forge/Graphics/Direct3D11/Direct3D11.cpp index 1149a2c6fa..1710155fbb 100644 --- a/Forge/Graphics/Direct3D11/Direct3D11.cpp +++ b/Forge/Graphics/Direct3D11/Direct3D11.cpp @@ -36,7 +36,7 @@ #include "Forge/Graphics/tinyimageformat/tinyimageformat_apis.h" #include "Forge/Graphics/tinyimageformat/tinyimageformat_base.h" #include "Forge/Graphics/tinyimageformat/tinyimageformat_query.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/TF_FileSystem.h" @@ -66,7 +66,7 @@ extern "C" __declspec(dllexport) int AmdPowerXpressRequestHighPerformance = 1; } -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(AUTOMATED_TESTING) #include "../../Application/Interfaces/IScreenshot.h" diff --git a/Forge/Graphics/Direct3D11/Direct3D11ShaderReflection.cpp b/Forge/Graphics/Direct3D11/Direct3D11ShaderReflection.cpp index bb8444b1c1..9512cad1de 100644 --- a/Forge/Graphics/Direct3D11/Direct3D11ShaderReflection.cpp +++ b/Forge/Graphics/Direct3D11/Direct3D11ShaderReflection.cpp @@ -31,7 +31,7 @@ #include "Forge/TF_Log.h" #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static DescriptorType sD3D11_TO_DESCRIPTOR[] = { DESCRIPTOR_TYPE_UNIFORM_BUFFER, // D3D_SIT_CBUFFER diff --git a/Forge/Graphics/Direct3D12/Direct3D12.cpp b/Forge/Graphics/Direct3D12/Direct3D12.cpp index c8328dd1dc..fdb22523bf 100644 --- a/Forge/Graphics/Direct3D12/Direct3D12.cpp +++ b/Forge/Graphics/Direct3D12/Direct3D12.cpp @@ -38,7 +38,7 @@ #include #define D3D12MA_IMPLEMENTATION -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Common_3/Graphics/ThirdParty/OpenSource/D3D12MemoryAllocator/Direct3D12MemoryAllocator.h" @@ -85,7 +85,7 @@ #error "D3D12 requires C++! Sorry!" #endif -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #define D3D12_GPU_VIRTUAL_ADDRESS_NULL ((D3D12_GPU_VIRTUAL_ADDRESS)0) #define D3D12_GPU_VIRTUAL_ADDRESS_UNKNOWN ((D3D12_GPU_VIRTUAL_ADDRESS)-1) diff --git a/Forge/Graphics/Direct3D12/Direct3D12Hooks.cpp b/Forge/Graphics/Direct3D12/Direct3D12Hooks.cpp index 6ba739815c..c5f4d7c185 100644 --- a/Forge/Graphics/Direct3D12/Direct3D12Hooks.cpp +++ b/Forge/Graphics/Direct3D12/Direct3D12Hooks.cpp @@ -30,7 +30,7 @@ #include "Forge/Graphics/TF_Graphics.h" #include "Common_3/Utilities/Math/MathTypes.h" #include "Forge/Graphics/Direct3D12/Direct3D12Hooks.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #ifndef SAFE_RELEASE #define SAFE_RELEASE(p_var) \ diff --git a/Forge/Graphics/Direct3D12/Direct3D12Raytracing.cpp b/Forge/Graphics/Direct3D12/Direct3D12Raytracing.cpp index be3ed85e5f..15de1a7261 100644 --- a/Forge/Graphics/Direct3D12/Direct3D12Raytracing.cpp +++ b/Forge/Graphics/Direct3D12/Direct3D12Raytracing.cpp @@ -36,7 +36,7 @@ #endif // OS -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Forge/TF_Log.h" @@ -50,7 +50,7 @@ #include "Forge/Graphics/Direct3D12/Direct3D12Hooks.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" // check if WindowsSDK is used which supports raytracing #ifdef D3D12_RAYTRACING_AVAILABLE diff --git a/Forge/Graphics/Direct3D12/Direct3D12ShaderReflection.cpp b/Forge/Graphics/Direct3D12/Direct3D12ShaderReflection.cpp index 423b3fc576..18c9422a8d 100644 --- a/Forge/Graphics/Direct3D12/Direct3D12ShaderReflection.cpp +++ b/Forge/Graphics/Direct3D12/Direct3D12ShaderReflection.cpp @@ -35,7 +35,7 @@ #include "Common_3/Graphics/ThirdParty/OpenSource/DirectXShaderCompiler/inc/dxcapi.h" #endif -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static DescriptorType sD3D12_TO_DESCRIPTOR[] = { DESCRIPTOR_TYPE_UNIFORM_BUFFER, // D3D_SIT_CBUFFER diff --git a/Forge/Graphics/TF_GPUConfig.cpp b/Forge/Graphics/TF_GPUConfig.cpp index 42f124d15a..48e37ee158 100644 --- a/Forge/Graphics/TF_GPUConfig.cpp +++ b/Forge/Graphics/TF_GPUConfig.cpp @@ -3,7 +3,8 @@ #include -#include "Forge/Core/TF_String.h" +#include "Forge/TF_String.h" +#include "Forge/stb/stb_ds.h" #define GPUCFG_VERSION_MAJOR 0 #define GPUCFG_VERSION_MINOR 2 diff --git a/Forge/Graphics/TF_GPUConfig.h b/Forge/Graphics/TF_GPUConfig.h index e3ff5708bf..bd9370b95a 100644 --- a/Forge/Graphics/TF_GPUConfig.h +++ b/Forge/Graphics/TF_GPUConfig.h @@ -2,8 +2,8 @@ /* ------------------------ gpu.data ------------------------ */ // intel use 3 identifiers 0x163C, 0x8086, 0x8087; -#include "Forge/Core/TF_String.h" -#include "Forge/Core/Mem/TF_Allocators.h" +#include "Forge/TF_String.h" +#include "Forge/Mem/TF_Allocators.h" #include "Forge/Graphics/TF_Graphics.h" diff --git a/Forge/Graphics/TF_Graphics.h b/Forge/Graphics/TF_Graphics.h index acdb24eb6d..ce91c8fae9 100644 --- a/Forge/Graphics/TF_Graphics.h +++ b/Forge/Graphics/TF_Graphics.h @@ -34,7 +34,7 @@ #include "Common_3/OS/Interfaces/IOperatingSystem.h" #include "Forge/TF_Log.h" #include "Forge/TF_Thread.h" -#include "Forge/Core/TF_Types.h" +#include "Forge/TF_Types.h" // diff --git a/Forge/Graphics/Vulkan/Vulkan.cpp b/Forge/Graphics/Vulkan/Vulkan.cpp index 7538000c39..dd3cb1dff5 100644 --- a/Forge/Graphics/Vulkan/Vulkan.cpp +++ b/Forge/Graphics/Vulkan/Vulkan.cpp @@ -40,13 +40,13 @@ #define strncpy_s strncpy #endif -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/TF_Log.h" #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/Mem/TF_Allocators.h" +#include "Forge/Mem/TF_Allocators.h" #include "Common_3/Utilities/Math/MathTypes.h" @@ -93,7 +93,7 @@ extern RenderTarget* pFragmentDensityMask; #include "swappy/swappyVk.h" #endif -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #if defined(AUTOMATED_TESTING) #include "Common_3/Application/Interfaces/IScreenshot.h" diff --git a/Forge/Graphics/Vulkan/VulkanRaytracing.cpp b/Forge/Graphics/Vulkan/VulkanRaytracing.cpp index 6cbe28bd44..0be81d1726 100644 --- a/Forge/Graphics/Vulkan/VulkanRaytracing.cpp +++ b/Forge/Graphics/Vulkan/VulkanRaytracing.cpp @@ -26,7 +26,7 @@ #ifdef VULKAN -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "Common_3/Utilities/ThirdParty/OpenSource/bstrlib/bstrlib.h" #include "Forge/TF_Log.h" @@ -39,7 +39,7 @@ #include "Forge/Graphics/TF_Graphics.h" #include "Common_3/Graphics/Interfaces/IRay.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" extern VkAllocationCallbacks* GetAllocationCallbacks(VkObjectType objType); diff --git a/Forge/Graphics/Vulkan/VulkanShaderReflection.cpp b/Forge/Graphics/Vulkan/VulkanShaderReflection.cpp index 9dec7544da..1e5d2d71c8 100644 --- a/Forge/Graphics/Vulkan/VulkanShaderReflection.cpp +++ b/Forge/Graphics/Vulkan/VulkanShaderReflection.cpp @@ -31,7 +31,7 @@ #include "Forge/TF_Log.h" #include "Forge/Graphics/TF_Graphics.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static DescriptorType sSPIRV_TO_DESCRIPTOR[SPIRV_TYPE_COUNT] = { DESCRIPTOR_TYPE_UNDEFINED, diff --git a/Forge/Math/MurmurHash3_32.h b/Forge/Math/MurmurHash3_32.h new file mode 100644 index 0000000000..b3416298ee --- /dev/null +++ b/Forge/Math/MurmurHash3_32.h @@ -0,0 +1,149 @@ +//----------------------------------------------------------------------------- +// MurmurHash3 was written by Austin Appleby, and is placed in the public +// domain. The author hereby disclaims copyright to this source code. + +// Note - The x86 and x64 versions do _not_ produce the same results, as the +// algorithms are optimized for their respective platforms. You can still +// compile and run any of them on any platform, but your performance with the +// non-native version will be less than optimal. + +//----------------------------------------------------------------------------- +#pragma once + +// Platform-specific functions and macros + +// Microsoft Visual Studio + +#if defined(_MSC_VER) + +#define FORCE_INLINE __forceinline + +#include + +#define ROTL32(x,y) _rotl(x,y) +#define ROTL64(x,y) _rotl64(x,y) + +#define BIG_CONSTANT(x) (x) + +// Other compilers + +#else // defined(_MSC_VER) + +#define FORCE_INLINE inline __attribute__((always_inline)) + +inline uint32_t rotl32 ( uint32_t x, int8_t r ) +{ + return (x << r) | (x >> (32 - r)); +} + +inline uint64_t rotl64 ( uint64_t x, int8_t r ) +{ + return (x << r) | (x >> (64 - r)); +} + +#define ROTL32(x,y) rotl32(x,y) +#define ROTL64(x,y) rotl64(x,y) + +#define BIG_CONSTANT(x) (x##LLU) + +#endif // !defined(_MSC_VER) + +//----------------------------------------------------------------------------- +// Block read - if your platform needs to do endian-swapping or can only +// handle aligned reads, do the conversion here + +FORCE_INLINE uint32_t getblock32 ( const uint32_t * p, int i ) +{ + return p[i]; +} + +FORCE_INLINE uint64_t getblock64 ( const uint64_t * p, int i ) +{ + return p[i]; +} + +//----------------------------------------------------------------------------- +// Finalization mix - force all bits of a hash block to avalanche + +FORCE_INLINE uint32_t fmix32 ( uint32_t h ) +{ + h ^= h >> 16; + h *= 0x85ebca6b; + h ^= h >> 13; + h *= 0xc2b2ae35; + h ^= h >> 16; + + return h; +} + +//---------- + +FORCE_INLINE uint64_t fmix64 ( uint64_t k ) +{ + k ^= k >> 33; + k *= BIG_CONSTANT(0xff51afd7ed558ccd); + k ^= k >> 33; + k *= BIG_CONSTANT(0xc4ceb9fe1a85ec53); + k ^= k >> 33; + + return k; +} + +//----------------------------------------------------------------------------- + +inline void MurmurHash3_x86_32 ( const void * key, int len, + uint32_t seed, void * out ) +{ + const uint8_t * data = (const uint8_t*)key; + const int nblocks = len / 4; + + uint32_t h1 = seed; + + const uint32_t c1 = 0xcc9e2d51; + const uint32_t c2 = 0x1b873593; + + //---------- + // body + + const uint32_t * blocks = (const uint32_t *)(data + nblocks*4); + + for(int i = -nblocks; i; i++) + { + uint32_t k1 = getblock32(blocks,i); + + k1 *= c1; + k1 = ROTL32(k1,15); + k1 *= c2; + + h1 ^= k1; + h1 = ROTL32(h1,13); + h1 = h1*5+0xe6546b64; + } + + //---------- + // tail + + const uint8_t * tail = (const uint8_t*)(data + nblocks*4); + + uint32_t k1 = 0; + + switch(len & 3) + { + case 3: k1 ^= tail[2] << 16; + case 2: k1 ^= tail[1] << 8; + case 1: k1 ^= tail[0]; + k1 *= c1; k1 = ROTL32(k1,15); k1 *= c2; h1 ^= k1; + }; + + //---------- + // finalization + + h1 ^= len; + + h1 = fmix32(h1); + + *(uint32_t*)out = h1; +} + +//----------------------------------------------------------------------------- + diff --git a/Forge/Math/TF_Random.h b/Forge/Math/TF_Random.h new file mode 100644 index 0000000000..2178e2933a --- /dev/null +++ b/Forge/Math/TF_Random.h @@ -0,0 +1,18 @@ +#define TF_RAND_MAX 0x7FFFFFFF +#define TF_INITIAL_SEED 0x9747b28c + +#include "Forge/Math/MurmurHash3_32.h" +#include "Forge/TF_Types.h" + +inline int32_t tfRandomInt(void) +{ + static uint32_t seed = TF_INITIAL_SEED; + static const uint32_t messageHash[] = { + 0x8C2100D0, 0xEC843F56, 0xDD467E25, 0xC22461F6, 0xA1368AB0, 0xBBDA7B12, 0xA175F888, 0x6BD9BDA2, + 0x999AC54C, 0x7C043DD3, 0xD502088F, 0x1B5B4D72, 0x94BB5742, 0x2CDA891E, 0x88613640, 0x31A50479 + }; + + int32_t result; + MurmurHash3_x86_32(&messageHash, TF_ARRAY_COUNT(messageHash) * sizeof(uint32_t), seed--, &result); + return abs(result); +} diff --git a/Forge/Math/vectormath.hpp b/Forge/Math/TF_VectorMath.h similarity index 63% rename from Forge/Math/vectormath.hpp rename to Forge/Math/TF_VectorMath.h index 94c1235628..b6bfb0df3c 100644 --- a/Forge/Math/vectormath.hpp +++ b/Forge/Math/TF_VectorMath.h @@ -11,26 +11,17 @@ #define VECTORMATH_HPP #include "Forge/Config.h" +#include "Forge/TF_Config.h" #include "vectormath_settings.hpp" // Sony's library includes: -#if VECTORMATH_MODE_SCE -#if defined(ORBIS) -#include "../../../../../PS4/Common_3/Utilities/ThirdParty/OpenSource/vectormath/VectorMathConfig.h" -#include "../../../../../PS4/Common_3/Utilities/ThirdParty/OpenSource/vectormath/cpp/vectormath_aos.h" -#include "../../../../../PS4/Common_3/Utilities/ThirdParty/OpenSource/vectormath/cpp/vectormath_namespace.h" -#elif defined(PROSPERO) -#include "../../../../../Prospero/Common_3/Utilities/ThirdParty/OpenSource/vectormath/VectorMathConfig.h" -#include "../../../../../Prospero/Common_3/Utilities/ThirdParty/OpenSource/vectormath/cpp/vectormath_aos.h" -#include "../../../../../Prospero/Common_3/Utilities/ThirdParty/OpenSource/vectormath/cpp/vectormath_namespace.h" -#endif -#elif (VECTORMATH_CPU_HAS_SSE1_OR_BETTER && !VECTORMATH_FORCE_SCALAR_MODE) // SSE +#if defined(TF_FEATURE_CPU_SSE) // SSE #include "sse/vectormath.hpp" using namespace Vectormath::SSE; -#elif (VECTORMATH_CPU_HAS_NEON && !VECTORMATH_FORCE_SCALAR_MODE) // NEON +#elif defined(TF_FEATURE_CPU_NEON) #include "neon/vectormath.hpp" using namespace Vectormath::Neon; -#else // !SSE +#else #include "scalar/vectormath.hpp" using namespace Vectormath::Scalar; #endif // Vectormath mode selection diff --git a/Forge/Math/common.hpp b/Forge/Math/common.hpp index acbaffa4a2..fc05497066 100644 --- a/Forge/Math/common.hpp +++ b/Forge/Math/common.hpp @@ -10,7 +10,7 @@ #include #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "../../../../Utilities/Math/Random.h" #include "Forge/TF_Log.h" diff --git a/Forge/Math/vectormath_settings.hpp b/Forge/Math/vectormath_settings.hpp index 4c5cfd440e..5179cc836b 100644 --- a/Forge/Math/vectormath_settings.hpp +++ b/Forge/Math/vectormath_settings.hpp @@ -73,6 +73,4 @@ #define VECTORMATH_MIN_ALIGN 0 #endif // Vectormath mode selection - - #endif // VECTORMATH_SETTINGS_HPP diff --git a/Forge/Core/Mem/TF_Allocators.cpp b/Forge/Mem/TF_Allocators.cpp similarity index 98% rename from Forge/Core/Mem/TF_Allocators.cpp rename to Forge/Mem/TF_Allocators.cpp index b3cb16c2ec..d071ee7d94 100644 --- a/Forge/Core/Mem/TF_Allocators.cpp +++ b/Forge/Mem/TF_Allocators.cpp @@ -1,9 +1,9 @@ -#include "Forge/Core/Mem/TF_Allocators.h" +#include "Forge/Mem/TF_Allocators.h" #include "Forge/TF_Log.h" #include "Forge/Core/TF_Math.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" struct TFStackAllocBlock { diff --git a/Forge/Core/Mem/TF_Allocators.h b/Forge/Mem/TF_Allocators.h similarity index 98% rename from Forge/Core/Mem/TF_Allocators.h rename to Forge/Mem/TF_Allocators.h index 8ba3d8405f..dff95e1e6b 100644 --- a/Forge/Core/Mem/TF_Allocators.h +++ b/Forge/Mem/TF_Allocators.h @@ -1,6 +1,5 @@ #pragma once -#include "Forge/Core/TF_Core.h" #include "Forge/TF_Log.h" typedef void* (*TFAllocatorMalloc)(void* self, size_t size); diff --git a/Forge/Core/Mem/TF_Memory.h b/Forge/Mem/TF_Memory.h similarity index 100% rename from Forge/Core/Mem/TF_Memory.h rename to Forge/Mem/TF_Memory.h diff --git a/Forge/Middleware_3/PaniniProjection/Panini.cpp b/Forge/Middleware_3/PaniniProjection/Panini.cpp index 21c8819d92..f09a61c58a 100644 --- a/Forge/Middleware_3/PaniniProjection/Panini.cpp +++ b/Forge/Middleware_3/PaniniProjection/Panini.cpp @@ -28,7 +28,7 @@ #include "../../Common_3/Resources/ResourceLoader/Interfaces/IResourceLoader.h" #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" ResourceDirectory RD_MIDDLEWARE_PANINI = RD_MIDDLEWARE_2; /************************************************************************/ diff --git a/Forge/Middleware_3/ParallelPrimitives/ParallelPrimitives.cpp b/Forge/Middleware_3/ParallelPrimitives/ParallelPrimitives.cpp index 7314e1b788..cbf729ed15 100644 --- a/Forge/Middleware_3/ParallelPrimitives/ParallelPrimitives.cpp +++ b/Forge/Middleware_3/ParallelPrimitives/ParallelPrimitives.cpp @@ -44,11 +44,11 @@ #include "ParallelPrimitives.h" -#include "Forge/Core/Nothings/stb_ds.h" +#include "Forge/stb/stb_ds.h" #include "../../Common_3/Resources/ResourceLoader/Interfaces/IResourceLoader.h" #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" ParallelPrimitives::PipelineComponents::PipelineComponents(): mNextSetIndex(0), pDescriptorSet(NULL), pShader(NULL), pPipeline(NULL), pRootSignature(NULL) diff --git a/Forge/TF_Config.in b/Forge/TF_Config.in index 92785e6ec9..5f96a52907 100644 --- a/Forge/TF_Config.in +++ b/Forge/TF_Config.in @@ -25,6 +25,8 @@ #ifndef TF_CONFIG_2_INCLUDE #define TF_CONFIG_2_INCLUDE +#include +#include #configure TF_DEBUG @@ -42,11 +44,30 @@ #configure TF_FEATURE_D3D11 #configure TF_FEATURE_VULKAN - #define TF_DEFAULT_LOG_LEVEL ${LOG_LEVEL} #configure TF_ENABLE_LOGGING #configure TF_USE_MTUNER #configure TF_ENABLE_MEMORY_TRACKING +#if (defined(TF_FEATURE_CPU_NEON) + defined(TF_FEATURE_CPU_SSE) + defined(TF_FEATURE_CPU_SCALAR)) == 0 + #if defined(TF_TARGET_DARWIN) && defined(__arm__) + #define TF_FEATURE_CPU_NEON + #elif defined(_MSC_VER) + #if (defined(__AVX__) || defined(__AVX2__) || defined(_M_AMD64) || defined(_M_X64) || (_M_IX86_FP == 1) || (_M_IX86_FP == 2)) + #define TF_FEATURE_CPU_SSE + #endif // SSE support + #else // !_MSC_VER + #if defined(__SSE__) + #define TF_FEATURE_CPU_SSE + #elif defined(__ANDROID__) + #if defined(ANDROID_ARM_NEON) + #define TF_FEATURE_CPU_NEON + #endif + #elif defined(__arm64) || defined(__aarch64__) || defined(__arm__ ) + #define TF_FEATURE_CPU_NEON + #endif // __SSE__ + #endif // _MSC_VER +#endif + #endif diff --git a/Forge/TF_Log.c b/Forge/TF_Log.c index 19395f9448..1ad2b30517 100644 --- a/Forge/TF_Log.c +++ b/Forge/TF_Log.c @@ -31,7 +31,7 @@ #include "Forge/TF_Thread.h" #include "Forge/Core/TF_Time.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" static bool gIsInteractiveMode = true; void _EnableInteractiveMode(bool isInteractiveMode) { gIsInteractiveMode = isInteractiveMode; } diff --git a/Forge/TF_Log.h b/Forge/TF_Log.h index f8e4696a0e..c943510565 100644 --- a/Forge/TF_Log.h +++ b/Forge/TF_Log.h @@ -109,18 +109,11 @@ extern "C" FORGE_API void _EnableInteractiveMode(bool isInteractivenMode); FORGE_API bool _IsInteractiveMode(void); - //FORGE_API void _FailedAssertImpl(const char* file, int line, const char* statement, const char* message); - ////+V576, function:_OutputDebugString, format_arg:1, ellipsis_arg:2 - //FORGE_API void _OutputDebugString(const char* str, ...); - //FORGE_API void _OutputDebugStringV(const char* str, va_list args); - - //FORGE_API void _PrintUnicode(const char* str, bool error); - #ifdef __cplusplus } // extern "C" #endif -#if defined(_WINDOWS) || defined(XBOX) +#if defined(TF_TARGET_WINDOWS) || defined(XBOX) #define CHECK_HRESULT(exp) \ do \ { \ diff --git a/Forge/Core/TF_String.cpp b/Forge/TF_String.cpp similarity index 99% rename from Forge/Core/TF_String.cpp rename to Forge/TF_String.cpp index 743b835b1e..b2347f3392 100644 --- a/Forge/Core/TF_String.cpp +++ b/Forge/TF_String.cpp @@ -1,12 +1,14 @@ -#include "Forge/Core/TF_String.h" +#include "Forge/TF_String.h" #include #include #include "Forge/TF_Log.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" + +#include "Forge/TF_Types.h" #define upcase(c) (toupper ((unsigned char) c)) diff --git a/Forge/Core/TF_String.h b/Forge/TF_String.h similarity index 89% rename from Forge/Core/TF_String.h rename to Forge/TF_String.h index c6cb8f5a79..91593f0951 100644 --- a/Forge/Core/TF_String.h +++ b/Forge/TF_String.h @@ -39,7 +39,7 @@ #ifndef TF_STRING_H_INCLUDED #define TF_STRING_H_INCLUDED -#include "TF_Types.h" +#include "Forge/TF_Types.h" #include "Forge/TF_Log.h" #define TFSTR_LLSTR_SIZE 21 @@ -80,11 +80,11 @@ struct TStrSpan tfStrTrim(struct TStrSpan slice); struct TStrSpan tfStrRTrim(struct TStrSpan slice); struct TStrSpan tfStrLTrim(struct TStrSpan slice); -/* Enlarge the free space at the end of the bstr string so that the caller +/* Enlarge the free space at the end of the TStr string so that the caller * is sure that after calling this function can overwrite up to addlen * bytes after the end of the string, plus one more byte for nul term. * - * Note: this does not change the *length* of the bstr string as len + * Note: this does not change the *length* of the TStr string as len * but only the free buffer space we have. */ bool tfStrMakeRoomFor(struct TStr* str, size_t addlen); /* @@ -97,7 +97,7 @@ bool tfStrMakeRoomFor(struct TStr* str, size_t addlen); **/ bool tfStrSetLen(struct TStr* str, size_t len); /** - * set the amount of memory reserved by the bstr. will only ever increase + * set the amount of memory reserved by the TStr. will only ever increase * the size of the string * * A reserved string can be assigned with bstrAssign @@ -105,7 +105,7 @@ bool tfStrSetLen(struct TStr* str, size_t len); bool tfStrSetResv(struct TStr* str, size_t reserveLen); /** - * Modify an bstr string in-place to make it empty (zero length) set null terminator. + * Modify an TStr string in-place to make it empty (zero length) set null terminator. * However all the existing buffer is not discarded but set as free space * so that next append operations will not require allocations up to the * number of bytes previously available. @@ -113,7 +113,7 @@ bool tfStrSetResv(struct TStr* str, size_t reserveLen); bool tfStrClear(struct TStr* str); /** - * takes a bstr and duplicates the underlying buffer. + * takes a TStr and duplicates the underlying buffer. * * the buffer is trimmed down to the length of the string. * @@ -126,7 +126,7 @@ bool tfStrInsertChar(struct TStr* str, size_t i, char b); bool tfStrInserSlice(struct TStr* str, size_t i, const struct TStrSpan slice); bool tfStrAssign(struct TStr* str, struct TStrSpan slice); /** - * resizes the allocation of the bstr will truncate if the allocation is less then the size + * resizes the allocation of the TStr will truncate if the allocation is less then the size * * the buffer is trimmed down to the length of the string. * @@ -184,37 +184,37 @@ struct TStrSpan tfStrSplitIter(struct TFStrSplitIterable*); **/ struct TStrSpan tfStrSplitRevIter(struct TFStrSplitIterable*); -/* Set the bstr string length to the length as obtained with strlen(), so +/* Set the TStr string length to the length as obtained with strlen(), so * considering as content only up to the first null term character. * - * This function is useful when the bstr string has been changed where + * This function is useful when the TStr string has been changed where * the length is not correctly updated. using vsprintf for instance. * - * After the call, slices are not valid if they reference this bstr + * After the call, slices are not valid if they reference this TStr * - * s = bstrEmpty(); + * s = tfEmpty(); * s[2] = '\0'; - * bstrUpdateLen(s); + * tfUpdateLen(s); * printf("%d\n", s.len); * - * The output will be "2", but if we comment out the call to bstrUpdateLen() + * The output will be "2", but if we comment out the call to tfUpdateLen() * the output will be "6" as the string was modified but the logical length * remains 6 bytes. ** */ bool tfStrUpdateLen(struct TStr* str); -/* Append to the bstr string 's' a string obtained using printf-alike format +/* Append to the TStr string 's' a string obtained using printf-alike format * specifier. * - * After the call, the modified bstr string is no longer valid and all the + * After the call, the modified TStr string is no longer valid and all the * references must be substituted with the new pointer returned by the call. * * Example: * - * s = bstrCreate("Sum is: "); - * bstrcatprintf(s,"%d+%d = %d",a,b,a+b) + * s = tfCreate("Sum is: "); + * tfcatprintf(s,"%d+%d = %d",a,b,a+b) * - * if valid BSTR_OK else BSTR_ERR + * if valid true else false */ bool tfstrcatprintf(struct TStr* s, const char *fmt, ...); bool tfstrcatvprintf(struct TStr* str, const char* fmt, va_list ap); @@ -222,9 +222,9 @@ bool tfstrcatvprintf(struct TStr* str, const char* fmt, va_list ap); int tfstrsscanf(struct TStrSpan slice, const char* fmt, ...); int tfstrvsscanf(struct TStrSpan slice, const char* fmt, va_list ap); -/* This function is similar to bstrcatprintf, but much faster as it does +/* This function is similar to tfcatprintf, but much faster as it does * not rely on sprintf() family functions implemented by the libc that - * are often very slow. Moreover directly handling the bstr as + * are often very slow. Moreover directly handling the TStr as * new data is concatenated provides a performance improvement. * * However this function only handles an incompatible subset of printf-alike @@ -232,7 +232,7 @@ int tfstrvsscanf(struct TStrSpan slice, const char* fmt, va_list ap); * * %c - char * %s - C String - * %S - struct bstr_const_slice_s slice + * %S - struct tf_slice_s slice * %i - signed int * %l - signed long * %I - 64 bit signed integer (long long, int64_t) @@ -243,16 +243,15 @@ int tfstrvsscanf(struct TStrSpan slice, const char* fmt, va_list ap); */ bool tfstrcatfmt(struct TStr*, char const *fmt, ...); - /* * join an array of slices and cat them to bstr. faster since the lengths are known ahead of time. * the buffer can be pre-reserved upfront. * - * this modifies bstr so slices that reference this bstr can become invalid. + * this modifies TStr so slices that reference this TStr can become invalid. **/ bool tfstrcatjoin(struct TStr*, struct TStrSpan* slices, size_t numSlices, struct TStrSpan sep); /* - * join an array of strings and cat them to bstr + * join an array of strings and cat them to TStr **/ bool tfstrcatjoinCStr(struct TStr*, const char** argv, size_t argc, struct TStrSpan sep); diff --git a/Forge/Core/TF_Types.h b/Forge/TF_Types.h similarity index 63% rename from Forge/Core/TF_Types.h rename to Forge/TF_Types.h index 3dad017073..df1c6a1b41 100644 --- a/Forge/Core/TF_Types.h +++ b/Forge/TF_Types.h @@ -1,3 +1,5 @@ + +#pragma once #ifndef _TF_TYPES_H #define _TF_TYPES_H @@ -5,13 +7,18 @@ #include #include -#define TF_ARRAY_COUNT(array) (sizeof(array) / (sizeof(array[0]) * (sizeof(array) != PTR_SIZE || sizeof(array[0]) <= PTR_SIZE))) -#ifndef TF_MIN -#define TF_MIN(a, b) ((a) < (b) ? (a) : (b)) +#if INTPTR_MAX == 0x7FFFFFFFFFFFFFFFLL + #define TF_PTR_SIZE 8 +#elif INTPTR_MAX == 0x7FFFFFFF + #define TF_PTR_SIZE 4 +#else + #error unsupported platform #endif -#ifndef TF_MAX + +#define TF_ALIGN_TO(size, alignment) (((size) + (alignment)-1) & ~((alignment)-1)) +#define TF_ARRAY_COUNT(array) (sizeof(array) / (sizeof(array[0]) * (sizeof(array) != TF_PTR_SIZE || sizeof(array[0]) <= TF_PTR_SIZE))) +#define TF_MIN(a, b) ((a) < (b) ? (a) : (b)) #define TF_MAX(a, b) ((a) > (b) ? (a) : (b)) -#endif #ifdef __cplusplus #define TF_FORGE_CONSTEXPR constexpr @@ -22,7 +29,6 @@ #endif #ifdef __cplusplus -#ifndef TF_ENUM_FLAG #define TF_ENUM_FLAG(TYPE, ENUM_TYPE) \ inline TF_FORGE_CONSTEXPR ENUM_TYPE operator|(ENUM_TYPE a, ENUM_TYPE b) { return ENUM_TYPE(((TYPE)a) | ((TYPE)b)); } \ inline ENUM_TYPE& operator|=(ENUM_TYPE& a, ENUM_TYPE b) { return (ENUM_TYPE&)(((TYPE&)a) |= ((TYPE)b)); } \ @@ -31,9 +37,30 @@ inline TF_FORGE_CONSTEXPR ENUM_TYPE operator~(ENUM_TYPE a) { return ENUM_TYPE(~((TYPE)a)); } \ inline TF_FORGE_CONSTEXPR ENUM_TYPE operator^(ENUM_TYPE a, ENUM_TYPE b) { return ENUM_TYPE(((TYPE)a) ^ ((TYPE)b)); } \ inline ENUM_TYPE& operator^=(ENUM_TYPE& a, ENUM_TYPE b) { return (ENUM_TYPE&)(((TYPE&)a) ^= ((TYPE)b)); } -#endif #else #define TF_ENUM_FLAG(TYPE, ENUM_TYPE) #endif +#ifdef __cplusplus +#define TF_FORGE_CONSTEXPR constexpr +#define TF_FORGE_EXTERN_C extern "C" +#else +#define TF_FORGE_CONSTEXPR +#define TF_FORGE_EXTERN_C +#endif + +#if defined(__clang__) && !defined(__cplusplus) +#define TF_COMPILE_ASSERT(exp) _Static_assert(exp, #exp) +#else +#define TF_COMPILE_ASSERT(exp) static_assert(exp, #exp) +#endif + +#if defined(_MSC_VER) +#define TF_FORGE_EXPORT __declspec(dllexport) +#define TF_FORGE_IMPORT __declspec(dllimport) +#elif defined(__GNUC__) // clang & gcc +#define TF_FORGE_EXPORT __attribute__((visibility("default"))) +#define TF_FORGE_IMPORT +#endif + #endif diff --git a/Forge/Core/Nothings/LICENSE b/Forge/stb/LICENSE similarity index 100% rename from Forge/Core/Nothings/LICENSE rename to Forge/stb/LICENSE diff --git a/Forge/Core/Nothings/stb_ds.h b/Forge/stb/stb_ds.h similarity index 99% rename from Forge/Core/Nothings/stb_ds.h rename to Forge/stb/stb_ds.h index ba4c86461d..a2760ae75f 100644 --- a/Forge/Core/Nothings/stb_ds.h +++ b/Forge/stb/stb_ds.h @@ -405,7 +405,7 @@ struct bstring; #ifndef STB_DS_IMPLEMENTATION #define IMEMORY_FROM_HEADER -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #endif #ifdef _MSC_VER diff --git a/Forge/Core/Nothings/stb_hash.h b/Forge/stb/stb_hash.h similarity index 100% rename from Forge/Core/Nothings/stb_hash.h rename to Forge/stb/stb_hash.h diff --git a/Forge/Core/Nothings/stb_image.h b/Forge/stb/stb_image.h similarity index 100% rename from Forge/Core/Nothings/stb_image.h rename to Forge/stb/stb_image.h diff --git a/Forge/Core/Nothings/stb_image_resize.h b/Forge/stb/stb_image_resize.h similarity index 100% rename from Forge/Core/Nothings/stb_image_resize.h rename to Forge/stb/stb_image_resize.h diff --git a/Forge/Core/Nothings/stb_image_write.h b/Forge/stb/stb_image_write.h similarity index 100% rename from Forge/Core/Nothings/stb_image_write.h rename to Forge/stb/stb_image_write.h diff --git a/Forge/Core/Nothings/stb_rectpack.h b/Forge/stb/stb_rectpack.h similarity index 100% rename from Forge/Core/Nothings/stb_rectpack.h rename to Forge/stb/stb_rectpack.h diff --git a/Forge/Core/Nothings/stb_textedit.h b/Forge/stb/stb_textedit.h similarity index 100% rename from Forge/Core/Nothings/stb_textedit.h rename to Forge/stb/stb_textedit.h diff --git a/Forge/Core/Nothings/stb_truetype.h b/Forge/stb/stb_truetype.h similarity index 100% rename from Forge/Core/Nothings/stb_truetype.h rename to Forge/stb/stb_truetype.h diff --git a/platforms/constraints/BUCK b/Forge/tests/Math/BUCK similarity index 100% rename from platforms/constraints/BUCK rename to Forge/tests/Math/BUCK diff --git a/Forge/tests/Math/TF_Vector4.cpp b/Forge/tests/Math/TF_Vector4.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/Forge/tests/TF_GPUConfigTest.cpp b/Forge/tests/TF_GPUConfigTest.cpp index 32364ac0a0..9f480e39b6 100644 --- a/Forge/tests/TF_GPUConfigTest.cpp +++ b/Forge/tests/TF_GPUConfigTest.cpp @@ -1,6 +1,9 @@ #include "TF_TestMain.h" -#include "Forge/Config.h" -#include "Forge/Core/TF_String.h" + +#include "Forge/TF_Types.h" +#include "Forge/stb/stb_ds.h" + +#include "Forge/TF_String.h" #include "Forge/Graphics/TF_GPUConfig.h" #include "utest.h" @@ -117,7 +120,7 @@ UTEST(Core, loadData_2) } #include "Forge/TF_FileSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "Forge/TF_Log.h" UTEST_STATE(); TF_UTEST_MAIN("TF_StringTest") diff --git a/Forge/tests/TF_ScratchAllocatorTest.cpp b/Forge/tests/TF_ScratchAllocatorTest.cpp index eafa9f710d..3eb324475d 100644 --- a/Forge/tests/TF_ScratchAllocatorTest.cpp +++ b/Forge/tests/TF_ScratchAllocatorTest.cpp @@ -1,5 +1,5 @@ #include "TF_TestMain.h" -#include "Forge/Core/Mem/TF_Allocators.h" +#include "Forge/Mem/TF_Allocators.h" #include "utest.h" UTEST(Core, scratchAlloc_1) @@ -39,7 +39,7 @@ UTEST(TF, scratchAlloc_2) #include "Forge/TF_FileSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "Forge/TF_Log.h" UTEST_STATE(); TF_UTEST_MAIN("TF_ScratchAllocatorTest") diff --git a/Forge/tests/TF_StringTest.cpp b/Forge/tests/TF_StringTest.cpp index 7ad143319d..e491a386b5 100644 --- a/Forge/tests/TF_StringTest.cpp +++ b/Forge/tests/TF_StringTest.cpp @@ -1,6 +1,6 @@ #include "TF_TestMain.h" #include "Forge/Config.h" -#include "Forge/Core/TF_String.h" +#include "Forge/TF_String.h" #include "utest.h" UTEST(Core, tfCaselessCompare) @@ -488,7 +488,7 @@ UTEST(Core, tfsscanf) // } #include "Forge/TF_FileSystem.h" -#include "Forge/Core/Mem/TF_Memory.h" +#include "Forge/Mem/TF_Memory.h" #include "Forge/TF_Log.h" UTEST_STATE(); TF_UTEST_MAIN("TF_StringTest") diff --git a/platforms/constraints/D3D11/BUCK b/platforms/constraints/D3D11/BUCK deleted file mode 100644 index d2d27fc4bb..0000000000 --- a/platforms/constraints/D3D11/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -constraint_setting( - name = "D3D11", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "supported", - constraint_setting = ":D3D11", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "disabled", - constraint_setting = ":D3D11", - visibility = ["PUBLIC"], -) - - diff --git a/platforms/constraints/D3D12/BUCK b/platforms/constraints/D3D12/BUCK deleted file mode 100644 index a2643f9c4c..0000000000 --- a/platforms/constraints/D3D12/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -constraint_setting( - name = "D3D12", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "supported", - constraint_setting = ":D3D12", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "disabled", - constraint_setting = ":D3D12", - visibility = ["PUBLIC"], -) - diff --git a/platforms/constraints/VULKAN/BUCK b/platforms/constraints/VULKAN/BUCK deleted file mode 100644 index 782e1d5d52..0000000000 --- a/platforms/constraints/VULKAN/BUCK +++ /dev/null @@ -1,18 +0,0 @@ -constraint_setting( - name = "VULKAN", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "supported", - constraint_setting = ":VULKAN", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "disabled", - constraint_setting = ":VULKAN", - visibility = ["PUBLIC"], -) - - diff --git a/platforms/constraints/build/BUCK b/platforms/constraints/build/BUCK deleted file mode 100644 index 10d2baca48..0000000000 --- a/platforms/constraints/build/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -constraint_setting( - name = "build", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "debug", - constraint_setting = ":build", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "release", - constraint_setting = ":build", - visibility = ["PUBLIC"], -) - diff --git a/platforms/constraints/target/BUCK b/platforms/constraints/target/BUCK deleted file mode 100644 index ad7d8947ae..0000000000 --- a/platforms/constraints/target/BUCK +++ /dev/null @@ -1,17 +0,0 @@ -constraint_setting( - name = "platform", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "win11", - constraint_setting = ":platform", - visibility = ["PUBLIC"], -) - -constraint_value( - name = "linux", - constraint_setting = ":platform", - visibility = ["PUBLIC"], -) -