@babylonjs/react-native 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/react-native-babylon.podspec +2 -0
- package/shared/BabylonNative/CMakeLists.txt +2 -0
- package/shared/BabylonNative/Repo/CMakeLists.txt +16 -12
- package/shared/BabylonNative/Repo/Core/Graphics/CMakeLists.txt +41 -21
- package/shared/BabylonNative/Repo/Core/Graphics/Include/Platform/iOS/Babylon/Graphics/Platform.h +2 -2
- package/shared/BabylonNative/Repo/Core/Graphics/Include/Platform/macOS/Babylon/Graphics/Platform.h +2 -2
- package/shared/BabylonNative/Repo/Core/Graphics/Include/Platform/visionOS/Babylon/Graphics/Platform.h +2 -2
- package/shared/BabylonNative/Repo/Core/Graphics/Include/RendererType/Metal/Babylon/Graphics/RendererType.h +6 -6
- package/shared/BabylonNative/Repo/Core/Graphics/InternalInclude/Babylon/Graphics/BgfxCallback.h +1 -1
- package/shared/BabylonNative/Repo/Core/Graphics/Source/BgfxCallback.cpp +32 -9
- package/shared/BabylonNative/Repo/Core/Graphics/Source/DeviceImpl.cpp +7 -5
- package/shared/BabylonNative/Repo/Core/Graphics/Source/{DeviceImpl_Metal.cpp → DeviceImpl_Metal.mm} +4 -3
- package/shared/BabylonNative/Repo/Core/Graphics/Source/DeviceImpl_iOS.mm +5 -3
- package/shared/BabylonNative/Repo/Core/Graphics/Source/DeviceImpl_macOS.mm +10 -1
- package/shared/BabylonNative/Repo/Core/Graphics/Source/DeviceImpl_visionOS.mm +2 -4
- package/shared/BabylonNative/Repo/Dependencies/CMakeLists.txt +77 -12
- package/shared/BabylonNative/Repo/Dependencies/xr/CMakeLists.txt +1 -3
- package/shared/BabylonNative/Repo/Plugins/ExternalTexture/CMakeLists.txt +1 -6
- package/shared/BabylonNative/Repo/Plugins/ExternalTexture/Source/ExternalTexture_D3D11.cpp +4 -0
- package/shared/BabylonNative/Repo/Plugins/ExternalTexture/Source/ExternalTexture_D3D12.cpp +4 -0
- package/shared/BabylonNative/Repo/Plugins/ExternalTexture/Source/{ExternalTexture_Metal.mm → ExternalTexture_Metal.cpp} +128 -120
- package/shared/BabylonNative/Repo/Plugins/NativeCamera/CMakeLists.txt +2 -2
- package/shared/BabylonNative/Repo/Plugins/NativeCamera/Source/Apple/CameraDevice.mm +5 -5
- package/shared/BabylonNative/Repo/Plugins/NativeEngine/CMakeLists.txt +2 -1
- package/shared/BabylonNative/Repo/Plugins/NativeEngine/Source/NativeEngine.cpp +2 -1
- package/shared/BabylonNative/Repo/Plugins/NativeEngine/Source/ShaderProvider.cpp +6 -6
- package/shared/BabylonNative/Repo/Plugins/NativeOptimizations/CMakeLists.txt +1 -2
- package/shared/BabylonNative/Repo/Plugins/NativeTracing/CMakeLists.txt +1 -2
- package/shared/BabylonNative/Repo/Plugins/NativeXr/Source/NativeXrImpl.cpp +1 -0
- package/shared/BabylonNative/Repo/Plugins/ShaderCache/CMakeLists.txt +0 -2
- package/shared/BabylonNative/Repo/Plugins/ShaderCache/Include/Babylon/Plugins/ShaderCache.h +2 -2
- package/shared/BabylonNative/Repo/Plugins/ShaderCache/Source/ShaderCache.cpp +2 -2
- package/shared/BabylonNative/Repo/Plugins/ShaderCache/Source/ShaderCacheImpl.cpp +4 -4
- package/shared/BabylonNative/Repo/Plugins/ShaderCache/Source/ShaderCacheImpl.h +2 -2
- package/shared/BabylonNative/Repo/Plugins/ShaderCompiler/Source/ShaderCompilerCommon.cpp +2 -0
- package/shared/BabylonNative/Repo/Plugins/ShaderCompiler/Source/ShaderCompilerTraversers.cpp +4 -0
- package/shared/BabylonNative/Repo/Plugins/TestUtils/CMakeLists.txt +6 -8
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Include/Babylon/Plugins/TestUtils.h +0 -1
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/TestUtils.cpp +20 -6
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/TestUtils.h +13 -13
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/{Android/TestUtilsImpl.cpp → TestUtils_Android.cpp} +1 -10
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/{Unix/TestUtilsImpl.cpp → TestUtils_Unix.cpp} +10 -20
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/{Win32/TestUtilsImpl.cpp → TestUtils_Win32.cpp} +10 -20
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/{WinRT/TestUtilsImpl.cpp → TestUtils_WinRT.cpp} +9 -13
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/TestUtils_iOS.mm +25 -0
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/TestUtils_macOS.mm +50 -0
- package/shared/BabylonNative/Repo/Polyfills/Canvas/Source/Shaders/dx11/fs_boxblur.h +1 -1
- package/shared/BabylonNative/Repo/Polyfills/Canvas/Source/Shaders/dx11/fs_gaussblur.h +1 -1
- package/shared/BabylonNative/Repo/Polyfills/Canvas/Source/Shaders/dx11/fs_nanovg_fill.h +1 -1
- package/shared/BabylonNative/Repo/Polyfills/Canvas/Source/Shaders/dx11/vs_fspass.h +1 -1
- package/shared/BabylonNative/Repo/Polyfills/Canvas/Source/Shaders/dx11/vs_nanovg_fill.h +1 -1
- package/shared/BabylonNative/Repo/Polyfills/Canvas/shaderc.cmake +2 -2
- package/shared/BabylonNative/Repo/azure-pipelines.yml +36 -24
- package/shared/BabylonNative/deps/arcana.cpp-src/CMakeLists.txt +17 -1
- package/shared/BabylonNative/deps/arcana.cpp-src/README.md +1 -1
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Shared/arcana/string.h +0 -12
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Shared/arcana/threading/cancellation.h +25 -12
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Windows.Test/Threading/CancellationMemoryLeakTest.cpp +37 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/CMakeLists.txt +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/README.md +5 -5
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/LICENSE +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/README.md +31 -14
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/args.h +5 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/aviwriter.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/bgfx_utils.cpp +4 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/bgfx_utils.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/common.h +43 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/common.sh +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/debugdraw.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/debugdraw.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_fill.bin.h +180 -29
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_fill.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.bin.h +305 -92
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_fill_lit.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.bin.h +328 -26
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_fill_texture.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_lines.bin.h +227 -13
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_lines.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.bin.h +290 -38
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/fs_debugdraw_lines_stipple.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/makefile +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill.bin.h +319 -95
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill.sc +2 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.bin.h +410 -133
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit.sc +2 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.bin.h +378 -120
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_lit_mesh.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.bin.h +290 -85
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_mesh.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.bin.h +259 -18
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_fill_texture.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_lines.bin.h +228 -14
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_lines.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.bin.h +255 -16
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/debugdraw/vs_debugdraw_lines_stipple.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/cmd.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/cmd.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/dbg.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/dialog.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/dialog.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_android.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_glfw.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_html5.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_ios.mm +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_noop.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_osx.mm +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_p.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_sdl.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_windows.cpp +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/entry_x11.cpp +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/input.cpp +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/entry/input.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/example-glue.cpp +21 -9
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_basic.bin.h +391 -75
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field.bin.h +382 -119
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field_drop_shadow.bin.h +587 -227
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field_drop_shadow_image.bin.h +655 -265
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field_outline.bin.h +452 -164
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field_outline_drop_shadow_image.bin.h +719 -307
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field_outline_image.bin.h +535 -208
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/fs_font_distance_field_subpixel.bin.h +495 -125
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/makefile +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_basic.bin.h +254 -16
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field.bin.h +254 -16
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field_drop_shadow.bin.h +340 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field_drop_shadow_image.bin.h +340 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field_outline.bin.h +310 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field_outline_drop_shadow_image.bin.h +340 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field_outline_image.bin.h +310 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/font/vs_font_distance_field_subpixel.bin.h +254 -16
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_image.bin.h +277 -59
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_ocornut_imgui.bin.h +324 -25
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/imgui.cpp +9 -9
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/imgui.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/makefile +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_image.bin.h +219 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_ocornut_imgui.bin.h +239 -7
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/nanovg/fs_nanovg_fill.bin.h +925 -472
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/nanovg/makefile +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/nanovg/nanovg_bgfx.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/nanovg/nanovg_bgfx.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/nanovg/vs_nanovg_fill.bin.h +223 -7
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/packrect.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/fs_particle.bin.h +382 -70
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/fs_particle.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/makefile +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/particle_system.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/particle_system.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/vs_particle.bin.h +263 -18
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/ps/vs_particle.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/shaderlib.sh +10 -7
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/include/bgfx/bgfx.h +149 -7
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/include/bgfx/c99/bgfx.h +225 -101
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/include/bgfx/defines.h +30 -21
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/include/bgfx/embedded_shader.h +110 -60
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/include/bgfx/platform.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/makefile +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/bgfx.idl +189 -70
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/bgfx.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/bindings-bf.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/bindings-c3.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/bindings-cs.lua +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/bindings-zig.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/example-common.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/genie.lua +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/geometryc.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/geometryv.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/shader-embeded.mk +18 -4
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/shader.mk +21 -6
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/shaderc.lua +139 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/temp.bgfx.h +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/temp.bgfx.hpp +2 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/temp.bgfx.idl.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/temp.defines.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/texturec.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/texturev.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/scripts/tools.mk +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/amalgamated.cpp +2 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/amalgamated.mm +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/bgfx.cpp +406 -164
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/bgfx.idl.inl +37 -9
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/bgfx_compute.sh +40 -43
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/bgfx_p.h +795 -170
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/bgfx_shader.sh +205 -73
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/charset.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/config.h +18 -4
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/debug_renderdoc.cpp +8 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/debug_renderdoc.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/dxgi.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/dxgi.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/emscripten.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear0.bin.h +190 -36
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear0.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear1.bin.h +223 -46
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear1.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear2.bin.h +253 -55
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear2.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear3.bin.h +283 -65
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear3.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear4.bin.h +314 -75
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear4.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear5.bin.h +343 -85
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear5.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear6.bin.h +373 -94
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear6.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear7.bin.h +404 -105
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_clear7.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_debugfont.bin.h +401 -67
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/fs_debugfont.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glcontext_egl.cpp +114 -36
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glcontext_egl.h +5 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glcontext_html5.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glcontext_html5.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glcontext_wgl.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glcontext_wgl.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/glimports.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/makefile +17 -13
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/nvapi.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/nvapi.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer.h +50 -29
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_agc.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_d3d.h +7 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_d3d11.cpp +291 -180
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_d3d11.h +5 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_d3d12.cpp +635 -218
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_d3d12.h +78 -10
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_gl.cpp +65 -45
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_gl.h +24 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_gnm.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_mtl.h +50 -24
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_mtl.mm +158 -56
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_noop.cpp +8 -12
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_nvn.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_vk.cpp +810 -445
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_vk.h +194 -133
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_webgpu.cpp +6239 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/renderer_webgpu.h +897 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/shader.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/shader.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/shader_dxbc.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/shader_dxbc.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/shader_spirv.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/shader_spirv.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/topology.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/topology.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/version.h +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/vertexlayout.cpp +2 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/vertexlayout.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/vs_clear.bin.h +186 -24
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/vs_clear.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/vs_debugfont.bin.h +314 -44
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/src/vs_debugfont.sc +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/3rdparty/nvtt/bc7/avpcl_mode4.cpp +2 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/3rdparty/nvtt/nvcore/debug.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/3rdparty/nvtt/nvtt.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/LICENSE +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/README.md +2 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/include/bimg/bimg.h +5 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/include/bimg/decode.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/include/bimg/encode.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/makefile +183 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/scripts/bimg.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/scripts/bimg_decode.lua +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/scripts/bimg_encode.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/scripts/genie.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/scripts/texturec.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/bimg_p.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/config.h +52 -40
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/image.cpp +136 -120
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/image_cubemap_filter.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/image_decode.cpp +17 -5
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/image_encode.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/src/image_gnf.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bimg/tools/texturec/texturec.cpp +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/LICENSE +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/README.md +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/allocator.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/bounds.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/bx.h +43 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/commandline.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/config.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/constants.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/cpu.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/debug.h +15 -5
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/easing.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/endian.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/error.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/file.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/filepath.h +5 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/float4x4_t.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/handlealloc.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/hash.h +31 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/allocator.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/bounds.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/bx.inl +141 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/cpu.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/easing.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/endian.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/error.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/float4x4_t.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/handlealloc.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/hash.inl +28 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/math.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/mpscqueue.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/mutex.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/os.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/pixelformat.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/readerwriter.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/ringbuffer.inl +76 -8
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/rng.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd128_langext.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd128_neon.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd128_ref.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd128_sse.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd256_avx.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd256_ref.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/simd_ni.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/sort.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/spscqueue.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/string.inl +237 -48
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/timer.inl +67 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/typetraits.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/inline/uint32_t.inl +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/macros.h +6 -6
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/math.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/mpscqueue.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/mutex.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/os.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/pixelformat.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/platform.h +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/process.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/readerwriter.h +9 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/ringbuffer.h +145 -14
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/rng.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/semaphore.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/settings.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/simd_t.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/sort.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/spscqueue.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/string.h +111 -42
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/thread.h +5 -5
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/timer.h +59 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/typetraits.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/uint32_t.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/include/bx/url.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/scripts/bin2c.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/scripts/bx.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/scripts/genie.lua +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/scripts/toolchain.lua +36 -18
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/allocator.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/amalgamated.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/bounds.cpp +10 -10
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/bx.cpp +3 -3
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/commandline.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/crtnone.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/debug.cpp +866 -64
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/dtoa.cpp +3 -9
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/easing.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/file.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/filepath.cpp +7 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/hash.cpp +195 -37
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/math.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/mutex.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/os.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/process.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/semaphore.cpp +27 -6
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/settings.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/sort.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/string.cpp +206 -49
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/thread.cpp +35 -38
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/timer.cpp +5 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/src/url.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/allocator_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/atomic_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/cast_test.cpp +99 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/crt_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/dbg.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/easing_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/filepath_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/handle_bench.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/handle_test.cpp +6 -6
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/hash_test.cpp +37 -8
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/macros_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/main_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/math_bench.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/math_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/os_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/pixelformat_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/queue_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/readerwriter_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/ringbuffer_test.cpp +112 -7
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/rng_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/run_test.cpp +6 -4
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/settings_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/simd_bench.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/simd_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/sort_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/string_test.cpp +92 -39
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/test.h +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/thread_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/tokenizecmd_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/typetraits_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/uint32_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/url_test.cpp +1 -1
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tests/vsnprintf_test.cpp +365 -77
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tools/bin/darwin/genie +0 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tools/bin/linux/genie +0 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tools/bin/windows/genie.exe +0 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/bx/tools/bin2c/bin2c.cpp +2 -2
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/3rdparty/glslang.cmake +6 -5
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/3rdparty/spirv-opt.cmake +5 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/3rdparty/tint.cmake +98 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/CMakeLists.txt +1 -0
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/bgfx.cmake +11 -9
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/examples.cmake +16 -4
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bgfx/shaderc.cmake +21 -10
- package/shared/BabylonNative/deps/bgfx.cmake-src/cmake/bx/bx.cmake +5 -0
- package/shared/BabylonNative/deps/cmakeextensions-src/CMakeLists.txt +31 -5
- package/shared/BabylonNative/deps/cmakeextensions-src/README.md +6 -1
- package/shared/BabylonNative/deps/jsruntimehost-src/CMakeLists.txt +6 -5
- package/shared/BabylonNative/deps/jsruntimehost-src/Core/Node-API/Source/js_native_api_javascriptcore.cc +58 -4
- package/shared/BabylonNative/deps/jsruntimehost-src/Polyfills/CMakeLists.txt +4 -0
- package/shared/BabylonNative/deps/jsruntimehost-src/Polyfills/TextDecoder/CMakeLists.txt +15 -0
- package/shared/BabylonNative/deps/jsruntimehost-src/Polyfills/TextDecoder/Include/Babylon/Polyfills/TextDecoder.h +9 -0
- package/shared/BabylonNative/deps/jsruntimehost-src/Polyfills/TextDecoder/README.md +39 -0
- package/shared/BabylonNative/deps/jsruntimehost-src/Polyfills/TextDecoder/Source/TextDecoder.cpp +91 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/Foundation.hpp +47 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSArray.hpp +124 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSAutoreleasePool.hpp +83 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSBundle.hpp +374 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSData.hpp +54 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSDate.hpp +53 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSDefines.hpp +45 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSDictionary.hpp +128 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSEnumerator.hpp +78 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSError.hpp +173 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSLock.hpp +118 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSNotification.hpp +110 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSNumber.hpp +501 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSObjCRuntime.hpp +43 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSObject.hpp +302 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSPrivate.hpp +531 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSProcessInfo.hpp +386 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSRange.hpp +83 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSSet.hpp +87 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSSharedPtr.hpp +310 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSString.hpp +255 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSTypes.hpp +51 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Foundation/NSURL.hpp +90 -0
- package/shared/BabylonNative/deps/metal-cpp-src/LICENSE.txt +202 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4AccelerationStructure.hpp +1395 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4Archive.hpp +93 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4ArgumentTable.hpp +187 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4BinaryFunction.hpp +50 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4BinaryFunctionDescriptor.hpp +97 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4CommandAllocator.hpp +100 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4CommandBuffer.hpp +193 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4CommandEncoder.hpp +134 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4CommandQueue.hpp +283 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4CommitFeedback.hpp +62 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4Compiler.hpp +345 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4CompilerTask.hpp +63 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4ComputeCommandEncoder.hpp +300 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4ComputePipeline.hpp +158 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4Counters.hpp +138 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4FunctionDescriptor.hpp +49 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4LibraryDescriptor.hpp +98 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4LibraryFunctionDescriptor.hpp +86 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4LinkingDescriptor.hpp +204 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4MachineLearningCommandEncoder.hpp +66 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4MachineLearningPipeline.hpp +172 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4MeshRenderPipeline.hpp +413 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4PipelineDataSetSerializer.hpp +85 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4PipelineState.hpp +150 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4RenderCommandEncoder.hpp +340 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4RenderPass.hpp +280 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4RenderPipeline.hpp +587 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4SpecializedFunctionDescriptor.hpp +100 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4StitchedFunctionDescriptor.hpp +86 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTL4TileRenderPipeline.hpp +173 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLAccelerationStructure.hpp +1887 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLAccelerationStructureCommandEncoder.hpp +260 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLAccelerationStructureTypes.hpp +292 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLAllocation.hpp +40 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLArgument.hpp +787 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLArgumentEncoder.hpp +235 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLBinaryArchive.hpp +152 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLBlitCommandEncoder.hpp +226 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLBlitPass.hpp +154 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLBuffer.hpp +119 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLCaptureManager.hpp +217 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLCaptureScope.hpp +91 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLCommandBuffer.hpp +464 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLCommandEncoder.hpp +117 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLCommandQueue.hpp +158 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLComputeCommandEncoder.hpp +324 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLComputePass.hpp +169 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLComputePipeline.hpp +439 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLCounters.hpp +243 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLDataType.hpp +129 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLDefines.hpp +41 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLDepthStencil.hpp +277 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLDevice.hpp +1493 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLDrawable.hpp +90 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLDynamicLibrary.hpp +78 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLEvent.hpp +170 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLFence.hpp +55 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLFunctionConstantValues.hpp +76 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLFunctionDescriptor.hpp +153 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLFunctionHandle.hpp +65 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLFunctionLog.hpp +101 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLFunctionStitching.hpp +319 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLGPUAddress.hpp +36 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLHeaderBridge.hpp +3120 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLHeap.hpp +318 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLIOCommandBuffer.hpp +182 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLIOCommandQueue.hpp +211 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLIOCompressor.hpp +94 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLIndirectCommandBuffer.hpp +376 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLIndirectCommandEncoder.hpp +272 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLIntersectionFunctionTable.hpp +173 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLLibrary.hpp +786 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLLinkedFunctions.hpp +110 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLLogState.hpp +111 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLParallelRenderCommandEncoder.hpp +83 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLPipeline.hpp +104 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLPixelFormat.hpp +173 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLPrivate.hpp +156 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLRasterizationRate.hpp +337 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLRenderCommandEncoder.hpp +1019 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLRenderPass.hpp +792 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLRenderPipeline.hpp +1876 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLResidencySet.hpp +178 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLResource.hpp +190 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLResourceStateCommandEncoder.hpp +98 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLResourceStatePass.hpp +154 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLResourceViewPool.hpp +118 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLSampler.hpp +345 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLStageInputOutputDescriptor.hpp +356 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLTensor.hpp +297 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLTexture.hpp +803 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLTextureViewPool.hpp +59 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLTypes.hpp +164 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLVersion.hpp +32 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLVertexDescriptor.hpp +326 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/MTLVisibleFunctionTable.hpp +96 -0
- package/shared/BabylonNative/deps/metal-cpp-src/Metal/Metal.hpp +120 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTL4FXFrameInterpolator.hpp +47 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTL4FXSpatialScaler.hpp +49 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTL4FXTemporalDenoisedScaler.hpp +49 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTL4FXTemporalScaler.hpp +49 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTLFXDefines.hpp +41 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTLFXFrameInterpolator.hpp +719 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTLFXPrivate.hpp +482 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTLFXSpatialScaler.hpp +397 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTLFXTemporalDenoisedScaler.hpp +1208 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MTLFXTemporalScaler.hpp +803 -0
- package/shared/BabylonNative/deps/metal-cpp-src/MetalFX/MetalFX.hpp +35 -0
- package/shared/BabylonNative/deps/metal-cpp-src/QuartzCore/CADefines.hpp +41 -0
- package/shared/BabylonNative/deps/metal-cpp-src/QuartzCore/CAMetalDrawable.hpp +57 -0
- package/shared/BabylonNative/deps/metal-cpp-src/QuartzCore/CAMetalLayer.hpp +216 -0
- package/shared/BabylonNative/deps/metal-cpp-src/QuartzCore/CAPrivate.hpp +150 -0
- package/shared/BabylonNative/deps/metal-cpp-src/QuartzCore/QuartzCore.hpp +28 -0
- package/shared/BabylonNative/deps/metal-cpp-src/README.md +313 -0
- package/shared/BabylonNative/deps/metal-cpp-src/SingleHeader/MakeSingleHeader.py +271 -0
- package/shared/BabylonNative/deps/metal-cpp-src/SingleHeader/Metal.hpp +28735 -0
- package/shared/BabylonNative/deps/spirv-cross-src/spirv_hlsl.cpp +173 -222
- package/shared/BabylonNative/deps/urllib-src/CMakeLists.txt +6 -7
- package/shared/BabylonNative/deps/urllib-src/Source/UrlRequest_Unix.cpp +1 -1
- package/shared/BabylonNative.cpp +4 -0
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/Apple/TestUtilsImpl.mm +0 -57
- package/shared/BabylonNative/Repo/Plugins/TestUtils/Source/TestUtilsImplData.h +0 -18
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Android/Arcana.Android.vcxproj +0 -186
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Shared/Arcana.vcxitems +0 -47
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Windows/Arcana.Windows.Reference.vcxitems +0 -30
- package/shared/BabylonNative/deps/arcana.cpp-src/Source/Windows/Arcana.Windows.vcxproj +0 -218
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/bounds.cpp +0 -2178
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/bounds.h +0 -448
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_color.bin.h +0 -100
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_color.sc +0 -13
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_cubemap.bin.h +0 -223
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_cubemap.sc +0 -21
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_image_swizz.bin.h +0 -256
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_image_swizz.sc +0 -22
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_latlong.bin.h +0 -308
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_latlong.sc +0 -38
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_texture.bin.h +0 -180
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/fs_imgui_texture.sc +0 -16
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_color.bin.h +0 -195
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_color.sc +0 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_cubemap.bin.h +0 -203
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_cubemap.sc +0 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_latlong.bin.h +0 -205
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_latlong.sc +0 -15
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_texture.bin.h +0 -233
- package/shared/BabylonNative/deps/bgfx.cmake-src/bgfx/examples/common/imgui/vs_imgui_texture.sc +0 -16
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*
|
|
2
|
-
* Copyright 2010-
|
|
2
|
+
* Copyright 2010-2026 Branimir Karadzic. All rights reserved.
|
|
3
3
|
* License: https://github.com/bkaradzic/bx/blob/master/LICENSE
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -7,9 +7,33 @@
|
|
|
7
7
|
#include <bx/string.h> // isPrint
|
|
8
8
|
#include <bx/readerwriter.h> // WriterI
|
|
9
9
|
#include <bx/os.h> // exit
|
|
10
|
+
#include <bx/process.h> // ProcessReader
|
|
10
11
|
|
|
11
12
|
#include <inttypes.h> // PRIx*
|
|
12
13
|
|
|
14
|
+
#if BX_PLATFORM_LINUX || BX_PLATFORM_OSX
|
|
15
|
+
# include <cxxabi.h> // abi::__cxa_demangle
|
|
16
|
+
# include <execinfo.h> // backtrace, backtrace_symbols
|
|
17
|
+
# include <unwind.h> // _Unwind_Backtrace
|
|
18
|
+
# include <dlfcn.h>
|
|
19
|
+
#endif // BX_PLATFORM_*
|
|
20
|
+
|
|
21
|
+
#ifndef BX_CONFIG_CALLSTACK_USE_EXECINFO
|
|
22
|
+
# if defined(_EXECINFO_H) || defined(_EXECINFO_H_)
|
|
23
|
+
# define BX_CONFIG_CALLSTACK_USE_EXECINFO 1
|
|
24
|
+
# else
|
|
25
|
+
# define BX_CONFIG_CALLSTACK_USE_EXECINFO 0
|
|
26
|
+
# endif // defined...
|
|
27
|
+
#endif // BX_CONFIG_CALLSTACK_USE_EXECINFO
|
|
28
|
+
|
|
29
|
+
#ifndef BX_CONFIG_CALLSTACK_USE_UNWIND
|
|
30
|
+
# if defined(_UNWIND_H) || defined(__UNWIND_H__)
|
|
31
|
+
# define BX_CONFIG_CALLSTACK_USE_UNWIND 1
|
|
32
|
+
# else
|
|
33
|
+
# define BX_CONFIG_CALLSTACK_USE_UNWIND 0
|
|
34
|
+
# endif // defined...
|
|
35
|
+
#endif // BX_CONFIG_CALLSTACK_USE_UNWIND
|
|
36
|
+
|
|
13
37
|
#ifndef BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE
|
|
14
38
|
# define BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE 0
|
|
15
39
|
#elif BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE
|
|
@@ -19,9 +43,7 @@
|
|
|
19
43
|
#endif // BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE
|
|
20
44
|
|
|
21
45
|
#if BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE
|
|
22
|
-
# include <execinfo.h> // backtrace
|
|
23
46
|
# include <backtrace.h> // backtrace_syminfo
|
|
24
|
-
# include <cxxabi.h> // abi::__cxa_demangle
|
|
25
47
|
#endif // BX_CONFIG_CALLSTACK_*
|
|
26
48
|
|
|
27
49
|
#ifndef BX_CONFIG_EXCEPTION_HANDLING_USE_WINDOWS_SEH
|
|
@@ -29,35 +51,14 @@
|
|
|
29
51
|
#endif // BX_CONFIG_EXCEPTION_HANDLING_USE_WINDOWS_SEH
|
|
30
52
|
|
|
31
53
|
#ifndef BX_CONFIG_EXCEPTION_HANDLING_USE_POSIX_SIGNALS
|
|
32
|
-
# define BX_CONFIG_EXCEPTION_HANDLING_USE_POSIX_SIGNALS 0 \
|
|
33
|
-
|
|
|
54
|
+
# define BX_CONFIG_EXCEPTION_HANDLING_USE_POSIX_SIGNALS ( (0 \
|
|
55
|
+
| BX_PLATFORM_LINUX \
|
|
56
|
+
| BX_PLATFORM_OSX \
|
|
57
|
+
) && !BX_CRT_NONE)
|
|
34
58
|
#endif // BX_CONFIG_EXCEPTION_HANDLING_USE_POSIX_SIGNALS
|
|
35
59
|
|
|
36
60
|
#if BX_CONFIG_EXCEPTION_HANDLING_USE_POSIX_SIGNALS
|
|
37
61
|
# include <signal.h>
|
|
38
|
-
#elif BX_CONFIG_EXCEPTION_HANDLING_USE_WINDOWS_SEH
|
|
39
|
-
|
|
40
|
-
struct ExceptionRecord
|
|
41
|
-
{
|
|
42
|
-
uint32_t exceptionCode;
|
|
43
|
-
uint32_t exceptionFlags;
|
|
44
|
-
|
|
45
|
-
ExceptionRecord* exceptionRecord;
|
|
46
|
-
|
|
47
|
-
uintptr_t exceptionAddress;
|
|
48
|
-
uint32_t numberParameters;
|
|
49
|
-
uintptr_t exceptionInformation[15];
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
struct ExceptionPointers
|
|
53
|
-
{
|
|
54
|
-
ExceptionRecord* exceptionRecord;
|
|
55
|
-
void* contextRecord;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
typedef uint32_t (__stdcall* TopLevelExceptionFilterFn)(ExceptionPointers* _exceptionInfo);
|
|
59
|
-
|
|
60
|
-
extern "C" __declspec(dllimport) TopLevelExceptionFilterFn __stdcall SetUnhandledExceptionFilter(TopLevelExceptionFilterFn _topLevelExceptionFilter);
|
|
61
62
|
#endif // BX_CONFIG_EXCEPTION_HANDLING_*
|
|
62
63
|
|
|
63
64
|
#if BX_CRT_NONE
|
|
@@ -251,21 +252,331 @@ namespace bx
|
|
|
251
252
|
return &s_debugOut;
|
|
252
253
|
}
|
|
253
254
|
|
|
254
|
-
#if
|
|
255
|
-
|
|
255
|
+
#if BX_CONFIG_CALLSTACK_USE_UNWIND
|
|
256
|
+
struct UnwindCallbackData
|
|
257
|
+
{
|
|
258
|
+
uint32_t skip;
|
|
259
|
+
uint32_t max;
|
|
260
|
+
uint32_t num;
|
|
261
|
+
uintptr_t* outStack;
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
static _Unwind_Reason_Code unwindCallback(struct _Unwind_Context* _ctx, void* _arg)
|
|
256
265
|
{
|
|
266
|
+
UnwindCallbackData& ucd = *(UnwindCallbackData*)_arg;
|
|
267
|
+
|
|
268
|
+
if (ucd.num < ucd.max)
|
|
269
|
+
{
|
|
270
|
+
if (0 < ucd.skip)
|
|
271
|
+
{
|
|
272
|
+
--ucd.skip;
|
|
273
|
+
return _URC_NO_REASON;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
uintptr_t addr = _Unwind_GetIP(_ctx);
|
|
277
|
+
if (0 == addr)
|
|
278
|
+
{
|
|
279
|
+
return _URC_END_OF_STACK;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
ucd.outStack[ucd.num++] = uintptr_t(addr);
|
|
283
|
+
return _URC_NO_REASON;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
return _URC_END_OF_STACK;
|
|
287
|
+
}
|
|
288
|
+
#endif // BX_CONFIG_CALLSTACK_USE_UNWIND
|
|
289
|
+
|
|
290
|
+
BX_NO_INLINE uint32_t getCallStackUnwind(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
291
|
+
{
|
|
292
|
+
#if BX_CONFIG_CALLSTACK_USE_UNWIND
|
|
293
|
+
UnwindCallbackData ucd =
|
|
294
|
+
{
|
|
295
|
+
.skip = _skip + 1,
|
|
296
|
+
.max = _max,
|
|
297
|
+
.num = 0,
|
|
298
|
+
.outStack = _outStack,
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
_Unwind_Backtrace(unwindCallback, &ucd);
|
|
302
|
+
|
|
303
|
+
return ucd.num;
|
|
304
|
+
#else
|
|
305
|
+
BX_UNUSED(_skip, _max, _outStack);
|
|
306
|
+
return 0;
|
|
307
|
+
#endif // BX_CONFIG_CALLSTACK_USE_UNWIND
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
BX_NO_INLINE uint32_t getCallStackExecInfoBacktrace(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
311
|
+
{
|
|
312
|
+
#if BX_CONFIG_CALLSTACK_USE_EXECINFO
|
|
257
313
|
const uint32_t max = _skip+_max+1;
|
|
258
|
-
|
|
314
|
+
uintptr_t* tmp = (uintptr_t*)BX_STACK_ALLOC(sizeof(uintptr_t)*max);
|
|
259
315
|
|
|
260
|
-
const uint32_t numFull = backtrace(tmp, max);
|
|
316
|
+
const uint32_t numFull = backtrace( (void**)tmp, max);
|
|
261
317
|
const uint32_t skip = min(_skip + 1 /* skip self */, numFull);
|
|
262
318
|
const uint32_t num = numFull - skip;
|
|
263
319
|
|
|
264
320
|
memCopy(_outStack, tmp + skip, sizeof(uintptr_t)*num);
|
|
265
321
|
|
|
266
322
|
return num;
|
|
323
|
+
#else
|
|
324
|
+
BX_UNUSED(_skip, _max, _outStack);
|
|
325
|
+
return 0;
|
|
326
|
+
#endif // BX_CONFIG_CALLSTACK_USE_EXECINFO
|
|
327
|
+
}
|
|
328
|
+
|
|
329
|
+
static const uintptr_t* nextStackFrame(const uintptr_t* _stackFrame)
|
|
330
|
+
{
|
|
331
|
+
const uintptr_t* newStackFrame = (const uintptr_t*)*_stackFrame;
|
|
332
|
+
|
|
333
|
+
if (newStackFrame <= _stackFrame)
|
|
334
|
+
{
|
|
335
|
+
return NULL;
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
if (uintptr_t(newStackFrame) & (sizeof(uintptr_t) - 1) )
|
|
339
|
+
{
|
|
340
|
+
return NULL;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
return newStackFrame;
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
BX_NO_INLINE uint32_t getCallStackSystemVAbi(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
347
|
+
{
|
|
348
|
+
if (BX_ENABLED( (BX_PLATFORM_LINUX || BX_PLATFORM_OSX) && BX_ARCH_64BIT) )
|
|
349
|
+
{
|
|
350
|
+
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
|
|
351
|
+
const uintptr_t* stackFrame = (const uintptr_t*)__builtin_frame_address(0);
|
|
352
|
+
#else
|
|
353
|
+
const uintptr_t* stackFrame = NULL;
|
|
354
|
+
#endif // BX_COMPILER_...
|
|
355
|
+
|
|
356
|
+
uint32_t num = 0;
|
|
357
|
+
|
|
358
|
+
while (NULL != stackFrame
|
|
359
|
+
&& num < _max)
|
|
360
|
+
{
|
|
361
|
+
if (uintptr_t(0) == stackFrame[1])
|
|
362
|
+
{
|
|
363
|
+
break;
|
|
364
|
+
}
|
|
365
|
+
|
|
366
|
+
if (BX_UNLIKELY(0 < _skip) )
|
|
367
|
+
{
|
|
368
|
+
--_skip;
|
|
369
|
+
}
|
|
370
|
+
else
|
|
371
|
+
{
|
|
372
|
+
_outStack[num++] = stackFrame[1];
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
stackFrame = nextStackFrame(stackFrame);
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
return num;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
return 0;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
BX_NO_INLINE uint32_t getCallStackGccBuiltin(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
385
|
+
{
|
|
386
|
+
#if BX_COMPILER_GCC || BX_COMPILER_CLANG
|
|
387
|
+
BX_PRAGMA_DIAGNOSTIC_PUSH();
|
|
388
|
+
BX_PRAGMA_DIAGNOSTIC_IGNORED_CLANG_GCC("-Wframe-address");
|
|
389
|
+
|
|
390
|
+
uint32_t num = 0;
|
|
391
|
+
|
|
392
|
+
#define RETURN_ADDRESS(_x) \
|
|
393
|
+
if (num < _max) \
|
|
394
|
+
{ \
|
|
395
|
+
if (0 < _skip) \
|
|
396
|
+
{ \
|
|
397
|
+
--_skip; \
|
|
398
|
+
} \
|
|
399
|
+
else \
|
|
400
|
+
{ \
|
|
401
|
+
if (NULL == __builtin_frame_address(_x) ) \
|
|
402
|
+
{ \
|
|
403
|
+
return num; \
|
|
404
|
+
} \
|
|
405
|
+
\
|
|
406
|
+
void* addr = __builtin_return_address(_x); \
|
|
407
|
+
\
|
|
408
|
+
if (NULL == addr) \
|
|
409
|
+
{ \
|
|
410
|
+
return num; \
|
|
411
|
+
} \
|
|
412
|
+
\
|
|
413
|
+
_outStack[num++] = uintptr_t(addr); \
|
|
414
|
+
} \
|
|
415
|
+
} \
|
|
416
|
+
else \
|
|
417
|
+
{ \
|
|
418
|
+
return num; \
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
RETURN_ADDRESS(0);
|
|
422
|
+
RETURN_ADDRESS(1);
|
|
423
|
+
RETURN_ADDRESS(2);
|
|
424
|
+
RETURN_ADDRESS(3);
|
|
425
|
+
RETURN_ADDRESS(4);
|
|
426
|
+
RETURN_ADDRESS(5);
|
|
427
|
+
RETURN_ADDRESS(6);
|
|
428
|
+
RETURN_ADDRESS(7);
|
|
429
|
+
RETURN_ADDRESS(8);
|
|
430
|
+
RETURN_ADDRESS(9);
|
|
431
|
+
|
|
432
|
+
RETURN_ADDRESS(10);
|
|
433
|
+
RETURN_ADDRESS(11);
|
|
434
|
+
RETURN_ADDRESS(12);
|
|
435
|
+
RETURN_ADDRESS(13);
|
|
436
|
+
RETURN_ADDRESS(14);
|
|
437
|
+
RETURN_ADDRESS(15);
|
|
438
|
+
RETURN_ADDRESS(16);
|
|
439
|
+
RETURN_ADDRESS(17);
|
|
440
|
+
RETURN_ADDRESS(18);
|
|
441
|
+
RETURN_ADDRESS(19);
|
|
442
|
+
|
|
443
|
+
RETURN_ADDRESS(20);
|
|
444
|
+
RETURN_ADDRESS(21);
|
|
445
|
+
RETURN_ADDRESS(22);
|
|
446
|
+
RETURN_ADDRESS(23);
|
|
447
|
+
RETURN_ADDRESS(24);
|
|
448
|
+
RETURN_ADDRESS(25);
|
|
449
|
+
RETURN_ADDRESS(26);
|
|
450
|
+
RETURN_ADDRESS(27);
|
|
451
|
+
RETURN_ADDRESS(28);
|
|
452
|
+
RETURN_ADDRESS(29);
|
|
453
|
+
|
|
454
|
+
RETURN_ADDRESS(30);
|
|
455
|
+
RETURN_ADDRESS(31);
|
|
456
|
+
|
|
457
|
+
#undef RETURN_ADDRESS
|
|
458
|
+
|
|
459
|
+
BX_PRAGMA_DIAGNOSTIC_POP();
|
|
460
|
+
|
|
461
|
+
return num;
|
|
462
|
+
#else
|
|
463
|
+
BX_UNUSED(_skip, _max, _outStack);
|
|
464
|
+
return 0;
|
|
465
|
+
#endif // BX_COMPILER_GCC || BX_COMPILER_CLANG
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
#if !BX_PLATFORM_WINDOWS
|
|
469
|
+
# define __stdcall
|
|
470
|
+
#endif // !BX_PLATFORM_WINDOWS
|
|
471
|
+
|
|
472
|
+
typedef uint16_t (__stdcall* RtlCaptureStackBackTraceFn)(uint32_t _framesToSkip, uint32_t _framesToCapture, void** _outBacktrace, uint32_t* _outhash);
|
|
473
|
+
|
|
474
|
+
uint16_t __stdcall stubTryLoadRtlCaptureStackBackTrace(uint32_t _framesToSkip, uint32_t _framesToCapture, void** _outBacktrace, uint32_t* _outhash);
|
|
475
|
+
RtlCaptureStackBackTraceFn RtlCaptureStackBackTrace = stubTryLoadRtlCaptureStackBackTrace;
|
|
476
|
+
|
|
477
|
+
uint16_t __stdcall stubRtlCaptureStackBackTrace(uint32_t _framesToSkip, uint32_t _framesToCapture, void** _outBacktrace, uint32_t* _outhash)
|
|
478
|
+
{
|
|
479
|
+
BX_UNUSED(_framesToSkip, _framesToCapture, _outBacktrace, _outhash);
|
|
480
|
+
return 0;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
uint16_t __stdcall stubTryLoadRtlCaptureStackBackTrace(uint32_t _framesToSkip, uint32_t _framesToCapture, void** _outBacktrace, uint32_t* _outhash)
|
|
484
|
+
{
|
|
485
|
+
void* kernel32Dll = bx::dlopen("kernel32.dll");
|
|
486
|
+
|
|
487
|
+
RtlCaptureStackBackTraceFn fn = NULL != kernel32Dll
|
|
488
|
+
? bx::dlsym<RtlCaptureStackBackTraceFn>(kernel32Dll, "RtlCaptureStackBackTrace")
|
|
489
|
+
: NULL
|
|
490
|
+
;
|
|
491
|
+
|
|
492
|
+
RtlCaptureStackBackTrace = NULL != fn
|
|
493
|
+
? fn
|
|
494
|
+
: stubRtlCaptureStackBackTrace
|
|
495
|
+
;
|
|
496
|
+
|
|
497
|
+
return RtlCaptureStackBackTrace(_framesToSkip, _framesToCapture, _outBacktrace, _outhash);
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
BX_NO_INLINE uint32_t getCallStackWinRtl(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
501
|
+
{
|
|
502
|
+
#if BX_PLATFORM_WINDOWS
|
|
503
|
+
return RtlCaptureStackBackTrace(_skip + 1 /* skip self */, _max, (void**)_outStack, NULL);
|
|
504
|
+
#else
|
|
505
|
+
BX_UNUSED(_skip, _max, _outStack);
|
|
506
|
+
return 0;
|
|
507
|
+
#endif // BX_PLATFORM_WINDOWS
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
BX_NO_INLINE uint32_t getCallStackWinAbi(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
511
|
+
{
|
|
512
|
+
if (BX_ENABLED(BX_PLATFORM_WINDOWS && BX_CPU_X86 && BX_ARCH_32BIT) )
|
|
513
|
+
{
|
|
514
|
+
const uintptr_t* stackFrame = (uintptr_t*)&_skip - 2;
|
|
515
|
+
|
|
516
|
+
uint32_t num = 0;
|
|
517
|
+
|
|
518
|
+
while (NULL != stackFrame
|
|
519
|
+
&& num < _max)
|
|
520
|
+
{
|
|
521
|
+
if (uintptr_t(0) == stackFrame[1])
|
|
522
|
+
{
|
|
523
|
+
break;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
if (BX_UNLIKELY(0 < _skip) )
|
|
527
|
+
{
|
|
528
|
+
--_skip;
|
|
529
|
+
}
|
|
530
|
+
else
|
|
531
|
+
{
|
|
532
|
+
_outStack[num++] = stackFrame[1];
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
stackFrame = nextStackFrame(stackFrame);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return num;
|
|
539
|
+
}
|
|
540
|
+
else if (BX_ENABLED(BX_PLATFORM_WINDOWS && BX_CPU_X86 && BX_ARCH_64BIT) )
|
|
541
|
+
{
|
|
542
|
+
return getCallStackWinRtl(_skip + 1 /* skip self */, _max, _outStack);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
return 0;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
BX_NO_INLINE uint32_t getCallStackFast(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
549
|
+
{
|
|
550
|
+
#if BX_PLATFORM_LINUX || BX_PLATFORM_OSX
|
|
551
|
+
return getCallStackSystemVAbi(_skip + 1 /* skip self */, _max, _outStack);
|
|
552
|
+
#elif BX_PLATFORM_WINDOWS
|
|
553
|
+
return getCallStackWinAbi(_skip + 1 /* skip self */, _max, _outStack);
|
|
554
|
+
#elif BX_COMPILER_GCC || BX_COMPILER_CLANG
|
|
555
|
+
return getCallStackGccBuiltin(_skip + 1 /* skip self */, _max, _outStack);
|
|
556
|
+
#else
|
|
557
|
+
BX_UNUSED(_skip, _max, _outStack);
|
|
558
|
+
return 0;
|
|
559
|
+
#endif // BX_PLATFORM_*
|
|
560
|
+
}
|
|
561
|
+
|
|
562
|
+
BX_NO_INLINE uint32_t getCallStackExact(uint32_t _skip, uint32_t _max, uintptr_t* _outStack)
|
|
563
|
+
{
|
|
564
|
+
#if BX_PLATFORM_LINUX
|
|
565
|
+
return getCallStackUnwind(_skip + 1 /* skip self */, _max, _outStack);
|
|
566
|
+
#elif BX_PLATFORM_OSX
|
|
567
|
+
return getCallStackExecInfoBacktrace(_skip + 1 /* skip self */, _max, _outStack);
|
|
568
|
+
#elif BX_PLATFORM_WINDOWS
|
|
569
|
+
return getCallStackWinRtl(_skip + 1 /* skip self */, _max, _outStack);
|
|
570
|
+
#else
|
|
571
|
+
BX_UNUSED(_skip, _max, _outStack);
|
|
572
|
+
return 0;
|
|
573
|
+
#endif // BX_PLATFORM_*
|
|
267
574
|
}
|
|
268
575
|
|
|
576
|
+
static constexpr uint32_t kWidth = 80;
|
|
577
|
+
static constexpr uint32_t kWidthPc = 16;
|
|
578
|
+
|
|
579
|
+
#if BX_CONFIG_CALLSTACK_USE_LIB_BACKTRACE
|
|
269
580
|
struct StackTraceContext
|
|
270
581
|
{
|
|
271
582
|
StackTraceContext()
|
|
@@ -312,7 +623,7 @@ namespace bx
|
|
|
312
623
|
return 1;
|
|
313
624
|
}
|
|
314
625
|
|
|
315
|
-
int32_t writeCallstack(WriterI* _writer, uintptr_t* _stack, uint32_t _num, Error* _err)
|
|
626
|
+
int32_t writeCallstack(WriterI* _writer, const uintptr_t* _stack, uint32_t _num, Error* _err)
|
|
316
627
|
{
|
|
317
628
|
BX_ERROR_SCOPE(_err);
|
|
318
629
|
|
|
@@ -321,8 +632,7 @@ namespace bx
|
|
|
321
632
|
|
|
322
633
|
int32_t total = write(_writer, _err, "Callstack (%d):\n", _num);
|
|
323
634
|
|
|
324
|
-
|
|
325
|
-
total += write(_writer, _err, "\t #: %-*s Line: PC --- Function ---\n", kWidth, "File ---");
|
|
635
|
+
total += write(_writer, _err, "\t #: %-*s Line %-*s Function ---\n", kWidth, "File ---", kWidthPc, "PC ---");
|
|
326
636
|
|
|
327
637
|
CallbackData cbData;
|
|
328
638
|
|
|
@@ -330,9 +640,10 @@ namespace bx
|
|
|
330
640
|
{
|
|
331
641
|
backtrace_pcinfo(s_stCtx.state, _stack[ii], backtraceFullCb, NULL, &cbData);
|
|
332
642
|
|
|
333
|
-
StringView demangledName;
|
|
643
|
+
StringView demangledName = "<Unknown?>";
|
|
334
644
|
|
|
335
|
-
if (1 == backtrace_syminfo(s_stCtx.state, _stack[ii], backtraceSymInfoCb, NULL, &cbData)
|
|
645
|
+
if (1 == backtrace_syminfo(s_stCtx.state, _stack[ii], backtraceSymInfoCb, NULL, &cbData)
|
|
646
|
+
&& !cbData.resolvedName.isEmpty() )
|
|
336
647
|
{
|
|
337
648
|
demangleLen = BX_COUNTOF(demangleBuf);
|
|
338
649
|
int32_t demangleStatus;
|
|
@@ -340,26 +651,19 @@ namespace bx
|
|
|
340
651
|
|
|
341
652
|
if (0 == demangleStatus)
|
|
342
653
|
{
|
|
343
|
-
demangledName.set(demangleBuf, demangleLen);
|
|
344
|
-
}
|
|
345
|
-
else
|
|
346
|
-
{
|
|
347
|
-
demangledName = cbData.resolvedName;
|
|
654
|
+
demangledName.set({demangleBuf, narrowCast<int32_t>(demangleLen) });
|
|
348
655
|
}
|
|
349
656
|
}
|
|
350
|
-
else
|
|
351
|
-
{
|
|
352
|
-
demangledName = "???";
|
|
353
|
-
}
|
|
354
657
|
|
|
355
|
-
const StringView
|
|
658
|
+
const StringView fileName = strTail(cbData.fileName, kWidth);
|
|
356
659
|
|
|
357
660
|
total += write(_writer, _err
|
|
358
|
-
, "\t%2d: %-*S % 5d
|
|
661
|
+
, "\t%2d: %-*S % 5d %*p %S\n"
|
|
359
662
|
, ii
|
|
360
663
|
, kWidth
|
|
361
|
-
, &
|
|
664
|
+
, &fileName
|
|
362
665
|
, cbData.line
|
|
666
|
+
, kWidthPc
|
|
363
667
|
, _stack[ii]
|
|
364
668
|
, &demangledName
|
|
365
669
|
);
|
|
@@ -380,27 +684,493 @@ namespace bx
|
|
|
380
684
|
return total;
|
|
381
685
|
}
|
|
382
686
|
|
|
383
|
-
#
|
|
687
|
+
#elif BX_PLATFORM_WINDOWS
|
|
384
688
|
|
|
385
|
-
|
|
689
|
+
struct DbgHelpSymbolInfo
|
|
386
690
|
{
|
|
387
|
-
|
|
388
|
-
|
|
691
|
+
uint32_t SizeOfStruct;
|
|
692
|
+
uint32_t TypeIndex;
|
|
693
|
+
uint64_t Reserved[2];
|
|
694
|
+
uint32_t Index;
|
|
695
|
+
uint32_t Size;
|
|
696
|
+
uint64_t ModBase;
|
|
697
|
+
uint32_t Flags;
|
|
698
|
+
uint64_t Value;
|
|
699
|
+
uint64_t Address;
|
|
700
|
+
uint32_t Register;
|
|
701
|
+
uint32_t Scope;
|
|
702
|
+
uint32_t Tag;
|
|
703
|
+
uint32_t NameLen;
|
|
704
|
+
uint32_t MaxNameLen;
|
|
705
|
+
char Name[512];
|
|
706
|
+
};
|
|
707
|
+
|
|
708
|
+
struct ImageHlpLine
|
|
709
|
+
{
|
|
710
|
+
uint32_t SizeOfStruct;
|
|
711
|
+
void* Key;
|
|
712
|
+
uint32_t LineNumber;
|
|
713
|
+
const char* FileName;
|
|
714
|
+
uintptr_t Address;
|
|
715
|
+
};
|
|
716
|
+
|
|
717
|
+
typedef bool (__stdcall* SymInitializeFn)(void* _process, const char* _userSearchPath, bool _invadeProcess);
|
|
718
|
+
typedef bool (__stdcall* SymCleanupFn)(void* _process);
|
|
719
|
+
typedef bool (__stdcall* SymFromAddrFn)(void* _process, uint64_t _address, uint64_t* _outDisplacement, DbgHelpSymbolInfo* _inoutSymbol);
|
|
720
|
+
typedef bool (__stdcall* SymGetLineFromAddrFn)(void* _process, uintptr_t _address, uint32_t* _outDisplacement, ImageHlpLine* _inoutLine);
|
|
721
|
+
|
|
722
|
+
constexpr uint32_t kSymOptUndName = 0x00000002;
|
|
723
|
+
constexpr uint32_t kSymOptDeferredLoads = 0x00000004;
|
|
724
|
+
constexpr uint32_t kSymOptLoadLines = 0x00000010;
|
|
725
|
+
|
|
726
|
+
static void* kCurrentProcess = (void*)UINTPTR_MAX;
|
|
727
|
+
|
|
728
|
+
typedef uint32_t (__stdcall* SymSetOptionsFn)(uint32_t _options);
|
|
729
|
+
|
|
730
|
+
struct DbgHelpSymbolResolve
|
|
731
|
+
{
|
|
732
|
+
DbgHelpSymbolResolve()
|
|
733
|
+
{
|
|
734
|
+
m_imageHlpDll = dlopen("dbghelp.dll");
|
|
735
|
+
|
|
736
|
+
if (NULL != m_imageHlpDll)
|
|
737
|
+
{
|
|
738
|
+
auto symInitialize = dlsym<SymInitializeFn >(m_imageHlpDll, "SymInitialize");
|
|
739
|
+
auto symSetOptions = dlsym<SymSetOptionsFn >(m_imageHlpDll, "SymSetOptions");
|
|
740
|
+
auto symCleanup = dlsym<SymCleanupFn >(m_imageHlpDll, "SymCleanup");
|
|
741
|
+
auto symFromAddr = dlsym<SymFromAddrFn >(m_imageHlpDll, "SymFromAddr");
|
|
742
|
+
auto symGetLineFromAddr = dlsym<SymGetLineFromAddrFn>(m_imageHlpDll, BX_ARCH_32BIT ? "SymGetLineFromAddr" : "SymGetLineFromAddr64");
|
|
743
|
+
|
|
744
|
+
if (true
|
|
745
|
+
&& NULL != symInitialize
|
|
746
|
+
&& NULL != symSetOptions
|
|
747
|
+
&& NULL != symCleanup
|
|
748
|
+
&& NULL != symFromAddr
|
|
749
|
+
&& NULL != symGetLineFromAddr
|
|
750
|
+
)
|
|
751
|
+
{
|
|
752
|
+
symSetOptions(kSymOptUndName | kSymOptDeferredLoads | kSymOptLoadLines);
|
|
753
|
+
|
|
754
|
+
char symCache[1024] = "SRV*";
|
|
755
|
+
uint32_t len = BX_COUNTOF(symCache) - 4;
|
|
756
|
+
if (getEnv(symCache + 4, &len, "TEMP") )
|
|
757
|
+
{
|
|
758
|
+
len += 4;
|
|
759
|
+
snprintf(symCache + len, BX_COUNTOF(symCache) - len, "\\SymbolCache*http://msdl.microsoft.com/download/symbols;");
|
|
760
|
+
}
|
|
761
|
+
else
|
|
762
|
+
{
|
|
763
|
+
symCache[0] = '\0';
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
if (symInitialize(kCurrentProcess, symCache, true) )
|
|
767
|
+
{
|
|
768
|
+
m_symCleanup = symCleanup;
|
|
769
|
+
m_symFromAddr = symFromAddr;
|
|
770
|
+
m_symGetLineFromAddr = symGetLineFromAddr;
|
|
771
|
+
}
|
|
772
|
+
else
|
|
773
|
+
{
|
|
774
|
+
BX_TRACE("Failed to initialize debug symbols!");
|
|
775
|
+
cleanup();
|
|
776
|
+
}
|
|
777
|
+
}
|
|
778
|
+
else
|
|
779
|
+
{
|
|
780
|
+
BX_TRACE("Failed to obtain debug symbols functions!");
|
|
781
|
+
cleanup();
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
~DbgHelpSymbolResolve()
|
|
787
|
+
{
|
|
788
|
+
cleanup();
|
|
789
|
+
}
|
|
790
|
+
|
|
791
|
+
bool hasSymbols() const
|
|
792
|
+
{
|
|
793
|
+
return NULL != m_imageHlpDll;
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
bool resolve(uintptr_t _addr, FixedString1024& _outFunctionName, FilePath& _outFilePath, int32_t& _outLine) const
|
|
797
|
+
{
|
|
798
|
+
if (hasSymbols() )
|
|
799
|
+
{
|
|
800
|
+
DbgHelpSymbolInfo dhsi = {};
|
|
801
|
+
dhsi.SizeOfStruct = sizeof(DbgHelpSymbolInfo) - sizeof(dhsi.Name);
|
|
802
|
+
dhsi.MaxNameLen = sizeof(dhsi.Name);
|
|
803
|
+
|
|
804
|
+
ImageHlpLine ihl = {};
|
|
805
|
+
ihl.SizeOfStruct = sizeof(ImageHlpLine);
|
|
806
|
+
|
|
807
|
+
uint32_t lineDisplacement;
|
|
808
|
+
|
|
809
|
+
if (true
|
|
810
|
+
&& m_symFromAddr(kCurrentProcess, _addr, NULL, &dhsi)
|
|
811
|
+
&& m_symGetLineFromAddr(kCurrentProcess, _addr, &lineDisplacement, &ihl)
|
|
812
|
+
)
|
|
813
|
+
{
|
|
814
|
+
_outFunctionName.set(dhsi.Name);
|
|
815
|
+
_outFilePath.set(ihl.FileName);
|
|
816
|
+
_outLine = ihl.LineNumber;
|
|
817
|
+
|
|
818
|
+
return true;
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
|
|
822
|
+
return false;
|
|
823
|
+
}
|
|
824
|
+
|
|
825
|
+
void cleanup()
|
|
826
|
+
{
|
|
827
|
+
if (NULL != m_imageHlpDll)
|
|
828
|
+
{
|
|
829
|
+
if (NULL != m_symCleanup)
|
|
830
|
+
{
|
|
831
|
+
m_symCleanup(kCurrentProcess);
|
|
832
|
+
}
|
|
833
|
+
|
|
834
|
+
m_symCleanup = NULL;
|
|
835
|
+
m_symFromAddr = NULL;
|
|
836
|
+
m_symGetLineFromAddr = NULL;
|
|
837
|
+
|
|
838
|
+
dlclose(m_imageHlpDll);
|
|
839
|
+
m_imageHlpDll = NULL;
|
|
840
|
+
}
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
void* m_imageHlpDll = NULL;
|
|
844
|
+
|
|
845
|
+
SymCleanupFn m_symCleanup = NULL;
|
|
846
|
+
SymFromAddrFn m_symFromAddr = NULL;
|
|
847
|
+
SymGetLineFromAddrFn m_symGetLineFromAddr = NULL;
|
|
848
|
+
};
|
|
849
|
+
|
|
850
|
+
static DbgHelpSymbolResolve s_dbgHelpSymbolResolve;
|
|
851
|
+
|
|
852
|
+
int32_t writeCallstack(WriterI* _writer, const uintptr_t* _stack, uint32_t _num, Error* _err)
|
|
853
|
+
{
|
|
854
|
+
int32_t total = write(_writer, _err, "Callstack (%d):\n", _num);
|
|
855
|
+
|
|
856
|
+
total += write(_writer, _err, "\t #: %-*s Line %-*s Function ---\n", kWidth, "File ---", kWidthPc, "PC ---");
|
|
857
|
+
|
|
858
|
+
for (uint32_t ii = 0; ii < _num && _err->isOk(); ++ii)
|
|
859
|
+
{
|
|
860
|
+
FixedString1024 functionName;
|
|
861
|
+
FilePath filePath;
|
|
862
|
+
int32_t line;
|
|
863
|
+
|
|
864
|
+
if (!s_dbgHelpSymbolResolve.resolve(_stack[ii], functionName, filePath, line))
|
|
865
|
+
{
|
|
866
|
+
functionName = "<Unknown?>";
|
|
867
|
+
filePath = "<Unknown?>";
|
|
868
|
+
line = -1;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
const StringView fileName = strTail(filePath, kWidth);
|
|
872
|
+
|
|
873
|
+
total += write(_writer, _err
|
|
874
|
+
, "\t%2d: %-*S % 5d %*p %s\n"
|
|
875
|
+
, ii
|
|
876
|
+
, kWidth
|
|
877
|
+
, &fileName
|
|
878
|
+
, line
|
|
879
|
+
, kWidthPc
|
|
880
|
+
, _stack[ii]
|
|
881
|
+
, functionName.getCPtr()
|
|
882
|
+
);
|
|
883
|
+
}
|
|
884
|
+
|
|
885
|
+
return total;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
#elif BX_CONFIG_CALLSTACK_USE_EXECINFO
|
|
889
|
+
|
|
890
|
+
StringView strConsumeTo(StringView& _input, const StringView& _find)
|
|
891
|
+
{
|
|
892
|
+
const StringView to = strFind(_input, _find);
|
|
893
|
+
|
|
894
|
+
if (!to.isEmpty() )
|
|
895
|
+
{
|
|
896
|
+
const StringView result(_input.getPtr(), to.getPtr() );
|
|
897
|
+
|
|
898
|
+
_input.set(to.getTerm(), _input.getTerm() );
|
|
899
|
+
|
|
900
|
+
return result;
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
return StringView();
|
|
389
904
|
}
|
|
390
905
|
|
|
391
|
-
int32_t writeCallstack(WriterI* _writer, uintptr_t* _stack, uint32_t _num, Error* _err)
|
|
906
|
+
int32_t writeCallstack(WriterI* _writer, const uintptr_t* _stack, uint32_t _num, Error* _err)
|
|
392
907
|
{
|
|
393
|
-
|
|
394
|
-
|
|
908
|
+
int32_t total = write(_writer, _err, "Callstack (%d):\n", _num);
|
|
909
|
+
|
|
910
|
+
// Linux:
|
|
911
|
+
// <executable>([function]<+offset>)<space>[<address>]
|
|
912
|
+
//
|
|
913
|
+
// macOS:
|
|
914
|
+
// <index><space><executable><space><address><space><function><space>+<space><offset>
|
|
915
|
+
char** symbols = backtrace_symbols( (void* const*) _stack, _num);
|
|
916
|
+
|
|
917
|
+
# if BX_PLATFORM_LINUX
|
|
918
|
+
|
|
919
|
+
struct Addr2Line
|
|
920
|
+
{
|
|
921
|
+
StringView functionName;
|
|
922
|
+
StringView filePath;
|
|
923
|
+
int32_t line;
|
|
924
|
+
};
|
|
925
|
+
|
|
926
|
+
char addr2LineBuffer[32<<10];
|
|
927
|
+
Addr2Line* addr2Line = (Addr2Line*)BX_STACK_ALLOC(_num * sizeof(Addr2Line) );
|
|
928
|
+
|
|
929
|
+
{
|
|
930
|
+
FixedStringT<4096> args;
|
|
931
|
+
FilePath first;
|
|
932
|
+
|
|
933
|
+
for (uint32_t ii = 0; ii < _num; ++ii)
|
|
934
|
+
{
|
|
935
|
+
Addr2Line& a2l = addr2Line[ii];
|
|
936
|
+
|
|
937
|
+
a2l.functionName = "<Unknown?>";
|
|
938
|
+
a2l.filePath = "<Unknown?>";
|
|
939
|
+
a2l.line = -1;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
for (uint32_t ii = 0; ii < _num; ++ii)
|
|
943
|
+
{
|
|
944
|
+
const StringView line(symbols[ii]);
|
|
945
|
+
|
|
946
|
+
const StringView parenS = strFind(line, '(');
|
|
947
|
+
|
|
948
|
+
if (parenS.isEmpty() )
|
|
949
|
+
{
|
|
950
|
+
continue;
|
|
951
|
+
}
|
|
952
|
+
|
|
953
|
+
const FilePath filePath({ line.getPtr(), parenS.getPtr() });
|
|
954
|
+
|
|
955
|
+
StringView offset(parenS.getTerm(), line.getTerm() );
|
|
956
|
+
const StringView parenE = strFind(offset, ')');
|
|
957
|
+
|
|
958
|
+
if (parenE.isEmpty() )
|
|
959
|
+
{
|
|
960
|
+
continue;
|
|
961
|
+
}
|
|
962
|
+
|
|
963
|
+
offset.set(parenS.getTerm(), parenE.getPtr() );
|
|
964
|
+
|
|
965
|
+
if (first.isEmpty() )
|
|
966
|
+
{
|
|
967
|
+
first.set(filePath);
|
|
968
|
+
|
|
969
|
+
args.append("-C -f -e ");
|
|
970
|
+
args.append(filePath);
|
|
971
|
+
}
|
|
972
|
+
|
|
973
|
+
if (first != filePath)
|
|
974
|
+
{
|
|
975
|
+
continue;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
args.append(" ");
|
|
979
|
+
args.append(offset);
|
|
980
|
+
}
|
|
981
|
+
|
|
982
|
+
{
|
|
983
|
+
ProcessReader reader;
|
|
984
|
+
if (open(&reader, "addr2line", args, ErrorIgnore{}) )
|
|
985
|
+
{
|
|
986
|
+
int32_t bytes = read(&reader, addr2LineBuffer, sizeof(addr2LineBuffer), ErrorIgnore{});
|
|
987
|
+
|
|
988
|
+
if (-1 != bytes)
|
|
989
|
+
{
|
|
990
|
+
uint32_t ii = 0;
|
|
991
|
+
for (LineReader lr({addr2LineBuffer, bytes}); !lr.isDone(); ++ii)
|
|
992
|
+
{
|
|
993
|
+
const StringView functionName = lr.next();
|
|
994
|
+
|
|
995
|
+
const StringView filePath = lr.next();
|
|
996
|
+
|
|
997
|
+
const StringView colon = strFind(filePath, ':');
|
|
998
|
+
|
|
999
|
+
if (!colon.isEmpty() )
|
|
1000
|
+
{
|
|
1001
|
+
Addr2Line& a2l = addr2Line[ii];
|
|
1002
|
+
|
|
1003
|
+
a2l.functionName = functionName;
|
|
1004
|
+
a2l.filePath = StringView(filePath.getPtr(), colon.getPtr() );
|
|
1005
|
+
fromString(&a2l.line, StringView(strWord({ colon.getTerm(), filePath.getTerm() }) ) );
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
|
|
1010
|
+
close(&reader);
|
|
1011
|
+
}
|
|
1012
|
+
}
|
|
1013
|
+
}
|
|
1014
|
+
# elif BX_PLATFORM_OSX
|
|
1015
|
+
|
|
1016
|
+
char atosBuffer[32<<10];
|
|
1017
|
+
|
|
1018
|
+
# endif // BX_PLATFORM_*
|
|
1019
|
+
|
|
1020
|
+
total += write(_writer, _err, "\t #: %-*s Line %-*s Function ---\n", kWidth, "File ---", kWidthPc, "PC ---");
|
|
1021
|
+
|
|
1022
|
+
for (uint32_t ii = 0; ii < _num && _err->isOk(); ++ii)
|
|
1023
|
+
{
|
|
1024
|
+
FixedString1024 functionName;
|
|
1025
|
+
FilePath filePath("<Unknown?>");
|
|
1026
|
+
int32_t line = -1;
|
|
1027
|
+
|
|
1028
|
+
# if BX_PLATFORM_LINUX
|
|
1029
|
+
filePath = addr2Line[ii].filePath;
|
|
1030
|
+
line = addr2Line[ii].line;
|
|
1031
|
+
functionName = addr2Line[ii].functionName;
|
|
1032
|
+
|
|
1033
|
+
# elif BX_PLATFORM_OSX
|
|
1034
|
+
StringView atosFunctionName("<Unknown?>");
|
|
1035
|
+
|
|
1036
|
+
functionName.set(
|
|
1037
|
+
strWord(
|
|
1038
|
+
strLTrimSpace(
|
|
1039
|
+
strLTrimNonSpace(
|
|
1040
|
+
strLTrimSpace(
|
|
1041
|
+
strLTrimNonSpace(
|
|
1042
|
+
strLTrimSpace(
|
|
1043
|
+
strLTrimNonSpace(
|
|
1044
|
+
symbols[ii]
|
|
1045
|
+
) ) ) ) ) ) )
|
|
1046
|
+
);
|
|
1047
|
+
|
|
1048
|
+
Dl_info info;
|
|
1049
|
+
dladdr( (const void*)_stack[ii], &info);
|
|
1050
|
+
|
|
1051
|
+
{
|
|
1052
|
+
char args[4096];
|
|
1053
|
+
|
|
1054
|
+
snprintf(args, BX_COUNTOF(args), "--fullPath -o %s -l %x %x"
|
|
1055
|
+
, info.dli_fname
|
|
1056
|
+
, info.dli_fbase
|
|
1057
|
+
, _stack[ii]
|
|
1058
|
+
);
|
|
1059
|
+
|
|
1060
|
+
ProcessReader reader;
|
|
1061
|
+
if (open(&reader, "atos", args, ErrorIgnore{}) )
|
|
1062
|
+
{
|
|
1063
|
+
int32_t bytes = read(&reader, atosBuffer, sizeof(atosBuffer), ErrorIgnore{});
|
|
1064
|
+
|
|
1065
|
+
if (-1 != bytes)
|
|
1066
|
+
{
|
|
1067
|
+
for (LineReader lr({atosBuffer, bytes}); !lr.isDone();)
|
|
1068
|
+
{
|
|
1069
|
+
StringView input = lr.next();
|
|
1070
|
+
|
|
1071
|
+
atosFunctionName = strConsumeTo(input, " (");
|
|
1072
|
+
|
|
1073
|
+
if (atosFunctionName.isEmpty() )
|
|
1074
|
+
{
|
|
1075
|
+
break;
|
|
1076
|
+
}
|
|
1077
|
+
|
|
1078
|
+
filePath = strConsumeTo(input, ":");
|
|
1079
|
+
|
|
1080
|
+
if (filePath.isEmpty() )
|
|
1081
|
+
{
|
|
1082
|
+
filePath = "<Unknown?>";
|
|
1083
|
+
break;
|
|
1084
|
+
}
|
|
1085
|
+
|
|
1086
|
+
const StringView lineStr = strConsumeTo(input, ")");
|
|
1087
|
+
|
|
1088
|
+
if (!lineStr.isEmpty() )
|
|
1089
|
+
{
|
|
1090
|
+
fromString(&line, lineStr);
|
|
1091
|
+
}
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
close(&reader);
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
char demangleBuf[4096];
|
|
1100
|
+
size_t demangleLen = BX_COUNTOF(demangleBuf);
|
|
1101
|
+
int32_t demangleStatus;
|
|
1102
|
+
abi::__cxa_demangle(functionName.getCPtr(), demangleBuf, &demangleLen, &demangleStatus);
|
|
1103
|
+
|
|
1104
|
+
if (0 == demangleStatus)
|
|
1105
|
+
{
|
|
1106
|
+
functionName.set({demangleBuf, narrowCast<int32_t>(demangleLen) });
|
|
1107
|
+
}
|
|
1108
|
+
else
|
|
1109
|
+
{
|
|
1110
|
+
functionName = atosFunctionName;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
# endif // BX_PLATFORM_*
|
|
1114
|
+
|
|
1115
|
+
const StringView fileName = strTail(filePath, kWidth);
|
|
1116
|
+
|
|
1117
|
+
total += write(_writer, _err
|
|
1118
|
+
, "\t%2d: %-*S % 5d %*p %s\n"
|
|
1119
|
+
, ii
|
|
1120
|
+
, kWidth
|
|
1121
|
+
, &fileName
|
|
1122
|
+
, line
|
|
1123
|
+
, kWidthPc
|
|
1124
|
+
, _stack[ii]
|
|
1125
|
+
, functionName.getCPtr()
|
|
1126
|
+
);
|
|
1127
|
+
}
|
|
1128
|
+
|
|
1129
|
+
/*backtrace_symbols_*/::free(symbols);
|
|
1130
|
+
|
|
1131
|
+
return total;
|
|
1132
|
+
}
|
|
1133
|
+
|
|
1134
|
+
#else
|
|
1135
|
+
|
|
1136
|
+
int32_t writeCallstack(WriterI* _writer, const uintptr_t* _stack, uint32_t _num, Error* _err)
|
|
1137
|
+
{
|
|
1138
|
+
int32_t total = write(_writer, _err, "Callstack (%d): - symbol resolve is not available\n", _num);
|
|
1139
|
+
|
|
1140
|
+
total += write(_writer, _err, "\t #: %-*s Line %-*s Function ---\n", kWidth, "File ---", kWidthPc, "PC ---");
|
|
1141
|
+
|
|
1142
|
+
const StringView fileName = "<unknown?>";
|
|
1143
|
+
const StringView demangledName = "<unknown?>";
|
|
1144
|
+
|
|
1145
|
+
for (uint32_t ii = 0; ii < _num && _err->isOk(); ++ii)
|
|
1146
|
+
{
|
|
1147
|
+
total += write(_writer, _err
|
|
1148
|
+
, "\t%2d: %-*S % 5d %*p %S\n"
|
|
1149
|
+
, ii
|
|
1150
|
+
, kWidth
|
|
1151
|
+
, &fileName
|
|
1152
|
+
, -1
|
|
1153
|
+
, kWidthPc
|
|
1154
|
+
, _stack[ii]
|
|
1155
|
+
, &demangledName
|
|
1156
|
+
);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
return total;
|
|
395
1160
|
}
|
|
396
1161
|
|
|
397
1162
|
#endif // BX_CONFIG_CALLSTACK_*
|
|
398
1163
|
|
|
399
1164
|
void debugOutputCallstack(uint32_t _skip)
|
|
400
1165
|
{
|
|
1166
|
+
char temp[8192];
|
|
1167
|
+
StaticMemoryBlockWriter smb(temp, BX_COUNTOF(temp) );
|
|
1168
|
+
|
|
401
1169
|
uintptr_t stack[32];
|
|
402
|
-
const uint32_t
|
|
403
|
-
writeCallstack(
|
|
1170
|
+
const uint32_t num = getCallStackExact(_skip + 1 /* skip self */, BX_COUNTOF(stack), stack);
|
|
1171
|
+
const int32_t total = writeCallstack(&smb, stack, num, ErrorIgnore{});
|
|
1172
|
+
|
|
1173
|
+
write(getDebugOut(), temp, total, ErrorIgnore{});
|
|
404
1174
|
}
|
|
405
1175
|
|
|
406
1176
|
#if BX_CONFIG_EXCEPTION_HANDLING_USE_POSIX_SIGNALS
|
|
@@ -424,18 +1194,17 @@ namespace bx
|
|
|
424
1194
|
{
|
|
425
1195
|
BX_TRACE("ExceptionHandler - POSIX");
|
|
426
1196
|
|
|
427
|
-
stack_t stack;
|
|
1197
|
+
stack_t stack = {};
|
|
428
1198
|
stack.ss_sp = s_stack;
|
|
429
1199
|
stack.ss_size = sizeof(s_stack);
|
|
430
1200
|
stack.ss_flags = 0;
|
|
431
1201
|
sigaltstack(&stack, &m_oldStack);
|
|
432
1202
|
|
|
433
|
-
struct sigaction sa;
|
|
1203
|
+
struct sigaction sa = {};
|
|
434
1204
|
sa.sa_handler = NULL;
|
|
435
1205
|
sa.sa_sigaction = signalActionHandler;
|
|
436
1206
|
sa.sa_mask = { 0 };
|
|
437
1207
|
sa.sa_flags = SA_ONSTACK | SA_SIGINFO;
|
|
438
|
-
sa.sa_restorer = NULL;
|
|
439
1208
|
|
|
440
1209
|
for (uint32_t ii = 0; ii < BX_COUNTOF(s_signalInfo); ++ii)
|
|
441
1210
|
{
|
|
@@ -501,12 +1270,45 @@ namespace bx
|
|
|
501
1270
|
{ /* EXCEPTION_STACK_OVERFLOW */ 0xc00000fdu, "Stack overflow." },
|
|
502
1271
|
};
|
|
503
1272
|
|
|
1273
|
+
struct ExceptionRecord
|
|
1274
|
+
{
|
|
1275
|
+
uint32_t exceptionCode;
|
|
1276
|
+
uint32_t exceptionFlags;
|
|
1277
|
+
|
|
1278
|
+
ExceptionRecord* exceptionRecord;
|
|
1279
|
+
|
|
1280
|
+
uintptr_t exceptionAddress;
|
|
1281
|
+
uint32_t numberParameters;
|
|
1282
|
+
uintptr_t exceptionInformation[15];
|
|
1283
|
+
};
|
|
1284
|
+
|
|
1285
|
+
struct ExceptionPointers
|
|
1286
|
+
{
|
|
1287
|
+
ExceptionRecord* exceptionRecord;
|
|
1288
|
+
void* contextRecord;
|
|
1289
|
+
};
|
|
1290
|
+
|
|
1291
|
+
typedef uint32_t (__stdcall* TopLevelExceptionFilterFn)(ExceptionPointers* _exceptionInfo);
|
|
1292
|
+
typedef TopLevelExceptionFilterFn (__stdcall* SetUnhandledExceptionFilterFn)(TopLevelExceptionFilterFn _topLevelExceptionFilter);
|
|
1293
|
+
|
|
504
1294
|
struct ExceptionHandler
|
|
505
1295
|
{
|
|
506
1296
|
ExceptionHandler()
|
|
507
1297
|
{
|
|
508
|
-
|
|
509
|
-
|
|
1298
|
+
void* kernel32Dll = bx::dlopen("kernel32.dll");
|
|
1299
|
+
|
|
1300
|
+
if (NULL != kernel32Dll)
|
|
1301
|
+
{
|
|
1302
|
+
SetUnhandledExceptionFilterFn setUnhandledExceptionFilter = bx::dlsym<SetUnhandledExceptionFilterFn>(kernel32Dll, "SetUnhandledExceptionFilter");
|
|
1303
|
+
|
|
1304
|
+
if (NULL != setUnhandledExceptionFilter)
|
|
1305
|
+
{
|
|
1306
|
+
BX_TRACE("ExceptionHandler - Windows SEH");
|
|
1307
|
+
setUnhandledExceptionFilter(topLevelExceptionFilter);
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
bx::dlclose(kernel32Dll);
|
|
1311
|
+
}
|
|
510
1312
|
}
|
|
511
1313
|
|
|
512
1314
|
static uint32_t __stdcall topLevelExceptionFilter(ExceptionPointers* _info)
|
|
@@ -526,7 +1328,7 @@ namespace bx
|
|
|
526
1328
|
}
|
|
527
1329
|
}
|
|
528
1330
|
|
|
529
|
-
if (assertFunction(Location("Exception Handler", UINT32_MAX),
|
|
1331
|
+
if (assertFunction(Location("Exception Handler", UINT32_MAX), 7 /* topLevelExceptionFilter function + 6 deep stack of OS exception handler */
|
|
530
1332
|
, "%s Exception Code %x"
|
|
531
1333
|
, name
|
|
532
1334
|
, _info->exceptionRecord->exceptionCode
|