Skip to content

Commit ca1663f

Browse files
authoredJul 20, 2023
Update BN submodule (#589)
* Update BN submodule * BN #883ba13 * a676d6df117cb6cdebc5c347b8aa37f2fed852fb * cmake + brn up * cmake update * removed comment * comment * GraphicsDevice * graphics init * android rn 0.71 * back to 0.64
1 parent aafbad8 commit ca1663f

File tree

9 files changed

+34
-34
lines changed

9 files changed

+34
-34
lines changed
 

‎.github/workflows/bn_master_commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ jobs:
2323
- name: Setup CMake
2424
uses: jwlawson/actions-setup-cmake@v1.8
2525
with:
26-
cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021
26+
cmake-version: '3.26.3'
2727
- name: Setup Ninja
2828
run: brew install ninja
2929
- name: NPM Install (Playground)

‎.github/workflows/ios_android.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
- name: Setup CMake
2929
uses: jwlawson/actions-setup-cmake@v1.8
3030
with:
31-
cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021
31+
cmake-version: '3.26.3'
3232
- name: Setup Ninja
3333
run: brew install ninja
3434
- name: 'Select XCode ${{ inputs.xcode-version }}'

‎.github/workflows/pr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
- name: Setup CMake
2222
uses: jwlawson/actions-setup-cmake@v1.8
2323
with:
24-
cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021
24+
cmake-version: '3.26.3'
2525
- name: Setup Ninja
2626
run: brew install ninja
2727
- name: NPM Install (Playground)
@@ -77,7 +77,7 @@ jobs:
7777
- name: Setup CMake
7878
uses: jwlawson/actions-setup-cmake@v1.8
7979
with:
80-
cmake-version: '3.19.6' # See https://gitlab.kitware.com/cmake/cmake/-/issues/22021
80+
cmake-version: '3.26.3'
8181
- name: Setup Ninja
8282
run: brew install ninja
8383
- name: NPM Install (Playground)

‎Modules/@babylonjs/react-native-iosandroid/android/CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ if (EXISTS "${TURBOMODULE_DIR}/CMakeLists.txt")
134134
turbomodulejsijni # prefab ready
135135
yoga # prefab ready
136136
AndroidExtensions
137-
Graphics
137+
GraphicsDevice
138138
JsRuntime
139139
NativeCamera
140140
NativeCapture
@@ -196,7 +196,7 @@ else()
196196
jsi
197197
turbomodulejsijni
198198
AndroidExtensions
199-
Graphics
199+
GraphicsDevice
200200
JsRuntime
201201
NativeCamera
202202
NativeCapture

‎Modules/@babylonjs/react-native-iosandroid/android/build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ android {
109109
}
110110
externalNativeBuild {
111111
cmake {
112-
version '3.19.6'
112+
version '3.19.6+'
113113
path 'CMakeLists.txt'
114114
}
115115
}

‎Modules/@babylonjs/react-native-iosandroid/ios/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ target_include_directories(BabylonNative PUBLIC ${CMAKE_CURRENT_LIST_DIR})
4242
target_link_libraries(BabylonNative
4343
z
4444
arcana
45-
Graphics
45+
GraphicsDevice
4646
jsi
4747
reactnative
4848
JsRuntime

‎Modules/@babylonjs/react-native-windows/windows/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ target_include_directories(BabylonNative PRIVATE ${SHARED_INCLUDES})
3030

3131
target_link_libraries(BabylonNative
3232
arcana
33-
Graphics
33+
GraphicsDevice
3434
jsi
3535
JsRuntime
3636
NativeCamera

‎Modules/@babylonjs/react-native/shared/BabylonNative.cpp

+24-24
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ namespace BabylonNative
2323
namespace
2424
{
2525
Dispatcher g_inlineDispatcher{ [](const std::function<void()>& func) { func(); } };
26-
std::unique_ptr<Babylon::Graphics::Device> g_graphics{};
27-
std::unique_ptr<Babylon::Graphics::DeviceUpdate> g_update{};
26+
std::optional<Babylon::Graphics::Device> g_graphicsDevice{};
27+
std::optional<Babylon::Graphics::DeviceUpdate> g_update{};
2828
std::unique_ptr<Babylon::Polyfills::Canvas> g_nativeCanvas{};
2929
}
3030

@@ -75,34 +75,34 @@ namespace BabylonNative
7575

7676
void UpdateView(WindowType window, size_t width, size_t height)
7777
{
78-
m_windowConfig.Window = window;
79-
m_windowConfig.Width = width;
80-
m_windowConfig.Height = height;
78+
m_graphicsConfig.Window = window;
79+
m_graphicsConfig.Width = width;
80+
m_graphicsConfig.Height = height;
8181
UpdateGraphicsConfiguration();
8282
}
8383

8484
void UpdateGraphicsConfiguration()
8585
{
86-
if (!g_graphics)
86+
if (!g_graphicsDevice)
8787
{
88-
g_graphics = Babylon::Graphics::Device::Create(m_windowConfig);
89-
g_update = std::make_unique<Babylon::Graphics::DeviceUpdate>(g_graphics->GetUpdate("update"));
88+
g_graphicsDevice.emplace(m_graphicsConfig);
89+
g_update.emplace(g_graphicsDevice->GetUpdate("update"));
9090
}
9191
else
9292
{
93-
g_graphics->UpdateWindow(m_windowConfig);
94-
g_graphics->UpdateSize(m_windowConfig.Width, m_windowConfig.Height);
93+
g_graphicsDevice->UpdateWindow(m_graphicsConfig.Window);
94+
g_graphicsDevice->UpdateSize(m_graphicsConfig.Width, m_graphicsConfig.Height);
9595
}
96-
g_graphics->UpdateMSAA(mMSAAValue);
97-
g_graphics->UpdateAlphaPremultiplied(mAlphaPremultiplied);
96+
g_graphicsDevice->UpdateMSAA(mMSAAValue);
97+
g_graphicsDevice->UpdateAlphaPremultiplied(mAlphaPremultiplied);
9898

99-
g_graphics->EnableRendering();
99+
g_graphicsDevice->EnableRendering();
100100

101101
std::call_once(m_isGraphicsInitialized, [this]()
102102
{
103103
m_jsDispatcher([this]()
104104
{
105-
g_graphics->AddToJavaScript(m_env);
105+
g_graphicsDevice->AddToJavaScript(m_env);
106106
Babylon::Plugins::NativeEngine::Initialize(m_env);
107107
});
108108
});
@@ -121,18 +121,18 @@ namespace BabylonNative
121121
void UpdateMSAA(uint8_t value)
122122
{
123123
mMSAAValue = value;
124-
if (g_graphics)
124+
if (g_graphicsDevice)
125125
{
126-
g_graphics->UpdateMSAA(value);
126+
g_graphicsDevice->UpdateMSAA(value);
127127
}
128128
}
129129

130130
void UpdateAlphaPremultiplied(bool enabled)
131131
{
132132
mAlphaPremultiplied = enabled;
133-
if (g_graphics)
133+
if (g_graphicsDevice)
134134
{
135-
g_graphics->UpdateAlphaPremultiplied(enabled);
135+
g_graphicsDevice->UpdateAlphaPremultiplied(enabled);
136136
}
137137
}
138138

@@ -144,12 +144,12 @@ namespace BabylonNative
144144
}
145145
// If rendering has not been explicitly enabled, or has been explicitly disabled, then don't try to render.
146146
// Otherwise rendering can be implicitly enabled, which may not be desirable (e.g. after the engine is disposed).
147-
if (g_graphics && m_isRenderingEnabled)
147+
if (g_graphicsDevice && m_isRenderingEnabled)
148148
{
149-
g_graphics->StartRenderingCurrentFrame();
149+
g_graphicsDevice->StartRenderingCurrentFrame();
150150
g_update->Start();
151151
g_update->Finish();
152-
g_graphics->FinishRenderingCurrentFrame();
152+
g_graphicsDevice->FinishRenderingCurrentFrame();
153153
}
154154
}
155155

@@ -160,10 +160,10 @@ namespace BabylonNative
160160

161161
void ResetView()
162162
{
163-
if (g_graphics)
163+
if (g_graphicsDevice)
164164
{
165165
g_nativeCanvas->FlushGraphicResources();
166-
g_graphics->DisableRendering();
166+
g_graphicsDevice->DisableRendering();
167167
}
168168

169169
m_isRenderingEnabled = false;
@@ -264,7 +264,7 @@ namespace BabylonNative
264264
Babylon::Plugins::NativeInput* m_nativeInput{};
265265
std::optional<Babylon::Plugins::NativeXr> m_nativeXr{};
266266

267-
Babylon::Graphics::WindowConfiguration m_windowConfig{};
267+
Babylon::Graphics::Configuration m_graphicsConfig{};
268268

269269
std::shared_ptr<bool> m_isXRActive{};
270270
uint8_t mMSAAValue{};

0 commit comments

Comments
 (0)
Please sign in to comment.