@babylonjs/react-native 2.0.0 → 2.0.1-preview
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 2011-
|
|
2
|
+
* Copyright 2011-2026 Branimir Karadzic. All rights reserved.
|
|
3
3
|
* License: https://github.com/bkaradzic/bgfx/blob/master/LICENSE
|
|
4
4
|
*/
|
|
5
5
|
|
|
@@ -240,6 +240,7 @@ namespace stl = std;
|
|
|
240
240
|
#define BGFX_RENDERER_METAL_NAME "Metal"
|
|
241
241
|
#define BGFX_RENDERER_NVN_NAME "NVN"
|
|
242
242
|
#define BGFX_RENDERER_VULKAN_NAME "Vulkan"
|
|
243
|
+
#define BGFX_RENDERER_WEBGPU_NAME "WebGPU"
|
|
243
244
|
|
|
244
245
|
#if BGFX_CONFIG_RENDERER_OPENGL
|
|
245
246
|
# if BGFX_CONFIG_RENDERER_OPENGL >= 31 && BGFX_CONFIG_RENDERER_OPENGL <= 33
|
|
@@ -285,7 +286,18 @@ namespace stl = std;
|
|
|
285
286
|
|
|
286
287
|
namespace bgfx
|
|
287
288
|
{
|
|
288
|
-
constexpr uint32_t kChunkMagicTex = BX_MAKEFOURCC('T', 'E', 'X', 0x0);
|
|
289
|
+
static constexpr uint32_t kChunkMagicTex = BX_MAKEFOURCC('T', 'E', 'X', 0x0);
|
|
290
|
+
|
|
291
|
+
// Palette:
|
|
292
|
+
// https://colorkit.co/color-palette-generator/a8e6cf-dcedc1-ffd3b6-76b4bd-bdeaee-8874a3-ff0000-ff8b94/
|
|
293
|
+
static constexpr uint32_t kColorFrame = 0xa8'e6'cf'ff;
|
|
294
|
+
static constexpr uint32_t kColorSubmit = 0xdc'ed'c1'ff;
|
|
295
|
+
static constexpr uint32_t kColorView = 0xff'd3'b6'ff;
|
|
296
|
+
static constexpr uint32_t kColorDraw = 0x76'b4'bd'ff;
|
|
297
|
+
static constexpr uint32_t kColorCompute = 0xbd'ea'ee'ff;
|
|
298
|
+
static constexpr uint32_t kColorResource = 0x88'74'a3'ff;
|
|
299
|
+
static constexpr uint32_t kColorMarker = 0xff'00'00'ff;
|
|
300
|
+
static constexpr uint32_t kColorWait = 0xff'8b'94'ff;
|
|
289
301
|
|
|
290
302
|
extern InternalData g_internalData;
|
|
291
303
|
extern PlatformData g_platformData;
|
|
@@ -430,7 +442,7 @@ namespace bgfx
|
|
|
430
442
|
void* findModule(const char* _name);
|
|
431
443
|
bool windowsVersionIs(Condition::Enum _op, uint32_t _version, uint32_t _build = UINT32_MAX);
|
|
432
444
|
|
|
433
|
-
constexpr bool isShaderType(uint32_t _magic, char _type)
|
|
445
|
+
static constexpr bool isShaderType(uint32_t _magic, char _type)
|
|
434
446
|
{
|
|
435
447
|
return uint32_t(_type) == (_magic & BX_MAKEFOURCC(0xff, 0, 0, 0) );
|
|
436
448
|
}
|
|
@@ -485,7 +497,7 @@ namespace bgfx
|
|
|
485
497
|
uint16_t m_flags;
|
|
486
498
|
};
|
|
487
499
|
|
|
488
|
-
struct Rect
|
|
500
|
+
BX_ALIGN_DECL(8, struct) Rect
|
|
489
501
|
{
|
|
490
502
|
Rect()
|
|
491
503
|
{
|
|
@@ -509,21 +521,34 @@ namespace bgfx
|
|
|
509
521
|
|
|
510
522
|
bool isZero() const
|
|
511
523
|
{
|
|
524
|
+
static_assert(8 == sizeof(Rect), "");
|
|
525
|
+
|
|
512
526
|
uint64_t ui64 = *( (uint64_t*)this);
|
|
513
527
|
return UINT64_C(0) == ui64;
|
|
514
528
|
}
|
|
515
529
|
|
|
516
530
|
bool isZeroArea() const
|
|
517
531
|
{
|
|
518
|
-
return
|
|
532
|
+
return false
|
|
533
|
+
|| 0 == m_width
|
|
519
534
|
|| 0 == m_height
|
|
520
535
|
;
|
|
521
536
|
}
|
|
522
537
|
|
|
538
|
+
bool isEqual(const Rect& _other) const
|
|
539
|
+
{
|
|
540
|
+
return true
|
|
541
|
+
&& m_x == _other.m_x
|
|
542
|
+
&& m_y == _other.m_y
|
|
543
|
+
&& m_width == _other.m_width
|
|
544
|
+
&& m_height == _other.m_height
|
|
545
|
+
;
|
|
546
|
+
}
|
|
547
|
+
|
|
523
548
|
void set(uint16_t _x, uint16_t _y, uint16_t _width, uint16_t _height)
|
|
524
549
|
{
|
|
525
|
-
m_x
|
|
526
|
-
m_y
|
|
550
|
+
m_x = _x;
|
|
551
|
+
m_y = _y;
|
|
527
552
|
m_width = _width;
|
|
528
553
|
m_height = _height;
|
|
529
554
|
}
|
|
@@ -534,8 +559,8 @@ namespace bgfx
|
|
|
534
559
|
const uint16_t sy = bx::max<uint16_t>(_a.m_y, _b.m_y);
|
|
535
560
|
const uint16_t ex = bx::min<uint16_t>(_a.m_x + _a.m_width, _b.m_x + _b.m_width );
|
|
536
561
|
const uint16_t ey = bx::min<uint16_t>(_a.m_y + _a.m_height, _b.m_y + _b.m_height);
|
|
537
|
-
m_x
|
|
538
|
-
m_y
|
|
562
|
+
m_x = sx;
|
|
563
|
+
m_y = sy;
|
|
539
564
|
m_width = (uint16_t)bx::uint32_satsub(ex, sx);
|
|
540
565
|
m_height = (uint16_t)bx::uint32_satsub(ey, sy);
|
|
541
566
|
}
|
|
@@ -593,6 +618,8 @@ namespace bgfx
|
|
|
593
618
|
const char* getName(ShaderHandle _handle);
|
|
594
619
|
const char* getName(Topology::Enum _topology);
|
|
595
620
|
|
|
621
|
+
const struct UniformRef& getUniformRef(UniformHandle _handle);
|
|
622
|
+
|
|
596
623
|
template<typename Ty>
|
|
597
624
|
inline void release(Ty)
|
|
598
625
|
{
|
|
@@ -604,17 +631,23 @@ namespace bgfx
|
|
|
604
631
|
release( (const Memory*)_mem);
|
|
605
632
|
}
|
|
606
633
|
|
|
607
|
-
inline uint64_t packStencil(uint32_t _fstencil, uint32_t _bstencil)
|
|
634
|
+
inline constexpr uint64_t packStencil(uint32_t _fstencil, uint32_t _bstencil)
|
|
608
635
|
{
|
|
609
636
|
return (uint64_t(_bstencil)<<32)|uint64_t(_fstencil);
|
|
610
637
|
}
|
|
611
638
|
|
|
612
|
-
inline uint32_t unpackStencil(uint8_t _0or1, uint64_t _stencil)
|
|
639
|
+
inline constexpr uint32_t unpackStencil(uint8_t _0or1, uint64_t _stencil)
|
|
613
640
|
{
|
|
614
641
|
return uint32_t( (_stencil >> (32*_0or1) ) );
|
|
615
642
|
}
|
|
616
643
|
|
|
617
|
-
|
|
644
|
+
static constexpr uint64_t kStencilNoRefMask = packStencil(~BGFX_STENCIL_FUNC_REF_MASK, ~BGFX_STENCIL_FUNC_REF_MASK);
|
|
645
|
+
static constexpr uint64_t kStencilDisabled = packStencil(
|
|
646
|
+
BGFX_STENCIL_TEST_ALWAYS | BGFX_STENCIL_OP_FAIL_S_KEEP | BGFX_STENCIL_OP_FAIL_Z_KEEP | BGFX_STENCIL_OP_PASS_Z_KEEP
|
|
647
|
+
, BGFX_STENCIL_TEST_ALWAYS | BGFX_STENCIL_OP_FAIL_S_KEEP | BGFX_STENCIL_OP_FAIL_Z_KEEP | BGFX_STENCIL_OP_PASS_Z_KEEP
|
|
648
|
+
);
|
|
649
|
+
|
|
650
|
+
inline constexpr bool needBorderColor(uint64_t _flags)
|
|
618
651
|
{
|
|
619
652
|
return BGFX_SAMPLER_U_BORDER == (_flags & BGFX_SAMPLER_U_BORDER)
|
|
620
653
|
|| BGFX_SAMPLER_V_BORDER == (_flags & BGFX_SAMPLER_V_BORDER)
|
|
@@ -622,7 +655,7 @@ namespace bgfx
|
|
|
622
655
|
;
|
|
623
656
|
}
|
|
624
657
|
|
|
625
|
-
inline uint8_t calcNumMips(bool _hasMips, uint16_t _width, uint16_t _height, uint16_t _depth = 1)
|
|
658
|
+
inline constexpr uint8_t calcNumMips(bool _hasMips, uint16_t _width, uint16_t _height, uint16_t _depth = 1)
|
|
626
659
|
{
|
|
627
660
|
if (_hasMips)
|
|
628
661
|
{
|
|
@@ -752,19 +785,21 @@ namespace bgfx
|
|
|
752
785
|
|
|
753
786
|
TextureHandle m_texture;
|
|
754
787
|
TransientVertexBuffer* m_vb;
|
|
755
|
-
TransientIndexBuffer*
|
|
756
|
-
VertexLayout
|
|
788
|
+
TransientIndexBuffer* m_ib;
|
|
789
|
+
VertexLayout m_layout;
|
|
757
790
|
ProgramHandle m_program;
|
|
758
791
|
uint8_t m_scale;
|
|
792
|
+
|
|
793
|
+
uintptr_t m_usedData;
|
|
759
794
|
};
|
|
760
795
|
|
|
761
796
|
struct RendererContextI;
|
|
762
797
|
|
|
763
|
-
extern void
|
|
798
|
+
extern void dbgTextSubmit(RendererContextI* _renderCtx, TextVideoMemBlitter& _blitter, const TextVideoMem& _mem);
|
|
764
799
|
|
|
765
|
-
inline void
|
|
800
|
+
inline void dbgTextSubmit(RendererContextI* _renderCtx, TextVideoMemBlitter& _blitter, const TextVideoMem* _mem)
|
|
766
801
|
{
|
|
767
|
-
|
|
802
|
+
dbgTextSubmit(_renderCtx, _blitter, *_mem);
|
|
768
803
|
}
|
|
769
804
|
|
|
770
805
|
template <uint32_t maxKeys>
|
|
@@ -777,8 +812,8 @@ namespace bgfx
|
|
|
777
812
|
|
|
778
813
|
void add(uint32_t _key, uint32_t _value)
|
|
779
814
|
{
|
|
780
|
-
uint32_t num = m_num++;
|
|
781
|
-
m_keys[num] = _key;
|
|
815
|
+
const uint32_t num = m_num++;
|
|
816
|
+
m_keys [num] = _key;
|
|
782
817
|
m_values[num] = _value;
|
|
783
818
|
}
|
|
784
819
|
|
|
@@ -786,7 +821,7 @@ namespace bgfx
|
|
|
786
821
|
{
|
|
787
822
|
if (0 < m_num)
|
|
788
823
|
{
|
|
789
|
-
uint32_t* tempKeys
|
|
824
|
+
uint32_t* tempKeys = (uint32_t*)BX_STACK_ALLOC(sizeof(m_keys) );
|
|
790
825
|
uint32_t* tempValues = (uint32_t*)BX_STACK_ALLOC(sizeof(m_values) );
|
|
791
826
|
bx::radixSort(m_keys, tempKeys, m_values, tempValues, m_num);
|
|
792
827
|
return true;
|
|
@@ -810,6 +845,33 @@ namespace bgfx
|
|
|
810
845
|
uint32_t m_values[maxKeys];
|
|
811
846
|
};
|
|
812
847
|
|
|
848
|
+
template<typename MaskT>
|
|
849
|
+
struct BitMaskToIndexIteratorT
|
|
850
|
+
{
|
|
851
|
+
BitMaskToIndexIteratorT(MaskT _mask)
|
|
852
|
+
{
|
|
853
|
+
const uint8_t ntz = bx::countTrailingZeros(_mask);
|
|
854
|
+
mask = _mask >> ntz;
|
|
855
|
+
idx = ntz;
|
|
856
|
+
}
|
|
857
|
+
|
|
858
|
+
void next()
|
|
859
|
+
{
|
|
860
|
+
// operator>> promotes to int, so we need to cast back:
|
|
861
|
+
const uint8_t ntzPlus1 = bx::countTrailingZeros<MaskT>(mask>>1) + 1;
|
|
862
|
+
mask >>= ntzPlus1;
|
|
863
|
+
idx += ntzPlus1;
|
|
864
|
+
}
|
|
865
|
+
|
|
866
|
+
bool isDone() const
|
|
867
|
+
{
|
|
868
|
+
return 0 == mask;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
MaskT mask;
|
|
872
|
+
uint8_t idx;
|
|
873
|
+
};
|
|
874
|
+
|
|
813
875
|
struct ClearQuad
|
|
814
876
|
{
|
|
815
877
|
ClearQuad()
|
|
@@ -824,7 +886,7 @@ namespace bgfx
|
|
|
824
886
|
void shutdown();
|
|
825
887
|
|
|
826
888
|
VertexBufferHandle m_vb;
|
|
827
|
-
|
|
889
|
+
VertexLayoutHandle m_layout;
|
|
828
890
|
ProgramHandle m_program[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
|
|
829
891
|
};
|
|
830
892
|
|
|
@@ -1034,60 +1096,71 @@ namespace bgfx
|
|
|
1034
1096
|
};
|
|
1035
1097
|
|
|
1036
1098
|
//
|
|
1037
|
-
constexpr uint8_t kSortKeyViewNumBits = uint8_t(31 - bx::uint32_cntlz(BGFX_CONFIG_MAX_VIEWS) );
|
|
1038
|
-
constexpr uint8_t kSortKeyViewBitShift = 64-kSortKeyViewNumBits;
|
|
1039
|
-
constexpr uint64_t kSortKeyViewMask = uint64_t(BGFX_CONFIG_MAX_VIEWS-1)<<kSortKeyViewBitShift;
|
|
1099
|
+
static constexpr uint8_t kSortKeyViewNumBits = uint8_t(31 - bx::uint32_cntlz(BGFX_CONFIG_MAX_VIEWS) );
|
|
1100
|
+
static constexpr uint8_t kSortKeyViewBitShift = 64-kSortKeyViewNumBits;
|
|
1101
|
+
static constexpr uint64_t kSortKeyViewMask = uint64_t(BGFX_CONFIG_MAX_VIEWS-1)<<kSortKeyViewBitShift;
|
|
1040
1102
|
|
|
1041
|
-
constexpr uint8_t kSortKeyDrawBitShift = kSortKeyViewBitShift - 1;
|
|
1042
|
-
constexpr uint64_t kSortKeyDrawBit = uint64_t(1)<<kSortKeyDrawBitShift;
|
|
1103
|
+
static constexpr uint8_t kSortKeyDrawBitShift = kSortKeyViewBitShift - 1;
|
|
1104
|
+
static constexpr uint64_t kSortKeyDrawBit = uint64_t(1)<<kSortKeyDrawBitShift;
|
|
1043
1105
|
|
|
1044
1106
|
//
|
|
1045
|
-
constexpr uint8_t kSortKeyDrawTypeNumBits = 2;
|
|
1046
|
-
constexpr uint8_t kSortKeyDrawTypeBitShift = kSortKeyDrawBitShift - kSortKeyDrawTypeNumBits;
|
|
1047
|
-
constexpr uint64_t kSortKeyDrawTypeMask = uint64_t(3)<<kSortKeyDrawTypeBitShift;
|
|
1107
|
+
static constexpr uint8_t kSortKeyDrawTypeNumBits = 2;
|
|
1108
|
+
static constexpr uint8_t kSortKeyDrawTypeBitShift = kSortKeyDrawBitShift - kSortKeyDrawTypeNumBits;
|
|
1109
|
+
static constexpr uint64_t kSortKeyDrawTypeMask = uint64_t(3)<<kSortKeyDrawTypeBitShift;
|
|
1048
1110
|
|
|
1049
|
-
constexpr uint64_t kSortKeyDrawTypeProgram = uint64_t(0)<<kSortKeyDrawTypeBitShift;
|
|
1050
|
-
constexpr uint64_t kSortKeyDrawTypeDepth = uint64_t(1)<<kSortKeyDrawTypeBitShift;
|
|
1051
|
-
constexpr uint64_t kSortKeyDrawTypeSequence = uint64_t(2)<<kSortKeyDrawTypeBitShift;
|
|
1111
|
+
static constexpr uint64_t kSortKeyDrawTypeProgram = uint64_t(0)<<kSortKeyDrawTypeBitShift;
|
|
1112
|
+
static constexpr uint64_t kSortKeyDrawTypeDepth = uint64_t(1)<<kSortKeyDrawTypeBitShift;
|
|
1113
|
+
static constexpr uint64_t kSortKeyDrawTypeSequence = uint64_t(2)<<kSortKeyDrawTypeBitShift;
|
|
1052
1114
|
|
|
1053
1115
|
//
|
|
1054
|
-
constexpr uint8_t kSortKeyTransNumBits = 2;
|
|
1116
|
+
static constexpr uint8_t kSortKeyTransNumBits = 2;
|
|
1117
|
+
|
|
1118
|
+
static constexpr uint8_t kSortKeyDraw0BlendShift = kSortKeyDrawTypeBitShift - kSortKeyTransNumBits;
|
|
1119
|
+
static constexpr uint64_t kSortKeyDraw0BlendMask = uint64_t(0x3)<<kSortKeyDraw0BlendShift;
|
|
1120
|
+
|
|
1121
|
+
static constexpr uint8_t kSortKeyAlphaRefNumBits = 1;
|
|
1055
1122
|
|
|
1056
|
-
constexpr uint8_t
|
|
1057
|
-
constexpr uint64_t
|
|
1123
|
+
static constexpr uint8_t kSortKeyDraw0AlphaRefShift = kSortKeyDraw0BlendShift - kSortKeyAlphaRefNumBits;
|
|
1124
|
+
static constexpr uint64_t kSortKeyDraw0AlphaRefMask = uint64_t(1)<<kSortKeyDraw0AlphaRefShift;
|
|
1058
1125
|
|
|
1059
|
-
constexpr uint8_t kSortKeyDraw0ProgramShift =
|
|
1060
|
-
constexpr uint64_t kSortKeyDraw0ProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyDraw0ProgramShift;
|
|
1126
|
+
static constexpr uint8_t kSortKeyDraw0ProgramShift = kSortKeyDraw0AlphaRefShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM;
|
|
1127
|
+
static constexpr uint64_t kSortKeyDraw0ProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyDraw0ProgramShift;
|
|
1061
1128
|
|
|
1062
|
-
constexpr uint8_t kSortKeyDraw0DepthShift = kSortKeyDraw0ProgramShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH;
|
|
1063
|
-
constexpr uint64_t kSortKeyDraw0DepthMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH)-1)<<kSortKeyDraw0DepthShift;
|
|
1129
|
+
static constexpr uint8_t kSortKeyDraw0DepthShift = kSortKeyDraw0ProgramShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH;
|
|
1130
|
+
static constexpr uint64_t kSortKeyDraw0DepthMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH)-1)<<kSortKeyDraw0DepthShift;
|
|
1064
1131
|
|
|
1065
1132
|
//
|
|
1066
|
-
constexpr uint8_t kSortKeyDraw1DepthShift = kSortKeyDrawTypeBitShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH;
|
|
1067
|
-
constexpr uint64_t kSortKeyDraw1DepthMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH)-1)<<kSortKeyDraw1DepthShift;
|
|
1133
|
+
static constexpr uint8_t kSortKeyDraw1DepthShift = kSortKeyDrawTypeBitShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH;
|
|
1134
|
+
static constexpr uint64_t kSortKeyDraw1DepthMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_DEPTH)-1)<<kSortKeyDraw1DepthShift;
|
|
1068
1135
|
|
|
1069
|
-
constexpr uint8_t kSortKeyDraw1BlendShift = kSortKeyDraw1DepthShift - kSortKeyTransNumBits;
|
|
1070
|
-
constexpr uint64_t kSortKeyDraw1BlendMask = uint64_t(0x3)<<kSortKeyDraw1BlendShift;
|
|
1136
|
+
static constexpr uint8_t kSortKeyDraw1BlendShift = kSortKeyDraw1DepthShift - kSortKeyTransNumBits;
|
|
1137
|
+
static constexpr uint64_t kSortKeyDraw1BlendMask = uint64_t(0x3)<<kSortKeyDraw1BlendShift;
|
|
1071
1138
|
|
|
1072
|
-
constexpr uint8_t
|
|
1073
|
-
constexpr uint64_t
|
|
1139
|
+
static constexpr uint8_t kSortKeyDraw1AlphaRefShift = kSortKeyDraw1BlendShift - kSortKeyAlphaRefNumBits;
|
|
1140
|
+
static constexpr uint64_t kSortKeyDraw1AlphaRefMask = uint64_t(1)<<kSortKeyDraw1AlphaRefShift;
|
|
1141
|
+
|
|
1142
|
+
static constexpr uint8_t kSortKeyDraw1ProgramShift = kSortKeyDraw1AlphaRefShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM;
|
|
1143
|
+
static constexpr uint64_t kSortKeyDraw1ProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyDraw1ProgramShift;
|
|
1074
1144
|
|
|
1075
1145
|
//
|
|
1076
|
-
constexpr uint8_t kSortKeyDraw2SeqShift = kSortKeyDrawTypeBitShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ;
|
|
1077
|
-
constexpr uint64_t kSortKeyDraw2SeqMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ)-1)<<kSortKeyDraw2SeqShift;
|
|
1146
|
+
static constexpr uint8_t kSortKeyDraw2SeqShift = kSortKeyDrawTypeBitShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ;
|
|
1147
|
+
static constexpr uint64_t kSortKeyDraw2SeqMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ)-1)<<kSortKeyDraw2SeqShift;
|
|
1148
|
+
|
|
1149
|
+
static constexpr uint8_t kSortKeyDraw2BlendShift = kSortKeyDraw2SeqShift - kSortKeyTransNumBits;
|
|
1150
|
+
static constexpr uint64_t kSortKeyDraw2BlendMask = uint64_t(0x3)<<kSortKeyDraw2BlendShift;
|
|
1078
1151
|
|
|
1079
|
-
constexpr uint8_t
|
|
1080
|
-
constexpr uint64_t
|
|
1152
|
+
static constexpr uint8_t kSortKeyDraw2AlphaRefShift = kSortKeyDraw2BlendShift - kSortKeyAlphaRefNumBits;
|
|
1153
|
+
static constexpr uint64_t kSortKeyDraw2AlphaRefMask = uint64_t(1)<<kSortKeyDraw2AlphaRefShift;
|
|
1081
1154
|
|
|
1082
|
-
constexpr uint8_t kSortKeyDraw2ProgramShift =
|
|
1083
|
-
constexpr uint64_t kSortKeyDraw2ProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyDraw2ProgramShift;
|
|
1155
|
+
static constexpr uint8_t kSortKeyDraw2ProgramShift = kSortKeyDraw2AlphaRefShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM;
|
|
1156
|
+
static constexpr uint64_t kSortKeyDraw2ProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyDraw2ProgramShift;
|
|
1084
1157
|
|
|
1085
1158
|
//
|
|
1086
|
-
constexpr uint8_t kSortKeyComputeSeqShift = kSortKeyDrawBitShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ;
|
|
1087
|
-
constexpr uint64_t kSortKeyComputeSeqMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ)-1)<<kSortKeyComputeSeqShift;
|
|
1159
|
+
static constexpr uint8_t kSortKeyComputeSeqShift = kSortKeyDrawBitShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ;
|
|
1160
|
+
static constexpr uint64_t kSortKeyComputeSeqMask = ( (uint64_t(1)<<BGFX_CONFIG_SORT_KEY_NUM_BITS_SEQ)-1)<<kSortKeyComputeSeqShift;
|
|
1088
1161
|
|
|
1089
|
-
constexpr uint8_t kSortKeyComputeProgramShift = kSortKeyComputeSeqShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM;
|
|
1090
|
-
constexpr uint64_t kSortKeyComputeProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyComputeProgramShift;
|
|
1162
|
+
static constexpr uint8_t kSortKeyComputeProgramShift = kSortKeyComputeSeqShift - BGFX_CONFIG_SORT_KEY_NUM_BITS_PROGRAM;
|
|
1163
|
+
static constexpr uint64_t kSortKeyComputeProgramMask = uint64_t(BGFX_CONFIG_MAX_PROGRAMS-1)<<kSortKeyComputeProgramShift;
|
|
1091
1164
|
|
|
1092
1165
|
static_assert(BGFX_CONFIG_MAX_VIEWS <= (1<<kSortKeyViewNumBits) );
|
|
1093
1166
|
static_assert( (BGFX_CONFIG_MAX_PROGRAMS & (BGFX_CONFIG_MAX_PROGRAMS-1) ) == 0); // Must be power of 2.
|
|
@@ -1096,6 +1169,7 @@ namespace bgfx
|
|
|
1096
1169
|
| kSortKeyDrawBit
|
|
1097
1170
|
| kSortKeyDrawTypeMask
|
|
1098
1171
|
| kSortKeyDraw0BlendMask
|
|
1172
|
+
| kSortKeyDraw0AlphaRefMask
|
|
1099
1173
|
| kSortKeyDraw0ProgramMask
|
|
1100
1174
|
| kSortKeyDraw0DepthMask
|
|
1101
1175
|
) == (0
|
|
@@ -1103,6 +1177,7 @@ namespace bgfx
|
|
|
1103
1177
|
^ kSortKeyDrawBit
|
|
1104
1178
|
^ kSortKeyDrawTypeMask
|
|
1105
1179
|
^ kSortKeyDraw0BlendMask
|
|
1180
|
+
^ kSortKeyDraw0AlphaRefMask
|
|
1106
1181
|
^ kSortKeyDraw0ProgramMask
|
|
1107
1182
|
^ kSortKeyDraw0DepthMask
|
|
1108
1183
|
) );
|
|
@@ -1112,6 +1187,7 @@ namespace bgfx
|
|
|
1112
1187
|
| kSortKeyDrawTypeMask
|
|
1113
1188
|
| kSortKeyDraw1DepthMask
|
|
1114
1189
|
| kSortKeyDraw1BlendMask
|
|
1190
|
+
| kSortKeyDraw1AlphaRefMask
|
|
1115
1191
|
| kSortKeyDraw1ProgramMask
|
|
1116
1192
|
) == (0
|
|
1117
1193
|
^ kSortKeyViewMask
|
|
@@ -1119,6 +1195,7 @@ namespace bgfx
|
|
|
1119
1195
|
^ kSortKeyDrawTypeMask
|
|
1120
1196
|
^ kSortKeyDraw1DepthMask
|
|
1121
1197
|
^ kSortKeyDraw1BlendMask
|
|
1198
|
+
^ kSortKeyDraw1AlphaRefMask
|
|
1122
1199
|
^ kSortKeyDraw1ProgramMask
|
|
1123
1200
|
) );
|
|
1124
1201
|
static_assert( (0 // Render key mask shouldn't overlap.
|
|
@@ -1127,6 +1204,7 @@ namespace bgfx
|
|
|
1127
1204
|
| kSortKeyDrawTypeMask
|
|
1128
1205
|
| kSortKeyDraw2SeqMask
|
|
1129
1206
|
| kSortKeyDraw2BlendMask
|
|
1207
|
+
| kSortKeyDraw2AlphaRefMask
|
|
1130
1208
|
| kSortKeyDraw2ProgramMask
|
|
1131
1209
|
) == (0
|
|
1132
1210
|
^ kSortKeyViewMask
|
|
@@ -1134,6 +1212,7 @@ namespace bgfx
|
|
|
1134
1212
|
^ kSortKeyDrawTypeMask
|
|
1135
1213
|
^ kSortKeyDraw2SeqMask
|
|
1136
1214
|
^ kSortKeyDraw2BlendMask
|
|
1215
|
+
^ kSortKeyDraw2AlphaRefMask
|
|
1137
1216
|
^ kSortKeyDraw2ProgramMask
|
|
1138
1217
|
) );
|
|
1139
1218
|
static_assert( (0 // Compute key mask shouldn't overlap.
|
|
@@ -1156,22 +1235,22 @@ namespace bgfx
|
|
|
1156
1235
|
// | view-+| |
|
|
1157
1236
|
// | +-draw |
|
|
1158
1237
|
// |----------------------------------------------------------------| Draw Key 0 - Sort by program
|
|
1159
|
-
// | |
|
|
1160
|
-
// | | ^
|
|
1161
|
-
// | | | |
|
|
1238
|
+
// | |kkttrpppppppppdddddddddddddddddddddddddddddddd |
|
|
1239
|
+
// | | ^ ^^ ^ ^ |
|
|
1240
|
+
// | | | |+ref | | |
|
|
1162
1241
|
// | | | +-blend +-program depth-+ |
|
|
1163
1242
|
// | | +-key type |
|
|
1164
1243
|
// |----------------------------------------------------------------| Draw Key 1 - Sort by depth
|
|
1165
|
-
// | |
|
|
1166
|
-
// | | ^ ^ ^
|
|
1167
|
-
// | | | | +-blend
|
|
1168
|
-
// | | +-key type depth-+
|
|
1244
|
+
// | |kkddddddddddddddddddddddddddddddddttrppppppppp |
|
|
1245
|
+
// | | ^ ^ ^+-ref ^ |
|
|
1246
|
+
// | | | | +-blend | |
|
|
1247
|
+
// | | +-key type depth-+ program-+ |
|
|
1169
1248
|
// | | |
|
|
1170
1249
|
// |----------------------------------------------------------------| Draw Key 2 - Sequential
|
|
1171
|
-
// | |
|
|
1172
|
-
// | | ^ ^
|
|
1173
|
-
// | | | | |
|
|
1174
|
-
// | | +-key type seq-+ +-blend
|
|
1250
|
+
// | |kkssssssssssssssssssssttrppppppppp |
|
|
1251
|
+
// | | ^ ^ ^^ ^ |
|
|
1252
|
+
// | | | | |+-ref | |
|
|
1253
|
+
// | | +-key type seq-+ +-blend +-program |
|
|
1175
1254
|
// | | |
|
|
1176
1255
|
// |----------------------------------------------------------------| Compute Key
|
|
1177
1256
|
// | |ssssssssssssssssssssppppppppp |
|
|
@@ -1196,11 +1275,12 @@ namespace bgfx
|
|
|
1196
1275
|
{
|
|
1197
1276
|
case SortProgram:
|
|
1198
1277
|
{
|
|
1199
|
-
const uint64_t depth
|
|
1200
|
-
const uint64_t program
|
|
1201
|
-
const uint64_t blend
|
|
1202
|
-
const uint64_t
|
|
1203
|
-
const uint64_t
|
|
1278
|
+
const uint64_t depth = (uint64_t(m_depth ) << kSortKeyDraw0DepthShift ) & kSortKeyDraw0DepthMask;
|
|
1279
|
+
const uint64_t program = (uint64_t(m_program.idx) << kSortKeyDraw0ProgramShift ) & kSortKeyDraw0ProgramMask;
|
|
1280
|
+
const uint64_t blend = (uint64_t(m_blend ) << kSortKeyDraw0BlendShift ) & kSortKeyDraw0BlendMask;
|
|
1281
|
+
const uint64_t alphaRef = (uint64_t(m_hasAlphaRef) << kSortKeyDraw0AlphaRefShift) & kSortKeyDraw0AlphaRefMask;
|
|
1282
|
+
const uint64_t view = (uint64_t(m_view ) << kSortKeyViewBitShift ) & kSortKeyViewMask;
|
|
1283
|
+
const uint64_t key = view|kSortKeyDrawBit|kSortKeyDrawTypeProgram|blend|alphaRef|program|depth;
|
|
1204
1284
|
|
|
1205
1285
|
return key;
|
|
1206
1286
|
}
|
|
@@ -1208,22 +1288,24 @@ namespace bgfx
|
|
|
1208
1288
|
|
|
1209
1289
|
case SortDepth:
|
|
1210
1290
|
{
|
|
1211
|
-
const uint64_t depth
|
|
1212
|
-
const uint64_t program
|
|
1213
|
-
const uint64_t blend
|
|
1214
|
-
const uint64_t
|
|
1215
|
-
const uint64_t
|
|
1291
|
+
const uint64_t depth = (uint64_t(m_depth ) << kSortKeyDraw1DepthShift ) & kSortKeyDraw1DepthMask;
|
|
1292
|
+
const uint64_t program = (uint64_t(m_program.idx) << kSortKeyDraw1ProgramShift) & kSortKeyDraw1ProgramMask;
|
|
1293
|
+
const uint64_t blend = (uint64_t(m_blend ) << kSortKeyDraw1BlendShift) & kSortKeyDraw1BlendMask;
|
|
1294
|
+
const uint64_t alphaRef = (uint64_t(m_hasAlphaRef) << kSortKeyDraw1AlphaRefShift) & kSortKeyDraw1AlphaRefMask;
|
|
1295
|
+
const uint64_t view = (uint64_t(m_view ) << kSortKeyViewBitShift ) & kSortKeyViewMask;
|
|
1296
|
+
const uint64_t key = view|kSortKeyDrawBit|kSortKeyDrawTypeDepth|depth|blend|alphaRef|program;
|
|
1216
1297
|
return key;
|
|
1217
1298
|
}
|
|
1218
1299
|
break;
|
|
1219
1300
|
|
|
1220
1301
|
case SortSequence:
|
|
1221
1302
|
{
|
|
1222
|
-
const uint64_t seq
|
|
1223
|
-
const uint64_t program
|
|
1224
|
-
const uint64_t blend
|
|
1225
|
-
const uint64_t
|
|
1226
|
-
const uint64_t
|
|
1303
|
+
const uint64_t seq = (uint64_t(m_seq ) << kSortKeyDraw2SeqShift ) & kSortKeyDraw2SeqMask;
|
|
1304
|
+
const uint64_t program = (uint64_t(m_program.idx) << kSortKeyDraw2ProgramShift ) & kSortKeyDraw2ProgramMask;
|
|
1305
|
+
const uint64_t blend = (uint64_t(m_blend ) << kSortKeyDraw2BlendShift ) & kSortKeyDraw2BlendMask;
|
|
1306
|
+
const uint64_t alphaRef = (uint64_t(m_hasAlphaRef) << kSortKeyDraw2AlphaRefShift) & kSortKeyDraw2AlphaRefMask;
|
|
1307
|
+
const uint64_t view = (uint64_t(m_view ) << kSortKeyViewBitShift ) & kSortKeyViewMask;
|
|
1308
|
+
const uint64_t key = view|kSortKeyDrawBit|kSortKeyDrawTypeSequence|seq|blend|alphaRef|program;
|
|
1227
1309
|
|
|
1228
1310
|
BX_ASSERT(seq == (uint64_t(m_seq) << kSortKeyDraw2SeqShift)
|
|
1229
1311
|
, "SortKey error, sequence is truncated (m_seq: %d)."
|
|
@@ -1298,11 +1380,12 @@ namespace bgfx
|
|
|
1298
1380
|
|
|
1299
1381
|
void reset()
|
|
1300
1382
|
{
|
|
1301
|
-
m_depth
|
|
1302
|
-
m_seq
|
|
1303
|
-
m_program
|
|
1304
|
-
m_view
|
|
1305
|
-
m_blend
|
|
1383
|
+
m_depth = 0;
|
|
1384
|
+
m_seq = 0;
|
|
1385
|
+
m_program = {0};
|
|
1386
|
+
m_view = 0;
|
|
1387
|
+
m_blend = 0;
|
|
1388
|
+
m_hasAlphaRef = false;
|
|
1306
1389
|
}
|
|
1307
1390
|
|
|
1308
1391
|
uint32_t m_depth;
|
|
@@ -1310,36 +1393,47 @@ namespace bgfx
|
|
|
1310
1393
|
ProgramHandle m_program;
|
|
1311
1394
|
ViewId m_view;
|
|
1312
1395
|
uint8_t m_blend;
|
|
1396
|
+
bool m_hasAlphaRef;
|
|
1313
1397
|
};
|
|
1314
1398
|
#undef SORT_KEY_RENDER_DRAW
|
|
1315
1399
|
|
|
1316
|
-
constexpr uint8_t kBlitKeyViewShift = 32-kSortKeyViewNumBits;
|
|
1317
|
-
constexpr uint32_t kBlitKeyViewMask = uint32_t(BGFX_CONFIG_MAX_VIEWS-1)<<kBlitKeyViewShift;
|
|
1318
|
-
constexpr uint8_t kBlitKeyItemShift = 0;
|
|
1319
|
-
constexpr uint32_t kBlitKeyItemMask = UINT16_MAX;
|
|
1320
|
-
|
|
1321
1400
|
struct BlitKey
|
|
1322
1401
|
{
|
|
1323
|
-
uint32_t
|
|
1402
|
+
using KeyT = uint32_t;
|
|
1403
|
+
|
|
1404
|
+
static constexpr uint8_t kViewShift = 32-kSortKeyViewNumBits;
|
|
1405
|
+
static constexpr uint32_t kViewMask = uint32_t(BGFX_CONFIG_MAX_VIEWS-1)<<kViewShift;
|
|
1406
|
+
static constexpr uint8_t kItemShift = 0;
|
|
1407
|
+
static constexpr uint32_t kItemMask = UINT16_MAX;
|
|
1408
|
+
|
|
1409
|
+
static_assert( (0
|
|
1410
|
+
| kViewMask
|
|
1411
|
+
| kItemMask
|
|
1412
|
+
) == (0
|
|
1413
|
+
^ kViewMask
|
|
1414
|
+
^ kItemMask
|
|
1415
|
+
), "BlitKey: Key mask shouldn't overlap!");
|
|
1416
|
+
|
|
1417
|
+
KeyT encode()
|
|
1324
1418
|
{
|
|
1325
|
-
const
|
|
1326
|
-
const
|
|
1327
|
-
const
|
|
1419
|
+
const KeyT view = (KeyT(m_view) << kViewShift) & kViewMask;
|
|
1420
|
+
const KeyT item = (KeyT(m_item) << kItemShift) & kItemMask;
|
|
1421
|
+
const KeyT key = view|item;
|
|
1328
1422
|
|
|
1329
1423
|
return key;
|
|
1330
1424
|
}
|
|
1331
1425
|
|
|
1332
|
-
void decode(
|
|
1426
|
+
void decode(KeyT _key)
|
|
1333
1427
|
{
|
|
1334
|
-
m_item = uint16_t( (_key &
|
|
1335
|
-
m_view = ViewId( (_key &
|
|
1428
|
+
m_item = uint16_t( (_key & kItemMask) >> kItemShift);
|
|
1429
|
+
m_view = ViewId( (_key & kViewMask) >> kViewShift);
|
|
1336
1430
|
}
|
|
1337
1431
|
|
|
1338
|
-
static
|
|
1432
|
+
static KeyT remapView(KeyT _key, ViewId _viewRemap[BGFX_CONFIG_MAX_VIEWS])
|
|
1339
1433
|
{
|
|
1340
|
-
const ViewId
|
|
1341
|
-
const
|
|
1342
|
-
const
|
|
1434
|
+
const ViewId oldView = ViewId( (_key & kViewMask) >> kViewShift);
|
|
1435
|
+
const KeyT view = uint32_t( (_viewRemap[oldView] << kViewShift) & kViewMask);
|
|
1436
|
+
const KeyT key = (_key & ~kViewMask) | view;
|
|
1343
1437
|
return key;
|
|
1344
1438
|
}
|
|
1345
1439
|
|
|
@@ -1455,20 +1549,20 @@ namespace bgfx
|
|
|
1455
1549
|
uint32_t m_num;
|
|
1456
1550
|
};
|
|
1457
1551
|
|
|
1458
|
-
constexpr uint8_t kConstantOpcodeTypeShift = 27;
|
|
1459
|
-
constexpr uint32_t kConstantOpcodeTypeMask = UINT32_C(0xf8000000);
|
|
1460
|
-
constexpr uint8_t kConstantOpcodeLocShift = 11;
|
|
1461
|
-
constexpr uint32_t kConstantOpcodeLocMask = UINT32_C(0x07fff800);
|
|
1462
|
-
constexpr uint8_t kConstantOpcodeNumShift = 1;
|
|
1463
|
-
constexpr uint32_t kConstantOpcodeNumMask = UINT32_C(0x000007fe);
|
|
1464
|
-
constexpr uint8_t kConstantOpcodeCopyShift = 0;
|
|
1465
|
-
constexpr uint32_t kConstantOpcodeCopyMask = UINT32_C(0x00000001);
|
|
1466
|
-
|
|
1467
|
-
constexpr uint8_t kUniformFragmentBit = 0x10;
|
|
1468
|
-
constexpr uint8_t kUniformSamplerBit = 0x20;
|
|
1469
|
-
constexpr uint8_t kUniformReadOnlyBit = 0x40;
|
|
1470
|
-
constexpr uint8_t kUniformCompareBit = 0x80;
|
|
1471
|
-
constexpr uint8_t kUniformMask = 0
|
|
1552
|
+
static constexpr uint8_t kConstantOpcodeTypeShift = 27;
|
|
1553
|
+
static constexpr uint32_t kConstantOpcodeTypeMask = UINT32_C(0xf8000000);
|
|
1554
|
+
static constexpr uint8_t kConstantOpcodeLocShift = 11;
|
|
1555
|
+
static constexpr uint32_t kConstantOpcodeLocMask = UINT32_C(0x07fff800);
|
|
1556
|
+
static constexpr uint8_t kConstantOpcodeNumShift = 1;
|
|
1557
|
+
static constexpr uint32_t kConstantOpcodeNumMask = UINT32_C(0x000007fe);
|
|
1558
|
+
static constexpr uint8_t kConstantOpcodeCopyShift = 0;
|
|
1559
|
+
static constexpr uint32_t kConstantOpcodeCopyMask = UINT32_C(0x00000001);
|
|
1560
|
+
|
|
1561
|
+
static constexpr uint8_t kUniformFragmentBit = 0x10;
|
|
1562
|
+
static constexpr uint8_t kUniformSamplerBit = 0x20;
|
|
1563
|
+
static constexpr uint8_t kUniformReadOnlyBit = 0x40;
|
|
1564
|
+
static constexpr uint8_t kUniformCompareBit = 0x80;
|
|
1565
|
+
static constexpr uint8_t kUniformMask = 0
|
|
1472
1566
|
| kUniformFragmentBit
|
|
1473
1567
|
| kUniformSamplerBit
|
|
1474
1568
|
| kUniformReadOnlyBit
|
|
@@ -1495,8 +1589,8 @@ namespace bgfx
|
|
|
1495
1589
|
|
|
1496
1590
|
static void update(UniformBuffer** _uniformBuffer)
|
|
1497
1591
|
{
|
|
1498
|
-
constexpr uint32_t kThreshold = BGFX_CONFIG_UNIFORM_BUFFER_RESIZE_THRESHOLD_SIZE;
|
|
1499
|
-
constexpr uint32_t kIncrement = BGFX_CONFIG_UNIFORM_BUFFER_RESIZE_INCREMENT_SIZE;
|
|
1592
|
+
static constexpr uint32_t kThreshold = BGFX_CONFIG_UNIFORM_BUFFER_RESIZE_THRESHOLD_SIZE;
|
|
1593
|
+
static constexpr uint32_t kIncrement = BGFX_CONFIG_UNIFORM_BUFFER_RESIZE_INCREMENT_SIZE;
|
|
1500
1594
|
|
|
1501
1595
|
UniformBuffer* uniformBuffer = *_uniformBuffer;
|
|
1502
1596
|
if (kThreshold >= uniformBuffer->m_size - uniformBuffer->m_pos)
|
|
@@ -1764,7 +1858,7 @@ namespace bgfx
|
|
|
1764
1858
|
|
|
1765
1859
|
m_startIndirect = 0;
|
|
1766
1860
|
m_numIndirect = UINT32_MAX;
|
|
1767
|
-
m_numIndirectIndex = 0;
|
|
1861
|
+
m_numIndirectIndex = 0;
|
|
1768
1862
|
m_indirectBuffer = BGFX_INVALID_HANDLE;
|
|
1769
1863
|
m_numIndirectBuffer = BGFX_INVALID_HANDLE;
|
|
1770
1864
|
m_occlusionQuery = BGFX_INVALID_HANDLE;
|
|
@@ -1953,6 +2047,7 @@ namespace bgfx
|
|
|
1953
2047
|
struct UniformRef
|
|
1954
2048
|
{
|
|
1955
2049
|
bx::FixedString64 m_name;
|
|
2050
|
+
UniformFreq::Enum m_freq;
|
|
1956
2051
|
UniformType::Enum m_type;
|
|
1957
2052
|
uint16_t m_num;
|
|
1958
2053
|
int16_t m_refCount;
|
|
@@ -2058,6 +2153,7 @@ namespace bgfx
|
|
|
2058
2153
|
setScissor(0, 0, 0, 0);
|
|
2059
2154
|
setClear(BGFX_CLEAR_NONE, 0, 0.0f, 0);
|
|
2060
2155
|
setMode(ViewMode::Default);
|
|
2156
|
+
setShadingRate(ShadingRate::Rate1x1);
|
|
2061
2157
|
setFrameBuffer(BGFX_INVALID_HANDLE);
|
|
2062
2158
|
setTransform(NULL, NULL);
|
|
2063
2159
|
}
|
|
@@ -2093,6 +2189,16 @@ namespace bgfx
|
|
|
2093
2189
|
m_mode = uint8_t(_mode);
|
|
2094
2190
|
}
|
|
2095
2191
|
|
|
2192
|
+
void setShadingRate(ShadingRate::Enum _shadingRate)
|
|
2193
|
+
{
|
|
2194
|
+
m_shadingRate = uint8_t(_shadingRate);
|
|
2195
|
+
}
|
|
2196
|
+
|
|
2197
|
+
void setUniform(UniformHandle _handle, const void* _value, uint16_t _num)
|
|
2198
|
+
{
|
|
2199
|
+
BX_UNUSED(_handle, _value, _num);
|
|
2200
|
+
}
|
|
2201
|
+
|
|
2096
2202
|
void setFrameBuffer(FrameBufferHandle _handle)
|
|
2097
2203
|
{
|
|
2098
2204
|
m_fbh = _handle;
|
|
@@ -2126,6 +2232,151 @@ namespace bgfx
|
|
|
2126
2232
|
Matrix4 m_proj;
|
|
2127
2233
|
FrameBufferHandle m_fbh;
|
|
2128
2234
|
uint8_t m_mode;
|
|
2235
|
+
uint8_t m_shadingRate;
|
|
2236
|
+
};
|
|
2237
|
+
|
|
2238
|
+
struct UniformCacheKey
|
|
2239
|
+
{
|
|
2240
|
+
using KeyT = uint64_t;
|
|
2241
|
+
|
|
2242
|
+
static constexpr uint8_t kViewShift = sizeof(KeyT)*8-16;
|
|
2243
|
+
static constexpr KeyT kViewMask = KeyT(UINT16_MAX)<<kViewShift;
|
|
2244
|
+
static constexpr uint8_t kHandleShift = kViewShift - 16;
|
|
2245
|
+
static constexpr KeyT kHandleMask = KeyT(UINT16_MAX)<<kHandleShift;
|
|
2246
|
+
static constexpr uint8_t kOffsetShift = kHandleShift-20;
|
|
2247
|
+
static constexpr KeyT kOffsetMask = KeyT(UINT32_MAX>>12)<<kOffsetShift;
|
|
2248
|
+
static constexpr uint8_t kSizeShift = kOffsetShift-12;
|
|
2249
|
+
static constexpr KeyT kSizeMask = KeyT(UINT16_MAX>>4)<<kSizeShift;
|
|
2250
|
+
|
|
2251
|
+
static_assert( (0
|
|
2252
|
+
| kViewMask
|
|
2253
|
+
| kHandleMask
|
|
2254
|
+
| kOffsetMask
|
|
2255
|
+
| kSizeMask
|
|
2256
|
+
) == (0
|
|
2257
|
+
^ kViewMask
|
|
2258
|
+
^ kHandleMask
|
|
2259
|
+
^ kOffsetMask
|
|
2260
|
+
^ kSizeMask
|
|
2261
|
+
), "UniformCacheKey: Key mask shouldn't overlap!");
|
|
2262
|
+
|
|
2263
|
+
KeyT encode()
|
|
2264
|
+
{
|
|
2265
|
+
static constexpr uint32_t kMaxSize = ( (kSizeMask >>kSizeShift ) + 1)<<4;
|
|
2266
|
+
static constexpr uint32_t kMaxOffset = ( (kOffsetMask>>kOffsetShift) + 1)<<4;
|
|
2267
|
+
|
|
2268
|
+
BX_ASSERT(true
|
|
2269
|
+
&& uint32_t(m_size) < kMaxSize
|
|
2270
|
+
&& m_offset < kMaxOffset
|
|
2271
|
+
, "UniformCacheKey couldn't fit size or offest (size %d max %d, offset %d max %d)!"
|
|
2272
|
+
, m_size
|
|
2273
|
+
, kMaxSize
|
|
2274
|
+
, m_offset
|
|
2275
|
+
, kMaxOffset
|
|
2276
|
+
);
|
|
2277
|
+
BX_UNUSED(kMaxSize, kMaxOffset);
|
|
2278
|
+
|
|
2279
|
+
const KeyT view = (KeyT(m_view) << kViewShift) & kViewMask;
|
|
2280
|
+
const KeyT handle = (KeyT(m_handle) << kHandleShift) & kHandleMask;
|
|
2281
|
+
const KeyT offset = (KeyT(m_offset>>4) << kOffsetShift) & kOffsetMask;
|
|
2282
|
+
const KeyT size = (KeyT(m_size>>4) << kSizeShift) & kSizeMask;
|
|
2283
|
+
const KeyT key = view|handle|offset|size;
|
|
2284
|
+
|
|
2285
|
+
return key;
|
|
2286
|
+
}
|
|
2287
|
+
|
|
2288
|
+
void decode(KeyT _key)
|
|
2289
|
+
{
|
|
2290
|
+
m_offset = (uint32_t( (_key & kOffsetMask) >> kOffsetShift) ) << 4;
|
|
2291
|
+
m_handle = {uint16_t( (_key & kHandleMask) >> kHandleShift) };
|
|
2292
|
+
m_size = (uint16_t( (_key & kSizeMask) >> kSizeShift ) ) << 4;
|
|
2293
|
+
m_view = ViewId( (_key & kViewMask) >> kViewShift);
|
|
2294
|
+
}
|
|
2295
|
+
|
|
2296
|
+
static KeyT remapView(KeyT _key, ViewId _viewRemap[BGFX_CONFIG_MAX_VIEWS])
|
|
2297
|
+
{
|
|
2298
|
+
const ViewId oldView = ViewId( (_key & kViewMask) >> kViewShift);
|
|
2299
|
+
const KeyT view = UINT16_MAX != oldView
|
|
2300
|
+
? (KeyT(_viewRemap[oldView]) << kViewShift) & kViewMask
|
|
2301
|
+
: 0 // frame uniforms go into physical view 0.
|
|
2302
|
+
;
|
|
2303
|
+
const KeyT key = (_key & ~kViewMask) | view;
|
|
2304
|
+
return key;
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
uint32_t m_offset;
|
|
2308
|
+
uint16_t m_handle;
|
|
2309
|
+
uint16_t m_size;
|
|
2310
|
+
ViewId m_view;
|
|
2311
|
+
};
|
|
2312
|
+
|
|
2313
|
+
struct UniformCacheEntry
|
|
2314
|
+
{
|
|
2315
|
+
uint32_t offset;
|
|
2316
|
+
uint16_t size;
|
|
2317
|
+
int16_t refCount;
|
|
2318
|
+
};
|
|
2319
|
+
|
|
2320
|
+
struct UniformCacheFrame
|
|
2321
|
+
{
|
|
2322
|
+
static constexpr uint32_t kMinKeysCapacity = 256;
|
|
2323
|
+
static constexpr uint32_t kMinDataCapacity = 16<<10;
|
|
2324
|
+
|
|
2325
|
+
UniformCacheFrame()
|
|
2326
|
+
: m_keys(NULL)
|
|
2327
|
+
, m_data(NULL)
|
|
2328
|
+
, m_numItems(0)
|
|
2329
|
+
, m_keysCapacity(kMinKeysCapacity)
|
|
2330
|
+
, m_dataCapacity(kMinDataCapacity)
|
|
2331
|
+
{
|
|
2332
|
+
m_keys = (UniformCacheKey::KeyT*)bx::alloc(g_allocator, m_keysCapacity*sizeof(uint64_t) );
|
|
2333
|
+
m_data = (uint8_t*)bx::alloc(g_allocator, m_dataCapacity);
|
|
2334
|
+
}
|
|
2335
|
+
|
|
2336
|
+
~UniformCacheFrame()
|
|
2337
|
+
{
|
|
2338
|
+
bx::free(g_allocator, m_keys);
|
|
2339
|
+
bx::free(g_allocator, m_data);
|
|
2340
|
+
}
|
|
2341
|
+
|
|
2342
|
+
void resize(uint32_t _keysCapacity, uint32_t _dataCapacity)
|
|
2343
|
+
{
|
|
2344
|
+
{
|
|
2345
|
+
const uint32_t newKeysCapacity = bx::alignUp(bx::max(_keysCapacity, kMinKeysCapacity), kMinKeysCapacity);
|
|
2346
|
+
|
|
2347
|
+
if (newKeysCapacity != m_keysCapacity)
|
|
2348
|
+
{
|
|
2349
|
+
m_keys = (UniformCacheKey::KeyT*)bx::realloc(g_allocator, m_keys, newKeysCapacity * sizeof(uint64_t));
|
|
2350
|
+
m_keysCapacity = newKeysCapacity;
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
|
|
2354
|
+
{
|
|
2355
|
+
const uint32_t newDataCapacity = bx::alignUp(bx::max(_dataCapacity, kMinDataCapacity), kMinDataCapacity);
|
|
2356
|
+
|
|
2357
|
+
if (newDataCapacity != m_dataCapacity)
|
|
2358
|
+
{
|
|
2359
|
+
m_data = (uint8_t*)bx::realloc(g_allocator, m_data, newDataCapacity);
|
|
2360
|
+
m_dataCapacity = newDataCapacity;
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
}
|
|
2364
|
+
|
|
2365
|
+
void sort(ViewId* _viewRemap, uint64_t* _tempKeys)
|
|
2366
|
+
{
|
|
2367
|
+
for (uint32_t ii = 0, num = m_numItems; ii < num; ++ii)
|
|
2368
|
+
{
|
|
2369
|
+
m_keys[ii] = UniformCacheKey::remapView(m_keys[ii], _viewRemap);
|
|
2370
|
+
}
|
|
2371
|
+
|
|
2372
|
+
bx::radixSort(m_keys, _tempKeys, m_numItems);
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
|
+
uint64_t* m_keys;
|
|
2376
|
+
uint8_t* m_data;
|
|
2377
|
+
uint32_t m_numItems;
|
|
2378
|
+
uint32_t m_keysCapacity;
|
|
2379
|
+
uint32_t m_dataCapacity;
|
|
2129
2380
|
};
|
|
2130
2381
|
|
|
2131
2382
|
struct FrameCache
|
|
@@ -2175,7 +2426,7 @@ namespace bgfx
|
|
|
2175
2426
|
|
|
2176
2427
|
m_perfStats.viewStats = m_viewStats;
|
|
2177
2428
|
|
|
2178
|
-
bx::memSet(&m_renderItemBind[0], 0, sizeof(m_renderItemBind));
|
|
2429
|
+
bx::memSet(&m_renderItemBind[0], 0, sizeof(m_renderItemBind) );
|
|
2179
2430
|
}
|
|
2180
2431
|
|
|
2181
2432
|
~Frame()
|
|
@@ -2351,11 +2602,13 @@ namespace bgfx
|
|
|
2351
2602
|
uint32_t m_blitKeys[BGFX_CONFIG_MAX_BLIT_ITEMS+1];
|
|
2352
2603
|
BlitItem m_blitItem[BGFX_CONFIG_MAX_BLIT_ITEMS+1];
|
|
2353
2604
|
|
|
2605
|
+
UniformCacheFrame m_uniformCacheFrame;
|
|
2606
|
+
|
|
2354
2607
|
FrameCache m_frameCache;
|
|
2355
2608
|
UniformBuffer** m_uniformBuffer;
|
|
2356
2609
|
|
|
2357
2610
|
uint32_t m_numRenderItems;
|
|
2358
|
-
|
|
2611
|
+
uint32_t m_numBlitItems;
|
|
2359
2612
|
|
|
2360
2613
|
uint32_t m_iboffset;
|
|
2361
2614
|
uint32_t m_vboffset;
|
|
@@ -2458,9 +2711,12 @@ namespace bgfx
|
|
|
2458
2711
|
// will leaves bytes uninitialized. This will influence the hashing
|
|
2459
2712
|
// as it reads those bytes too. To make this deterministic, we will
|
|
2460
2713
|
// clear all bytes (inclusively the padding) before we start.
|
|
2461
|
-
bx::memSet(&m_bind, 0, sizeof(m_bind));
|
|
2714
|
+
bx::memSet(&m_bind, 0, sizeof(m_bind) );
|
|
2462
2715
|
|
|
2463
|
-
|
|
2716
|
+
m_discard = false;
|
|
2717
|
+
m_draw.clear(BGFX_DISCARD_ALL);
|
|
2718
|
+
m_compute.clear(BGFX_DISCARD_ALL);
|
|
2719
|
+
m_bind.clear(BGFX_DISCARD_ALL);
|
|
2464
2720
|
}
|
|
2465
2721
|
|
|
2466
2722
|
void begin(Frame* _frame, uint8_t _idx)
|
|
@@ -2517,7 +2773,14 @@ namespace bgfx
|
|
|
2517
2773
|
, _handle.idx
|
|
2518
2774
|
, getName(_handle)
|
|
2519
2775
|
);
|
|
2520
|
-
|
|
2776
|
+
m_uniformSet.insert(_handle.idx);
|
|
2777
|
+
|
|
2778
|
+
const UniformRef& uniform = getUniformRef(_handle);
|
|
2779
|
+
BX_ASSERT(UniformFreq::Draw == uniform.m_freq
|
|
2780
|
+
, "Setting uniform for draw call, but uniform frequency is different (frequency: %d)!"
|
|
2781
|
+
, uniform.m_freq
|
|
2782
|
+
);
|
|
2783
|
+
BX_UNUSED(uniform);
|
|
2521
2784
|
}
|
|
2522
2785
|
|
|
2523
2786
|
UniformBuffer::update(&m_frame->m_uniformBuffer[m_uniformIdx]);
|
|
@@ -2527,8 +2790,8 @@ namespace bgfx
|
|
|
2527
2790
|
|
|
2528
2791
|
void setState(uint64_t _state, uint32_t _rgba)
|
|
2529
2792
|
{
|
|
2530
|
-
const uint8_t blend
|
|
2531
|
-
|
|
2793
|
+
const uint8_t blend = ( (_state&BGFX_STATE_BLEND_MASK )>>BGFX_STATE_BLEND_SHIFT )&0xff;
|
|
2794
|
+
m_key.m_hasAlphaRef = !!( ( (_state&BGFX_STATE_ALPHA_REF_MASK)>>BGFX_STATE_ALPHA_REF_SHIFT)&0xff);
|
|
2532
2795
|
|
|
2533
2796
|
// Transparency sort order table:
|
|
2534
2797
|
//
|
|
@@ -2547,7 +2810,7 @@ namespace bgfx
|
|
|
2547
2810
|
// | | | | | | | | | | | | +----- BGFX_STATE_BLEND_INV_FACTOR
|
|
2548
2811
|
// | | | | | | | | | | | | |
|
|
2549
2812
|
// x | | | | | | | | | | | | | x x x x x
|
|
2550
|
-
m_key.m_blend = "\x0\x2\x2\
|
|
2813
|
+
m_key.m_blend = "\x0\x1\x1\x2\x2\x1\x2\x1\x2\x1\x1\x1\x1\x1\x1\x1\x1\x1\x1"[( (blend)&0xf) + (!!blend)];
|
|
2551
2814
|
|
|
2552
2815
|
m_draw.m_stateFlags = _state;
|
|
2553
2816
|
m_draw.m_rgba = _rgba;
|
|
@@ -2792,6 +3055,13 @@ namespace bgfx
|
|
|
2792
3055
|
m_draw.clear(_flags);
|
|
2793
3056
|
m_compute.clear(_flags);
|
|
2794
3057
|
m_bind.clear(_flags);
|
|
3058
|
+
|
|
3059
|
+
if (_flags & BGFX_DISCARD_STATE)
|
|
3060
|
+
{
|
|
3061
|
+
UniformBuffer* uniformBuffer = m_frame->m_uniformBuffer[m_uniformIdx];
|
|
3062
|
+
m_uniformEnd = uniformBuffer->getPos();
|
|
3063
|
+
m_uniformBegin = m_uniformEnd;
|
|
3064
|
+
}
|
|
2795
3065
|
}
|
|
2796
3066
|
|
|
2797
3067
|
void submit(ViewId _id, ProgramHandle _program, OcclusionQueryHandle _occlusionQuery, uint32_t _depth, uint8_t _flags);
|
|
@@ -2947,12 +3217,20 @@ namespace bgfx
|
|
|
2947
3217
|
};
|
|
2948
3218
|
|
|
2949
3219
|
// First-fit non-local allocator.
|
|
3220
|
+
//
|
|
3221
|
+
// The free list is kept sorted by address at all times, which:
|
|
3222
|
+
// - Enables O(1) adjacent-block coalescing on free (no deferred compact needed).
|
|
3223
|
+
// - Eliminates the need to sort during compact().
|
|
3224
|
+
// - Provides cache-friendly iteration (contiguous vector storage).
|
|
3225
|
+
// - Uses binary search for sorted insertion, replacing the O(n) push_front.
|
|
3226
|
+
//
|
|
2950
3227
|
class NonLocalAllocator
|
|
2951
3228
|
{
|
|
2952
3229
|
public:
|
|
2953
3230
|
static const uint64_t kInvalidBlock = UINT64_MAX;
|
|
2954
3231
|
|
|
2955
3232
|
NonLocalAllocator()
|
|
3233
|
+
: m_total(0)
|
|
2956
3234
|
{
|
|
2957
3235
|
}
|
|
2958
3236
|
|
|
@@ -2964,11 +3242,12 @@ namespace bgfx
|
|
|
2964
3242
|
{
|
|
2965
3243
|
m_free.clear();
|
|
2966
3244
|
m_used.clear();
|
|
3245
|
+
m_total = 0;
|
|
2967
3246
|
}
|
|
2968
3247
|
|
|
2969
3248
|
void add(uint64_t _ptr, uint32_t _size)
|
|
2970
3249
|
{
|
|
2971
|
-
|
|
3250
|
+
insertFreeBlock(_ptr, _size);
|
|
2972
3251
|
}
|
|
2973
3252
|
|
|
2974
3253
|
uint64_t remove()
|
|
@@ -2978,7 +3257,7 @@ namespace bgfx
|
|
|
2978
3257
|
if (0 < m_free.size() )
|
|
2979
3258
|
{
|
|
2980
3259
|
Free freeBlock = m_free.front();
|
|
2981
|
-
m_free.
|
|
3260
|
+
m_free.erase(m_free.begin() );
|
|
2982
3261
|
return freeBlock.m_ptr;
|
|
2983
3262
|
}
|
|
2984
3263
|
|
|
@@ -2996,6 +3275,7 @@ namespace bgfx
|
|
|
2996
3275
|
uint64_t ptr = it->m_ptr;
|
|
2997
3276
|
|
|
2998
3277
|
m_used.insert(stl::make_pair(ptr, _size) );
|
|
3278
|
+
m_total += _size;
|
|
2999
3279
|
|
|
3000
3280
|
if (it->m_size != _size)
|
|
3001
3281
|
{
|
|
@@ -3020,32 +3300,30 @@ namespace bgfx
|
|
|
3020
3300
|
UsedList::iterator it = m_used.find(_block);
|
|
3021
3301
|
if (it != m_used.end() )
|
|
3022
3302
|
{
|
|
3023
|
-
|
|
3303
|
+
const uint64_t ptr = it->first;
|
|
3304
|
+
const uint32_t size = it->second;
|
|
3305
|
+
|
|
3306
|
+
m_total -= size;
|
|
3024
3307
|
m_used.erase(it);
|
|
3308
|
+
|
|
3309
|
+
// Insert into sorted free list and coalesce with adjacent blocks.
|
|
3310
|
+
insertFreeBlock(ptr, size);
|
|
3025
3311
|
}
|
|
3026
3312
|
}
|
|
3027
3313
|
|
|
3028
3314
|
bool compact()
|
|
3029
3315
|
{
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
{
|
|
3034
|
-
if ( (it->m_ptr + it->m_size) == next->m_ptr)
|
|
3035
|
-
{
|
|
3036
|
-
it->m_size += next->m_size;
|
|
3037
|
-
next = m_free.erase(next);
|
|
3038
|
-
}
|
|
3039
|
-
else
|
|
3040
|
-
{
|
|
3041
|
-
it = next;
|
|
3042
|
-
++next;
|
|
3043
|
-
}
|
|
3044
|
-
}
|
|
3045
|
-
|
|
3316
|
+
// The free list is maintained in sorted order with immediate
|
|
3317
|
+
// coalescing, so compact() is a no-op for merging. Just report
|
|
3318
|
+
// whether all allocations have been freed.
|
|
3046
3319
|
return 0 == m_used.size();
|
|
3047
3320
|
}
|
|
3048
3321
|
|
|
3322
|
+
uint32_t getTotal() const
|
|
3323
|
+
{
|
|
3324
|
+
return m_total;
|
|
3325
|
+
}
|
|
3326
|
+
|
|
3049
3327
|
private:
|
|
3050
3328
|
struct Free
|
|
3051
3329
|
{
|
|
@@ -3060,15 +3338,331 @@ namespace bgfx
|
|
|
3060
3338
|
return m_ptr < rhs.m_ptr;
|
|
3061
3339
|
}
|
|
3062
3340
|
|
|
3341
|
+
bool operator>(const Free& rhs) const
|
|
3342
|
+
{
|
|
3343
|
+
return m_ptr > rhs.m_ptr;
|
|
3344
|
+
}
|
|
3345
|
+
|
|
3063
3346
|
uint64_t m_ptr;
|
|
3064
3347
|
uint32_t m_size;
|
|
3065
3348
|
};
|
|
3066
3349
|
|
|
3067
|
-
|
|
3350
|
+
// Insert a free block at its sorted position and coalesce with
|
|
3351
|
+
// adjacent neighbors. Uses bx::upperBound to find the insertion
|
|
3352
|
+
// point in O(log n), then checks the immediate neighbors for
|
|
3353
|
+
// merge opportunities.
|
|
3354
|
+
void insertFreeBlock(uint64_t _ptr, uint32_t _size)
|
|
3355
|
+
{
|
|
3356
|
+
// Use bx::upperBound to find the insertion point (first element with m_ptr > _ptr).
|
|
3357
|
+
const Free key(_ptr, 0);
|
|
3358
|
+
const uint32_t idx = 0 < m_free.size()
|
|
3359
|
+
? bx::upperBound(key, m_free.data(), uint32_t(m_free.size() ) )
|
|
3360
|
+
: 0
|
|
3361
|
+
;
|
|
3362
|
+
|
|
3363
|
+
// Check if we can merge with the previous block.
|
|
3364
|
+
const bool mergePrev = idx > 0
|
|
3365
|
+
&& (m_free[idx - 1].m_ptr + m_free[idx - 1].m_size) == _ptr
|
|
3366
|
+
;
|
|
3367
|
+
|
|
3368
|
+
// Check if we can merge with the next block.
|
|
3369
|
+
const bool mergeNext = idx < uint32_t(m_free.size() )
|
|
3370
|
+
&& (_ptr + _size) == m_free[idx].m_ptr
|
|
3371
|
+
;
|
|
3372
|
+
|
|
3373
|
+
if (mergePrev && mergeNext)
|
|
3374
|
+
{
|
|
3375
|
+
// Merge all three: extend previous to cover current + next.
|
|
3376
|
+
m_free[idx - 1].m_size += _size + m_free[idx].m_size;
|
|
3377
|
+
m_free.erase(m_free.begin() + idx);
|
|
3378
|
+
}
|
|
3379
|
+
else if (mergePrev)
|
|
3380
|
+
{
|
|
3381
|
+
// Extend previous block.
|
|
3382
|
+
m_free[idx - 1].m_size += _size;
|
|
3383
|
+
}
|
|
3384
|
+
else if (mergeNext)
|
|
3385
|
+
{
|
|
3386
|
+
// Extend next block backward.
|
|
3387
|
+
m_free[idx].m_ptr = _ptr;
|
|
3388
|
+
m_free[idx].m_size += _size;
|
|
3389
|
+
}
|
|
3390
|
+
else
|
|
3391
|
+
{
|
|
3392
|
+
// No merge possible — insert new block at sorted position.
|
|
3393
|
+
m_free.insert(m_free.begin() + idx, Free(_ptr, _size) );
|
|
3394
|
+
}
|
|
3395
|
+
}
|
|
3396
|
+
|
|
3397
|
+
typedef stl::vector<Free> FreeList;
|
|
3068
3398
|
FreeList m_free;
|
|
3069
3399
|
|
|
3070
3400
|
typedef stl::unordered_map<uint64_t, uint32_t> UsedList;
|
|
3071
3401
|
UsedList m_used;
|
|
3402
|
+
|
|
3403
|
+
uint32_t m_total;
|
|
3404
|
+
};
|
|
3405
|
+
|
|
3406
|
+
struct UniformCache
|
|
3407
|
+
{
|
|
3408
|
+
UniformCache()
|
|
3409
|
+
{
|
|
3410
|
+
const uint32_t size = 1<<20;
|
|
3411
|
+
m_data = (uint8_t*)bx::alloc(g_allocator, size);
|
|
3412
|
+
m_uniformStoreAlloc.add(0, size);
|
|
3413
|
+
}
|
|
3414
|
+
|
|
3415
|
+
~UniformCache()
|
|
3416
|
+
{
|
|
3417
|
+
BX_ASSERT(true
|
|
3418
|
+
&& 0 == m_uniformKeyHashMap.size()
|
|
3419
|
+
&& 0 == m_uniformEntryMap.size()
|
|
3420
|
+
&& 0 == m_uniformStoreAlloc.getTotal()
|
|
3421
|
+
, "UniformCache leak (keys %d, entries %d, %d bytes)!"
|
|
3422
|
+
, m_uniformKeyHashMap.size()
|
|
3423
|
+
, m_uniformEntryMap.size()
|
|
3424
|
+
, m_uniformStoreAlloc.getTotal()
|
|
3425
|
+
);
|
|
3426
|
+
|
|
3427
|
+
bx::free(g_allocator, m_data);
|
|
3428
|
+
m_uniformKeyHashMap.clear();
|
|
3429
|
+
m_uniformEntryMap.clear();
|
|
3430
|
+
}
|
|
3431
|
+
|
|
3432
|
+
void setViewUniform(ViewId _id, UniformHandle _handle, const void* _value, uint16_t _num)
|
|
3433
|
+
{
|
|
3434
|
+
const UniformRef& uniform = getUniformRef(_handle);
|
|
3435
|
+
|
|
3436
|
+
const UniformFreq::Enum freq = UINT16_MAX == _id
|
|
3437
|
+
? UniformFreq::Frame
|
|
3438
|
+
: UniformFreq::View
|
|
3439
|
+
;
|
|
3440
|
+
|
|
3441
|
+
BX_ASSERT(0 < uniform.m_refCount
|
|
3442
|
+
, "Uniform reference count it 0 (handle %3d)!"
|
|
3443
|
+
, _handle.idx
|
|
3444
|
+
);
|
|
3445
|
+
BX_ASSERT(uniform.m_freq == freq
|
|
3446
|
+
, "Setting uniform per view, but uniform is created with different bgfx::UniformFreq::Enum!"
|
|
3447
|
+
);
|
|
3448
|
+
BX_ASSERT(_num == UINT16_MAX || uniform.m_num >= _num
|
|
3449
|
+
, "Truncated uniform update. %d (max: %d)"
|
|
3450
|
+
, _num, uniform.m_num
|
|
3451
|
+
);
|
|
3452
|
+
BX_UNUSED(freq);
|
|
3453
|
+
|
|
3454
|
+
UniformCacheKey key =
|
|
3455
|
+
{
|
|
3456
|
+
.m_offset = 0,
|
|
3457
|
+
.m_handle = _handle.idx,
|
|
3458
|
+
.m_size = 0,
|
|
3459
|
+
.m_view = _id,
|
|
3460
|
+
};
|
|
3461
|
+
|
|
3462
|
+
static constexpr UniformCacheKey::KeyT kViewHandleMask = UniformCacheKey::kViewMask|UniformCacheKey::kHandleMask;
|
|
3463
|
+
static_assert( ( (kViewHandleMask>>32)<<32) == kViewHandleMask, "View + handle must be in top 32 bits of 64-bit key.");
|
|
3464
|
+
const uint32_t uniformKey = uint32_t(key.encode() >> 32);
|
|
3465
|
+
|
|
3466
|
+
setUniform(uniformKey, uniform.m_type, _value, _num);
|
|
3467
|
+
}
|
|
3468
|
+
|
|
3469
|
+
void setUniform(uint32_t _uniformKey, UniformType::Enum _type, const void* _value, uint16_t _num)
|
|
3470
|
+
{
|
|
3471
|
+
const uint32_t typeSize = g_uniformTypeSize[_type];
|
|
3472
|
+
const uint32_t dataSize = _num * typeSize;
|
|
3473
|
+
|
|
3474
|
+
bx::HashMurmur3 murmur;
|
|
3475
|
+
murmur.begin();
|
|
3476
|
+
murmur.add(_type);
|
|
3477
|
+
murmur.add(_num);
|
|
3478
|
+
murmur.add(_value, dataSize);
|
|
3479
|
+
const uint32_t hash = murmur.end();
|
|
3480
|
+
|
|
3481
|
+
UniformKeyHashMap::iterator itKey = m_uniformKeyHashMap.find(_uniformKey);
|
|
3482
|
+
if (itKey != m_uniformKeyHashMap.end() )
|
|
3483
|
+
{
|
|
3484
|
+
if (itKey->second == hash)
|
|
3485
|
+
{
|
|
3486
|
+
return;
|
|
3487
|
+
}
|
|
3488
|
+
|
|
3489
|
+
UniformEntryMap::iterator itOldEntry = m_uniformEntryMap.find(itKey->second);
|
|
3490
|
+
if (itOldEntry != m_uniformEntryMap.end())
|
|
3491
|
+
{
|
|
3492
|
+
if (release(itOldEntry->second) )
|
|
3493
|
+
{
|
|
3494
|
+
m_uniformEntryMap.erase(itOldEntry);
|
|
3495
|
+
}
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
itKey->second = hash;
|
|
3499
|
+
|
|
3500
|
+
UniformEntryMap::iterator itEntry = m_uniformEntryMap.find(hash);
|
|
3501
|
+
if (itEntry != m_uniformEntryMap.end())
|
|
3502
|
+
{
|
|
3503
|
+
++itEntry->second.refCount;
|
|
3504
|
+
|
|
3505
|
+
return;
|
|
3506
|
+
}
|
|
3507
|
+
}
|
|
3508
|
+
else
|
|
3509
|
+
{
|
|
3510
|
+
m_uniformKeyHashMap.insert(stl::make_pair(_uniformKey, hash) );
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
UniformEntryMap::iterator itEntry = m_uniformEntryMap.find(hash);
|
|
3514
|
+
if (itEntry != m_uniformEntryMap.end())
|
|
3515
|
+
{
|
|
3516
|
+
++itEntry->second.refCount;
|
|
3517
|
+
}
|
|
3518
|
+
else
|
|
3519
|
+
{
|
|
3520
|
+
const uint64_t offset = m_uniformStoreAlloc.alloc(dataSize);
|
|
3521
|
+
BX_ASSERT(NonLocalAllocator::kInvalidBlock != offset, "UniformCache: Failed to allocate data!");
|
|
3522
|
+
|
|
3523
|
+
m_uniformEntryMap.insert(stl::make_pair(hash, UniformCacheEntry
|
|
3524
|
+
{
|
|
3525
|
+
.offset = bx::narrowCast<uint32_t>(offset),
|
|
3526
|
+
.size = bx::narrowCast<uint16_t>(dataSize),
|
|
3527
|
+
.refCount = 1
|
|
3528
|
+
}) );
|
|
3529
|
+
|
|
3530
|
+
bx::memCopy(&m_data[offset], _value, dataSize);
|
|
3531
|
+
}
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
void frame(UniformCacheFrame& _outUniformCacheFrame)
|
|
3535
|
+
{
|
|
3536
|
+
m_uniformStoreAlloc.compact();
|
|
3537
|
+
|
|
3538
|
+
_outUniformCacheFrame.resize(
|
|
3539
|
+
uint32_t(m_uniformKeyHashMap.size() )
|
|
3540
|
+
, m_uniformStoreAlloc.getTotal()
|
|
3541
|
+
);
|
|
3542
|
+
|
|
3543
|
+
using OffsetRemap = stl::unordered_map<uint32_t, uint32_t>;
|
|
3544
|
+
OffsetRemap offsetRemap;
|
|
3545
|
+
|
|
3546
|
+
uint32_t linearOffset = 0;
|
|
3547
|
+
uint32_t num = 0;
|
|
3548
|
+
for (UniformKeyHashMap::const_iterator itKey = m_uniformKeyHashMap.begin(), itEnd = m_uniformKeyHashMap.end(); itKey != itEnd; ++itKey)
|
|
3549
|
+
{
|
|
3550
|
+
UniformEntryMap::iterator itEntry = m_uniformEntryMap.find(itKey->second);
|
|
3551
|
+
BX_ASSERT(itEntry != m_uniformEntryMap.end()
|
|
3552
|
+
, "Couldn't find uniform cache entry for key 0x%d, hash 0x%x!"
|
|
3553
|
+
, itKey->first
|
|
3554
|
+
, itKey->second
|
|
3555
|
+
);
|
|
3556
|
+
|
|
3557
|
+
const uint32_t offset = itEntry->second.offset;
|
|
3558
|
+
const uint16_t size = itEntry->second.size;
|
|
3559
|
+
|
|
3560
|
+
UniformCacheKey key;
|
|
3561
|
+
key.decode(uint64_t(itKey->first)<<32);
|
|
3562
|
+
key.m_size = size;
|
|
3563
|
+
|
|
3564
|
+
OffsetRemap::const_iterator itOffset = offsetRemap.find(offset);
|
|
3565
|
+
if (itOffset != offsetRemap.end())
|
|
3566
|
+
{
|
|
3567
|
+
key.m_offset = itOffset->second;
|
|
3568
|
+
}
|
|
3569
|
+
else
|
|
3570
|
+
{
|
|
3571
|
+
key.m_offset = linearOffset;
|
|
3572
|
+
|
|
3573
|
+
offsetRemap.insert(stl::make_pair(offset, linearOffset) );
|
|
3574
|
+
bx::memCopy(&_outUniformCacheFrame.m_data[linearOffset], &m_data[offset], size);
|
|
3575
|
+
|
|
3576
|
+
linearOffset += size;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
_outUniformCacheFrame.m_keys[num++] = key.encode();
|
|
3580
|
+
}
|
|
3581
|
+
|
|
3582
|
+
_outUniformCacheFrame.m_numItems = num;
|
|
3583
|
+
}
|
|
3584
|
+
|
|
3585
|
+
void invalidate(ViewId _viewId)
|
|
3586
|
+
{
|
|
3587
|
+
for (UniformKeyHashMap::iterator itKey = m_uniformKeyHashMap.begin(), itEnd = m_uniformKeyHashMap.end(); itKey != itEnd;)
|
|
3588
|
+
{
|
|
3589
|
+
UniformCacheKey key;
|
|
3590
|
+
key.decode(uint64_t(itKey->first) << 32);
|
|
3591
|
+
|
|
3592
|
+
if (key.m_view == _viewId)
|
|
3593
|
+
{
|
|
3594
|
+
release(itKey->second);
|
|
3595
|
+
|
|
3596
|
+
UniformKeyHashMap::iterator itErase = itKey;
|
|
3597
|
+
++itKey;
|
|
3598
|
+
|
|
3599
|
+
m_uniformKeyHashMap.erase(itErase);
|
|
3600
|
+
}
|
|
3601
|
+
else
|
|
3602
|
+
{
|
|
3603
|
+
++itKey;
|
|
3604
|
+
}
|
|
3605
|
+
}
|
|
3606
|
+
}
|
|
3607
|
+
|
|
3608
|
+
void invalidate(UniformHandle _handle)
|
|
3609
|
+
{
|
|
3610
|
+
for (UniformKeyHashMap::iterator itKey = m_uniformKeyHashMap.begin(), itEnd = m_uniformKeyHashMap.end(); itKey != itEnd;)
|
|
3611
|
+
{
|
|
3612
|
+
UniformCacheKey key;
|
|
3613
|
+
key.decode(uint64_t(itKey->first) << 32);
|
|
3614
|
+
|
|
3615
|
+
if (key.m_handle == _handle.idx)
|
|
3616
|
+
{
|
|
3617
|
+
release(itKey->second);
|
|
3618
|
+
|
|
3619
|
+
UniformKeyHashMap::iterator itErase = itKey;
|
|
3620
|
+
++itKey;
|
|
3621
|
+
|
|
3622
|
+
m_uniformKeyHashMap.erase(itErase);
|
|
3623
|
+
}
|
|
3624
|
+
else
|
|
3625
|
+
{
|
|
3626
|
+
++itKey;
|
|
3627
|
+
}
|
|
3628
|
+
}
|
|
3629
|
+
}
|
|
3630
|
+
|
|
3631
|
+
bool release(UniformCacheEntry& _entry)
|
|
3632
|
+
{
|
|
3633
|
+
--_entry.refCount;
|
|
3634
|
+
|
|
3635
|
+
if (0 == _entry.refCount)
|
|
3636
|
+
{
|
|
3637
|
+
const uint64_t offset = _entry.offset;
|
|
3638
|
+
|
|
3639
|
+
m_uniformStoreAlloc.free(offset);
|
|
3640
|
+
return true;
|
|
3641
|
+
}
|
|
3642
|
+
|
|
3643
|
+
return false;
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3646
|
+
void release(uint32_t _hash)
|
|
3647
|
+
{
|
|
3648
|
+
UniformEntryMap::iterator itEntry = m_uniformEntryMap.find(_hash);
|
|
3649
|
+
if (itEntry != m_uniformEntryMap.end())
|
|
3650
|
+
{
|
|
3651
|
+
if (release(itEntry->second) )
|
|
3652
|
+
{
|
|
3653
|
+
m_uniformEntryMap.erase(itEntry);
|
|
3654
|
+
}
|
|
3655
|
+
}
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3658
|
+
using UniformKeyHashMap = stl::unordered_map<uint32_t, uint32_t>;
|
|
3659
|
+
using UniformEntryMap = stl::unordered_map<uint32_t, UniformCacheEntry>;
|
|
3660
|
+
|
|
3661
|
+
UniformKeyHashMap m_uniformKeyHashMap;
|
|
3662
|
+
UniformEntryMap m_uniformEntryMap;
|
|
3663
|
+
|
|
3664
|
+
NonLocalAllocator m_uniformStoreAlloc;
|
|
3665
|
+
uint8_t* m_data;
|
|
3072
3666
|
};
|
|
3073
3667
|
|
|
3074
3668
|
struct BX_NO_VTABLE RendererContextI
|
|
@@ -3094,10 +3688,8 @@ namespace bgfx
|
|
|
3094
3688
|
virtual void destroyShader(ShaderHandle _handle) = 0;
|
|
3095
3689
|
virtual void createProgram(ProgramHandle _handle, ShaderHandle _vsh, ShaderHandle _fsh) = 0;
|
|
3096
3690
|
virtual void destroyProgram(ProgramHandle _handle) = 0;
|
|
3097
|
-
virtual void* createTexture(TextureHandle _handle, const Memory* _mem, uint64_t _flags, uint8_t _skip) = 0;
|
|
3098
|
-
virtual void updateTextureBegin(TextureHandle _handle, uint8_t _side, uint8_t _mip) = 0;
|
|
3691
|
+
virtual void* createTexture(TextureHandle _handle, const Memory* _mem, uint64_t _flags, uint8_t _skip, uint64_t _external) = 0;
|
|
3099
3692
|
virtual void updateTexture(TextureHandle _handle, uint8_t _side, uint8_t _mip, const Rect& _rect, uint16_t _z, uint16_t _depth, uint16_t _pitch, const Memory* _mem) = 0;
|
|
3100
|
-
virtual void updateTextureEnd() = 0;
|
|
3101
3693
|
virtual void readTexture(TextureHandle _handle, void* _data, uint8_t _mip) = 0;
|
|
3102
3694
|
virtual void resizeTexture(TextureHandle _handle, uint16_t _width, uint16_t _height, uint8_t _numMips, uint16_t _numLayers) = 0;
|
|
3103
3695
|
virtual void overrideInternal(TextureHandle _handle, uintptr_t _ptr, uint16_t _layerIndex) = 0;
|
|
@@ -3115,8 +3707,9 @@ namespace bgfx
|
|
|
3115
3707
|
virtual void setMarker(const char* _name, uint16_t _len) = 0;
|
|
3116
3708
|
virtual void setName(Handle _handle, const char* _name, uint16_t _len) = 0;
|
|
3117
3709
|
virtual void submit(Frame* _render, ClearQuad& _clearQuad, TextVideoMemBlitter& _textVideoMemBlitter) = 0;
|
|
3118
|
-
virtual void
|
|
3119
|
-
virtual void
|
|
3710
|
+
virtual void dbgTextRenderBegin(TextVideoMemBlitter& _blitter) = 0;
|
|
3711
|
+
virtual void dbgTextRender(TextVideoMemBlitter& _blitter, uint32_t _numIndices) = 0;
|
|
3712
|
+
virtual void dbgTextRenderEnd(TextVideoMemBlitter& _blitter) = 0;
|
|
3120
3713
|
};
|
|
3121
3714
|
|
|
3122
3715
|
inline RendererContextI::~RendererContextI()
|
|
@@ -3168,7 +3761,7 @@ namespace bgfx
|
|
|
3168
3761
|
BX_TRACE("render thread exit");
|
|
3169
3762
|
return bx::kExitSuccess;
|
|
3170
3763
|
}
|
|
3171
|
-
#endif
|
|
3764
|
+
#endif // BX_CONFIG_SUPPORTS_THREADING
|
|
3172
3765
|
|
|
3173
3766
|
// game thread
|
|
3174
3767
|
bool init(const Init& _init);
|
|
@@ -3198,6 +3791,11 @@ namespace bgfx
|
|
|
3198
3791
|
: m_init.resolution.formatColor
|
|
3199
3792
|
;
|
|
3200
3793
|
|
|
3794
|
+
BX_ASSERT(0 != (g_caps.formats[formatColor] & BGFX_CAPS_FORMAT_TEXTURE_BACKBUFFER)
|
|
3795
|
+
, "Format %s can't be used for back buffer!"
|
|
3796
|
+
, getName(formatColor)
|
|
3797
|
+
);
|
|
3798
|
+
|
|
3201
3799
|
if (!g_platformDataChangedSinceReset
|
|
3202
3800
|
&& m_init.resolution.formatColor == formatColor
|
|
3203
3801
|
&& m_init.resolution.width == _width
|
|
@@ -4072,14 +4670,15 @@ namespace bgfx
|
|
|
4072
4670
|
|
|
4073
4671
|
IndirectBufferHandle createIndirectBuffer(uint32_t _num)
|
|
4074
4672
|
{
|
|
4673
|
+
BGFX_MUTEX_SCOPE(m_resourceApiLock);
|
|
4075
4674
|
BX_UNUSED(_num);
|
|
4076
4675
|
IndirectBufferHandle handle = { m_vertexBufferHandle.alloc() };
|
|
4077
4676
|
|
|
4078
4677
|
BX_WARN(isValid(handle), "Failed to allocate draw indirect buffer handle.");
|
|
4079
4678
|
if (isValid(handle) )
|
|
4080
4679
|
{
|
|
4081
|
-
uint32_t size = _num * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
|
|
4082
|
-
uint16_t flags = BGFX_BUFFER_DRAW_INDIRECT;
|
|
4680
|
+
const uint32_t size = _num * BGFX_CONFIG_DRAW_INDIRECT_STRIDE;
|
|
4681
|
+
const uint16_t flags = BGFX_BUFFER_DRAW_INDIRECT;
|
|
4083
4682
|
|
|
4084
4683
|
CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateDynamicVertexBuffer);
|
|
4085
4684
|
cmdbuf.write(handle);
|
|
@@ -4092,6 +4691,7 @@ namespace bgfx
|
|
|
4092
4691
|
|
|
4093
4692
|
void destroyIndirectBuffer(IndirectBufferHandle _handle)
|
|
4094
4693
|
{
|
|
4694
|
+
BGFX_MUTEX_SCOPE(m_resourceApiLock);
|
|
4095
4695
|
VertexBufferHandle handle = { _handle.idx };
|
|
4096
4696
|
BGFX_CHECK_HANDLE("destroyDrawIndirectBuffer", m_vertexBufferHandle, handle);
|
|
4097
4697
|
|
|
@@ -4237,9 +4837,10 @@ namespace bgfx
|
|
|
4237
4837
|
}
|
|
4238
4838
|
|
|
4239
4839
|
PredefinedUniform::Enum predefined = nameToPredefinedUniformEnum(name);
|
|
4240
|
-
if (PredefinedUniform::Count == predefined
|
|
4840
|
+
if (PredefinedUniform::Count == predefined
|
|
4841
|
+
&& UniformType::End != UniformType::Enum(type) )
|
|
4241
4842
|
{
|
|
4242
|
-
uniforms[sr.m_num] = createUniform(name, UniformType::Enum(type), num);
|
|
4843
|
+
uniforms[sr.m_num] = createUniform(name, UniformFreq::Count, UniformType::Enum(type), num);
|
|
4243
4844
|
sr.m_num++;
|
|
4244
4845
|
}
|
|
4245
4846
|
}
|
|
@@ -4508,7 +5109,7 @@ namespace bgfx
|
|
|
4508
5109
|
}
|
|
4509
5110
|
}
|
|
4510
5111
|
|
|
4511
|
-
BGFX_API_FUNC(TextureHandle createTexture(const Memory* _mem, uint64_t _flags, uint8_t _skip, TextureInfo* _info, BackbufferRatio::Enum _ratio, bool _immutable) )
|
|
5112
|
+
BGFX_API_FUNC(TextureHandle createTexture(const Memory* _mem, uint64_t _flags, uint8_t _skip, TextureInfo* _info, BackbufferRatio::Enum _ratio, bool _immutable, uint64_t _external) )
|
|
4512
5113
|
{
|
|
4513
5114
|
BGFX_MUTEX_SCOPE(m_resourceApiLock);
|
|
4514
5115
|
|
|
@@ -4586,6 +5187,7 @@ namespace bgfx
|
|
|
4586
5187
|
cmdbuf.write(_mem);
|
|
4587
5188
|
cmdbuf.write(_flags);
|
|
4588
5189
|
cmdbuf.write(_skip);
|
|
5190
|
+
cmdbuf.write(_external);
|
|
4589
5191
|
|
|
4590
5192
|
setDebugNameForHandle(handle);
|
|
4591
5193
|
|
|
@@ -4894,7 +5496,7 @@ namespace bgfx
|
|
|
4894
5496
|
}
|
|
4895
5497
|
}
|
|
4896
5498
|
|
|
4897
|
-
BGFX_API_FUNC(UniformHandle createUniform(const char* _name, UniformType::Enum _type, uint16_t _num) )
|
|
5499
|
+
BGFX_API_FUNC(UniformHandle createUniform(const char* _name, UniformFreq::Enum _freq, UniformType::Enum _type, uint16_t _num) )
|
|
4898
5500
|
{
|
|
4899
5501
|
BGFX_MUTEX_SCOPE(m_resourceApiLock);
|
|
4900
5502
|
|
|
@@ -4921,8 +5523,14 @@ namespace bgfx
|
|
|
4921
5523
|
, uniform.m_type
|
|
4922
5524
|
);
|
|
4923
5525
|
|
|
4924
|
-
uint32_t oldsize = g_uniformTypeSize[uniform.m_type];
|
|
4925
|
-
uint32_t newsize = g_uniformTypeSize[_type];
|
|
5526
|
+
const uint32_t oldsize = g_uniformTypeSize[uniform.m_type];
|
|
5527
|
+
const uint32_t newsize = g_uniformTypeSize[_type];
|
|
5528
|
+
|
|
5529
|
+
if (UniformFreq::Count != _freq)
|
|
5530
|
+
{
|
|
5531
|
+
// Ignore shader created uniforms, and use UniformFreq when user creates uniform.
|
|
5532
|
+
uniform.m_freq = _freq;
|
|
5533
|
+
}
|
|
4926
5534
|
|
|
4927
5535
|
if (oldsize < newsize
|
|
4928
5536
|
|| uniform.m_num < _num)
|
|
@@ -4958,6 +5566,10 @@ namespace bgfx
|
|
|
4958
5566
|
UniformRef& uniform = m_uniformRef[handle.idx];
|
|
4959
5567
|
uniform.m_name.set(_name);
|
|
4960
5568
|
uniform.m_refCount = 1;
|
|
5569
|
+
uniform.m_freq = UniformFreq::Count == _freq
|
|
5570
|
+
? UniformFreq::Draw
|
|
5571
|
+
: _freq
|
|
5572
|
+
;
|
|
4961
5573
|
uniform.m_type = _type;
|
|
4962
5574
|
uniform.m_num = _num;
|
|
4963
5575
|
|
|
@@ -5160,11 +5772,6 @@ namespace bgfx
|
|
|
5160
5772
|
m_view[_id].setTransform(_view, _proj);
|
|
5161
5773
|
}
|
|
5162
5774
|
|
|
5163
|
-
BGFX_API_FUNC(void resetView(ViewId _id) )
|
|
5164
|
-
{
|
|
5165
|
-
m_view[_id].reset();
|
|
5166
|
-
}
|
|
5167
|
-
|
|
5168
5775
|
BGFX_API_FUNC(void setViewOrder(ViewId _id, uint16_t _num, const ViewId* _order) )
|
|
5169
5776
|
{
|
|
5170
5777
|
const uint32_t num = bx::min(_id + _num, BGFX_CONFIG_MAX_VIEWS) - _id;
|
|
@@ -5182,11 +5789,27 @@ namespace bgfx
|
|
|
5182
5789
|
}
|
|
5183
5790
|
}
|
|
5184
5791
|
|
|
5792
|
+
BGFX_API_FUNC(void setViewShadingRate(ViewId _id, ShadingRate::Enum _shadingRate) )
|
|
5793
|
+
{
|
|
5794
|
+
m_view[_id].setShadingRate(_shadingRate);
|
|
5795
|
+
}
|
|
5796
|
+
|
|
5797
|
+
BGFX_API_FUNC(void setViewUniform(ViewId _id, UniformHandle _handle, const void* _value, uint16_t _num) )
|
|
5798
|
+
{
|
|
5799
|
+
m_uniformCache.setViewUniform(_id, _handle, _value, _num);
|
|
5800
|
+
}
|
|
5801
|
+
|
|
5802
|
+
BGFX_API_FUNC(void resetView(ViewId _id) )
|
|
5803
|
+
{
|
|
5804
|
+
m_view[_id].reset();
|
|
5805
|
+
m_uniformCache.invalidate(_id);
|
|
5806
|
+
}
|
|
5807
|
+
|
|
5185
5808
|
BGFX_API_FUNC(Encoder* begin(bool _forThread) );
|
|
5186
5809
|
|
|
5187
5810
|
BGFX_API_FUNC(void end(Encoder* _encoder) );
|
|
5188
5811
|
|
|
5189
|
-
BGFX_API_FUNC(uint32_t frame(
|
|
5812
|
+
BGFX_API_FUNC(uint32_t frame(uint8_t _flags = BGFX_FRAME_NONE) );
|
|
5190
5813
|
|
|
5191
5814
|
uint32_t getSeqIncr(ViewId _id)
|
|
5192
5815
|
{
|
|
@@ -5221,7 +5844,7 @@ namespace bgfx
|
|
|
5221
5844
|
return true;
|
|
5222
5845
|
}
|
|
5223
5846
|
|
|
5224
|
-
BGFX_PROFILER_SCOPE("bgfx/API thread wait",
|
|
5847
|
+
BGFX_PROFILER_SCOPE("bgfx/API thread wait", kColorWait);
|
|
5225
5848
|
int64_t start = bx::getHPCounter();
|
|
5226
5849
|
bool ok = m_apiSem.wait(_msecs);
|
|
5227
5850
|
if (ok)
|
|
@@ -5246,7 +5869,7 @@ namespace bgfx
|
|
|
5246
5869
|
{
|
|
5247
5870
|
if (!m_singleThreaded)
|
|
5248
5871
|
{
|
|
5249
|
-
BGFX_PROFILER_SCOPE("bgfx/Render thread wait",
|
|
5872
|
+
BGFX_PROFILER_SCOPE("bgfx/Render thread wait", kColorWait);
|
|
5250
5873
|
int64_t start = bx::getHPCounter();
|
|
5251
5874
|
bool ok = m_renderSem.wait();
|
|
5252
5875
|
BX_ASSERT(ok, "Semaphore wait failed."); BX_UNUSED(ok);
|
|
@@ -5373,6 +5996,8 @@ namespace bgfx
|
|
|
5373
5996
|
uint32_t m_seq[BGFX_CONFIG_MAX_VIEWS];
|
|
5374
5997
|
View m_view[BGFX_CONFIG_MAX_VIEWS];
|
|
5375
5998
|
|
|
5999
|
+
UniformCache m_uniformCache;
|
|
6000
|
+
|
|
5376
6001
|
float m_clearColor[BGFX_CONFIG_MAX_COLOR_PALETTE][4];
|
|
5377
6002
|
|
|
5378
6003
|
uint8_t m_colorPaletteDirty;
|