From 20ba90e815e37b0044cea2bb281dd93f127be39c Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 10:56:39 +0200 Subject: [PATCH 01/11] Update BN submodule --- .../@babylonjs/react-native-iosandroid/submodules/BabylonNative | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative index 409bc4b31..c89031ec5 160000 --- a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative +++ b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative @@ -1 +1 @@ -Subproject commit 409bc4b3178a5140462c618293e5ff984dfe5bd5 +Subproject commit c89031ec58bca5faffa92d3498230c5484175e57 From 7025d28e57fd58b3298f1949307e4f7e7dc9fbf5 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:51:39 +0200 Subject: [PATCH 02/11] BN #883ba13 --- .../@babylonjs/react-native-iosandroid/submodules/BabylonNative | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative index c89031ec5..883ba139d 160000 --- a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative +++ b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative @@ -1 +1 @@ -Subproject commit c89031ec58bca5faffa92d3498230c5484175e57 +Subproject commit 883ba139dc21ba7b99d4827e8d7db26fb4a10551 From 379ba6f7148f62aee55bc2326990a3ad2b7669f7 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 12:01:26 +0200 Subject: [PATCH 03/11] a676d6df117cb6cdebc5c347b8aa37f2fed852fb --- .../@babylonjs/react-native-iosandroid/submodules/BabylonNative | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative index 883ba139d..a676d6df1 160000 --- a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative +++ b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative @@ -1 +1 @@ -Subproject commit 883ba139dc21ba7b99d4827e8d7db26fb4a10551 +Subproject commit a676d6df117cb6cdebc5c347b8aa37f2fed852fb From a0481d9184144422fe4e4bd92969d4e9bb124498 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 14:55:11 +0200 Subject: [PATCH 04/11] cmake + brn up --- .github/workflows/bn_master_commit.yml | 4 ++-- .github/workflows/pr.yml | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bn_master_commit.yml b/.github/workflows/bn_master_commit.yml index 85b2f9cf3..1e4c6f894 100644 --- a/.github/workflows/bn_master_commit.yml +++ b/.github/workflows/bn_master_commit.yml @@ -5,7 +5,7 @@ on: types: [babylonnative-master-update] env: - BRN_Version: 0.64 + BRN_Version: 0.70 jobs: build-android: @@ -23,7 +23,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' - name: Setup Ninja run: brew install ninja - name: NPM Install (Playground) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index eb34d5003..5f34631eb 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,7 +4,7 @@ on: branches: - master env: - BRN_Version: '0.64' + BRN_Version: '0.70' jobs: build-android: @@ -21,7 +21,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 - name: Setup Ninja run: brew install ninja - name: NPM Install (Playground) @@ -77,7 +77,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 - name: Setup Ninja run: brew install ninja - name: NPM Install (Playground) From 8d4309a7e6e8b6004184f01fb39b83b5d7feb5a4 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:28:15 +0200 Subject: [PATCH 05/11] cmake update --- .github/workflows/ios_android.yml | 2 +- Modules/@babylonjs/react-native-iosandroid/android/build.gradle | 2 +- .../@babylonjs/react-native-iosandroid/submodules/BabylonNative | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ios_android.yml b/.github/workflows/ios_android.yml index 12d6316cc..0913d1497 100644 --- a/.github/workflows/ios_android.yml +++ b/.github/workflows/ios_android.yml @@ -28,7 +28,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 - name: Setup Ninja run: brew install ninja - name: 'Select XCode ${{ inputs.xcode-version }}' diff --git a/Modules/@babylonjs/react-native-iosandroid/android/build.gradle b/Modules/@babylonjs/react-native-iosandroid/android/build.gradle index e7dfd3fd0..c64e1ec91 100644 --- a/Modules/@babylonjs/react-native-iosandroid/android/build.gradle +++ b/Modules/@babylonjs/react-native-iosandroid/android/build.gradle @@ -109,7 +109,7 @@ android { } externalNativeBuild { cmake { - version '3.19.6' + version '3.19.6+' path 'CMakeLists.txt' } } diff --git a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative index a676d6df1..c89031ec5 160000 --- a/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative +++ b/Modules/@babylonjs/react-native-iosandroid/submodules/BabylonNative @@ -1 +1 @@ -Subproject commit a676d6df117cb6cdebc5c347b8aa37f2fed852fb +Subproject commit c89031ec58bca5faffa92d3498230c5484175e57 From 9a261beac3801e75a0e34605e4085fcfd6ac8c97 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:41:15 +0200 Subject: [PATCH 06/11] removed comment --- .github/workflows/pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5f34631eb..5692ef8f0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,7 +21,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.26.3' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' - name: Setup Ninja run: brew install ninja - name: NPM Install (Playground) @@ -77,7 +77,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.26.3' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' - name: Setup Ninja run: brew install ninja - name: NPM Install (Playground) From 662d4017c0984231bcb36b504f8c29615a699883 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Tue, 18 Jul 2023 15:42:09 +0200 Subject: [PATCH 07/11] comment --- .github/workflows/ios_android.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ios_android.yml b/.github/workflows/ios_android.yml index 0913d1497..f501f8e61 100644 --- a/.github/workflows/ios_android.yml +++ b/.github/workflows/ios_android.yml @@ -28,7 +28,7 @@ jobs: - name: Setup CMake uses: jwlawson/actions-setup-cmake@v1.8 with: - cmake-version: '3.26.3' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021 + cmake-version: '3.26.3' - name: Setup Ninja run: brew install ninja - name: 'Select XCode ${{ inputs.xcode-version }}' From 4bdf86be1576669da49faed109cfcf10ec43de62 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:18:55 +0200 Subject: [PATCH 08/11] GraphicsDevice --- .../@babylonjs/react-native-iosandroid/android/CMakeLists.txt | 2 +- Modules/@babylonjs/react-native-iosandroid/ios/CMakeLists.txt | 2 +- Modules/@babylonjs/react-native-windows/windows/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt b/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt index 99bd84ed3..69e6fa17d 100644 --- a/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt +++ b/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt @@ -196,7 +196,7 @@ else() jsi turbomodulejsijni AndroidExtensions - Graphics + GraphicsDevice JsRuntime NativeCamera NativeCapture diff --git a/Modules/@babylonjs/react-native-iosandroid/ios/CMakeLists.txt b/Modules/@babylonjs/react-native-iosandroid/ios/CMakeLists.txt index fadbf2538..23ff53114 100644 --- a/Modules/@babylonjs/react-native-iosandroid/ios/CMakeLists.txt +++ b/Modules/@babylonjs/react-native-iosandroid/ios/CMakeLists.txt @@ -42,7 +42,7 @@ target_include_directories(BabylonNative PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_link_libraries(BabylonNative z arcana - Graphics + GraphicsDevice jsi reactnative JsRuntime diff --git a/Modules/@babylonjs/react-native-windows/windows/CMakeLists.txt b/Modules/@babylonjs/react-native-windows/windows/CMakeLists.txt index a23b717ff..7dcada09c 100644 --- a/Modules/@babylonjs/react-native-windows/windows/CMakeLists.txt +++ b/Modules/@babylonjs/react-native-windows/windows/CMakeLists.txt @@ -30,7 +30,7 @@ target_include_directories(BabylonNative PRIVATE ${SHARED_INCLUDES}) target_link_libraries(BabylonNative arcana - Graphics + GraphicsDevice jsi JsRuntime NativeCamera From 383d47c73898c29dfcfe4773d1a55df07fafe4eb Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Wed, 19 Jul 2023 11:33:22 +0200 Subject: [PATCH 09/11] graphics init --- .../react-native/shared/BabylonNative.cpp | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Modules/@babylonjs/react-native/shared/BabylonNative.cpp b/Modules/@babylonjs/react-native/shared/BabylonNative.cpp index a42f83bee..f1042c3b0 100644 --- a/Modules/@babylonjs/react-native/shared/BabylonNative.cpp +++ b/Modules/@babylonjs/react-native/shared/BabylonNative.cpp @@ -23,8 +23,8 @@ namespace BabylonNative namespace { Dispatcher g_inlineDispatcher{ [](const std::function& func) { func(); } }; - std::unique_ptr g_graphics{}; - std::unique_ptr g_update{}; + std::optional g_graphicsDevice{}; + std::optional g_update{}; std::unique_ptr g_nativeCanvas{}; } @@ -75,34 +75,34 @@ namespace BabylonNative void UpdateView(WindowType window, size_t width, size_t height) { - m_windowConfig.Window = window; - m_windowConfig.Width = width; - m_windowConfig.Height = height; + m_graphicsConfig.Window = window; + m_graphicsConfig.Width = width; + m_graphicsConfig.Height = height; UpdateGraphicsConfiguration(); } void UpdateGraphicsConfiguration() { - if (!g_graphics) + if (!g_graphicsDevice) { - g_graphics = Babylon::Graphics::Device::Create(m_windowConfig); - g_update = std::make_unique(g_graphics->GetUpdate("update")); + g_graphicsDevice.emplace(m_graphicsConfig); + g_update.emplace(g_graphicsDevice->GetUpdate("update")); } else { - g_graphics->UpdateWindow(m_windowConfig); - g_graphics->UpdateSize(m_windowConfig.Width, m_windowConfig.Height); + g_graphicsDevice->UpdateWindow(m_graphicsConfig.Window); + g_graphicsDevice->UpdateSize(m_graphicsConfig.Width, m_graphicsConfig.Height); } - g_graphics->UpdateMSAA(mMSAAValue); - g_graphics->UpdateAlphaPremultiplied(mAlphaPremultiplied); + g_graphicsDevice->UpdateMSAA(mMSAAValue); + g_graphicsDevice->UpdateAlphaPremultiplied(mAlphaPremultiplied); - g_graphics->EnableRendering(); + g_graphicsDevice->EnableRendering(); std::call_once(m_isGraphicsInitialized, [this]() { m_jsDispatcher([this]() { - g_graphics->AddToJavaScript(m_env); + g_graphicsDevice->AddToJavaScript(m_env); Babylon::Plugins::NativeEngine::Initialize(m_env); }); }); @@ -121,18 +121,18 @@ namespace BabylonNative void UpdateMSAA(uint8_t value) { mMSAAValue = value; - if (g_graphics) + if (g_graphicsDevice) { - g_graphics->UpdateMSAA(value); + g_graphicsDevice->UpdateMSAA(value); } } void UpdateAlphaPremultiplied(bool enabled) { mAlphaPremultiplied = enabled; - if (g_graphics) + if (g_graphicsDevice) { - g_graphics->UpdateAlphaPremultiplied(enabled); + g_graphicsDevice->UpdateAlphaPremultiplied(enabled); } } @@ -144,12 +144,12 @@ namespace BabylonNative } // If rendering has not been explicitly enabled, or has been explicitly disabled, then don't try to render. // Otherwise rendering can be implicitly enabled, which may not be desirable (e.g. after the engine is disposed). - if (g_graphics && m_isRenderingEnabled) + if (g_graphicsDevice && m_isRenderingEnabled) { - g_graphics->StartRenderingCurrentFrame(); + g_graphicsDevice->StartRenderingCurrentFrame(); g_update->Start(); g_update->Finish(); - g_graphics->FinishRenderingCurrentFrame(); + g_graphicsDevice->FinishRenderingCurrentFrame(); } } @@ -160,10 +160,10 @@ namespace BabylonNative void ResetView() { - if (g_graphics) + if (g_graphicsDevice) { g_nativeCanvas->FlushGraphicResources(); - g_graphics->DisableRendering(); + g_graphicsDevice->DisableRendering(); } m_isRenderingEnabled = false; @@ -264,7 +264,7 @@ namespace BabylonNative Babylon::Plugins::NativeInput* m_nativeInput{}; std::optional m_nativeXr{}; - Babylon::Graphics::WindowConfiguration m_windowConfig{}; + Babylon::Graphics::Configuration m_graphicsConfig{}; std::shared_ptr m_isXRActive{}; uint8_t mMSAAValue{}; From f577760276f9738dd3460edb92a92564b443ce1f Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Wed, 19 Jul 2023 13:24:49 +0200 Subject: [PATCH 10/11] android rn 0.71 --- .../@babylonjs/react-native-iosandroid/android/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt b/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt index 69e6fa17d..1396477f9 100644 --- a/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt +++ b/Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt @@ -134,7 +134,7 @@ if (EXISTS "${TURBOMODULE_DIR}/CMakeLists.txt") turbomodulejsijni # prefab ready yoga # prefab ready AndroidExtensions - Graphics + GraphicsDevice JsRuntime NativeCamera NativeCapture From 095b4e9528e569bdc97ced2c68b16ec6c1058ff9 Mon Sep 17 00:00:00 2001 From: Cedric Guillemet <1312968+CedricGuillemet@users.noreply.github.com> Date: Wed, 19 Jul 2023 14:04:26 +0200 Subject: [PATCH 11/11] back to 0.64 --- .github/workflows/bn_master_commit.yml | 2 +- .github/workflows/pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bn_master_commit.yml b/.github/workflows/bn_master_commit.yml index 1e4c6f894..beaf3270c 100644 --- a/.github/workflows/bn_master_commit.yml +++ b/.github/workflows/bn_master_commit.yml @@ -5,7 +5,7 @@ on: types: [babylonnative-master-update] env: - BRN_Version: 0.70 + BRN_Version: 0.64 jobs: build-android: diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 5692ef8f0..0d762adbd 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -4,7 +4,7 @@ on: branches: - master env: - BRN_Version: '0.70' + BRN_Version: '0.64' jobs: build-android: