Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/jobs/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ jobs:

- script: |
sudo apt-get update
sudo apt-get install libjavascriptcoregtk-4.0-dev libgl1-mesa-dev libcurl4-openssl-dev libwayland-dev
sudo apt-get install libjavascriptcoregtk-4.1-dev libgl1-mesa-dev libcurl4-openssl-dev libwayland-dev
displayName: 'Install packages'

- script: |
cmake -G Ninja -B build -D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.0.so -D NAPI_JAVASCRIPT_ENGINE=${{ parameters.JSEngine }} -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BX_CONFIG_DEBUG=ON -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D OpenGL_GL_PREFERENCE=GLVND -D BABYLON_DEBUG_TRACE=ON
cmake -G Ninja -B build -D JAVASCRIPTCORE_LIBRARY=/usr/lib/x86_64-linux-gnu/libjavascriptcoregtk-4.1.so -D NAPI_JAVASCRIPT_ENGINE=${{ parameters.JSEngine }} -D CMAKE_BUILD_TYPE=RelWithDebInfo -D BX_CONFIG_DEBUG=ON -D CMAKE_UNITY_BUILD=$(UNITY_BUILD) -D OpenGL_GL_PREFERENCE=GLVND -D BABYLON_DEBUG_TRACE=ON
ninja -C build
displayName: 'Build X11'

Expand Down
55 changes: 25 additions & 30 deletions Apps/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Apps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"getNightly": "node scripts/getNightly.js"
},
"dependencies": {
"babylonjs": "^8.0.0",
"babylonjs-gltf2interface": "^8.0.0",
"babylonjs-gui": "^8.0.0",
"babylonjs-loaders": "^8.0.0",
"babylonjs-materials": "^8.0.0",
"babylonjs": "^8.3.1",
"babylonjs-gltf2interface": "^8.3.1",
"babylonjs-gui": "^8.3.1",
"babylonjs-loaders": "^8.3.1",
"babylonjs-materials": "^8.3.1",
"chai": "^4.3.4",
"jsc-android": "^241213.1.0",
"mocha": "^9.2.2",
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ FetchContent_Declare(ios-cmake
GIT_TAG 4.5.0)
FetchContent_Declare(JsRuntimeHost
GIT_REPOSITORY https://github.com/BabylonJS/JsRuntimeHost.git
GIT_TAG 27f17e531c6521b9210cfa651b43251a7c860ac6)
GIT_TAG c64c8a8cfc95b187e9547b165f02633909568c22)
FetchContent_Declare(OpenXR-MixedReality
GIT_REPOSITORY https://github.com/microsoft/OpenXR-MixedReality.git
GIT_TAG 67424511525b96a36847f2a96d689d99e5879503)
Expand Down
4 changes: 2 additions & 2 deletions Plugins/NativeCamera/Source/MediaDevices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace Babylon::Plugins::Internal
deferred.Resolve(result.value());
});

return std::move(promise);
return promise;
}

static Napi::Value EnumerateDevices(const Napi::CallbackInfo& info)
Expand All @@ -76,7 +76,7 @@ namespace Babylon::Plugins::Internal

deferred.Resolve(devices);

return std::move(promise);
return promise;
}
};
}
Expand Down
6 changes: 3 additions & 3 deletions Plugins/NativeCamera/Source/MediaStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ namespace Babylon::Plugins
// ObjectWrap fullfills the MediaStream and MediaStreamTrack interfaces
auto tracks = Napi::Array::New(info.Env(), 1);
tracks.Set(uint32_t{0}, info.This());
return std::move(tracks);
return tracks;
}

Napi::Value MediaStream::GetAudioTracks(const Napi::CallbackInfo& info)
Expand Down Expand Up @@ -149,7 +149,7 @@ namespace Babylon::Plugins
capability->AddAsCapability(capabilities);
}

return std::move(capabilities);
return capabilities;
}

Napi::Value MediaStream::GetSettings(const Napi::CallbackInfo& info)
Expand All @@ -169,7 +169,7 @@ namespace Babylon::Plugins
capability->AddAsSetting(settings);
}

return std::move(settings);
return settings;
}

Napi::Value MediaStream::GetConstraints(const Napi::CallbackInfo& info)
Expand Down
30 changes: 11 additions & 19 deletions Plugins/NativeEngine/Source/NativeEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ namespace Babylon
JS_CLASS_NAME,
{
// This must match the version in nativeEngine.ts
StaticValue("PROTOCOL_VERSION", Napi::Number::From(env, 8)),
StaticValue("PROTOCOL_VERSION", Napi::Number::From(env, 9)),

StaticValue("CAPS_LIMITS_MAX_TEXTURE_SIZE", Napi::Number::From(env, limits.maxTextureSize)),
StaticValue("CAPS_LIMITS_MAX_TEXTURE_LAYERS", Napi::Number::From(env, limits.maxTextureLayers)),
Expand Down Expand Up @@ -653,6 +653,7 @@ namespace Babylon
StaticValue("COMMAND_SETSTENCIL", Napi::FunctionPointer::Create(env, &NativeEngine::SetStencil)),
StaticValue("COMMAND_SETVIEWPORT", Napi::FunctionPointer::Create(env, &NativeEngine::SetViewPort)),
StaticValue("COMMAND_SETSCISSOR", Napi::FunctionPointer::Create(env, &NativeEngine::SetScissor)),
StaticValue("COMMAND_COPYTEXTURE", Napi::FunctionPointer::Create(env, &NativeEngine::CopyTexture)),

InstanceMethod("dispose", &NativeEngine::Dispose),

Expand Down Expand Up @@ -682,7 +683,6 @@ namespace Babylon
InstanceMethod("loadCubeTextureWithMips", &NativeEngine::LoadCubeTextureWithMips),
InstanceMethod("getTextureWidth", &NativeEngine::GetTextureWidth),
InstanceMethod("getTextureHeight", &NativeEngine::GetTextureHeight),
InstanceMethod("copyTexture", &NativeEngine::CopyTexture),
InstanceMethod("deleteTexture", &NativeEngine::DeleteTexture),
InstanceMethod("readTexture", &NativeEngine::ReadTexture),

Expand Down Expand Up @@ -1103,7 +1103,7 @@ namespace Babylon
uniforms[index] = info.Env().Null();
}

return std::move(uniforms);
return uniforms;
}

Napi::Value NativeEngine::GetAttributes(const Napi::CallbackInfo& info)
Expand All @@ -1123,7 +1123,7 @@ namespace Babylon
attributes[index] = Napi::Value::From(info.Env(), location);
}

return std::move(attributes);
return attributes;
}

void NativeEngine::SetProgram(NativeDataStream::Reader& data)
Expand Down Expand Up @@ -1427,22 +1427,14 @@ namespace Babylon
});
}

void NativeEngine::CopyTexture(const Napi::CallbackInfo& info)
void NativeEngine::CopyTexture(NativeDataStream::Reader& data)
{
const auto textureDestination = info[0].As<Napi::Pointer<Graphics::Texture>>().Get();
const auto textureSource = info[1].As<Napi::Pointer<Graphics::Texture>>().Get();
bgfx::Encoder* encoder = GetUpdateToken().GetEncoder();

arcana::make_task(m_update.Scheduler(), *m_cancellationSource, [this, textureDestination, textureSource, cancellationSource = m_cancellationSource]() {
return arcana::make_task(m_runtimeScheduler, *m_cancellationSource, [this, textureDestination, textureSource, updateToken = m_update.GetUpdateToken(), cancellationSource = m_cancellationSource]() {
bgfx::Encoder* encoder = m_update.GetUpdateToken().GetEncoder();
GetBoundFrameBuffer(*encoder).Blit(*encoder, textureDestination->Handle(), 0, 0, textureSource->Handle());
}).then(arcana::inline_scheduler, *m_cancellationSource, [this, cancellationSource{m_cancellationSource}](const arcana::expected<void, std::exception_ptr>& result) {
if (!cancellationSource->cancelled() && result.has_error())
{
Napi::Error::New(Env(), result.error()).ThrowAsJavaScriptException();
}
});
});
const auto textureSource = data.ReadPointer<Graphics::Texture>();
const auto textureDestination = data.ReadPointer<Graphics::Texture>();

GetBoundFrameBuffer(*encoder).Blit(*encoder, textureDestination->Handle(), 0, 0, textureSource->Handle());
}

void NativeEngine::LoadRawTexture(const Napi::CallbackInfo& info)
Expand Down Expand Up @@ -2111,7 +2103,7 @@ namespace Babylon
bimg::imageFree(image);
}

return std::move(imageBitmap);
return imageBitmap;
}

Napi::Value NativeEngine::ResizeImageBitmap(const Napi::CallbackInfo& info)
Expand Down
2 changes: 1 addition & 1 deletion Plugins/NativeEngine/Source/NativeEngine.h
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ namespace Babylon
Napi::Value CreateTexture(const Napi::CallbackInfo& info);
void InitializeTexture(const Napi::CallbackInfo& info);
void LoadTexture(const Napi::CallbackInfo& info);
void CopyTexture(const Napi::CallbackInfo& info);
void CopyTexture(NativeDataStream::Reader& data);
void LoadRawTexture(const Napi::CallbackInfo& info);
void LoadRawTexture2DArray(const Napi::CallbackInfo& info);
void LoadCubeTexture(const Napi::CallbackInfo& info);
Expand Down
8 changes: 4 additions & 4 deletions Plugins/NativeXr/Source/XRFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ namespace Babylon
results[i++] = currentResult;
}

return std::move(results);
return results;
}

Napi::Value XRFrame::CreateAnchor(const Napi::CallbackInfo& info)
Expand All @@ -295,7 +295,7 @@ namespace Babylon
anchorSet.Get("add").As<Napi::Function>().Call(anchorSet, { napiAnchorRef.Value() });
}

return std::move(anchorSet);
return anchorSet;
}

void XRFrame::UpdateAnchors()
Expand Down Expand Up @@ -349,7 +349,7 @@ namespace Babylon
worldInformationObj.Set("detectedMeshes", m_meshSet.Value());
}

return std::move(worldInformationObj);
return worldInformationObj;
}

Napi::Value XRFrame::GetFeaturePointCloud(const Napi::CallbackInfo& info)
Expand All @@ -368,7 +368,7 @@ namespace Babylon
featurePointArray.Set(pointIndex + 4, Napi::Value::From(info.Env(), featurePoint.ID));
}

return std::move(featurePointArray);
return featurePointArray;
}

void XRFrame::UpdateSceneObjects(const Napi::Env& env)
Expand Down
2 changes: 1 addition & 1 deletion Plugins/NativeXr/Source/XRHitTestResult.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace Babylon
XRPose* pose = XRPose::Unwrap(napiPose);
pose->Update(info, m_hitResult.Pose);

return std::move(napiPose);
return napiPose;
}

Napi::Value CreateAnchor(const Napi::CallbackInfo& info)
Expand Down
2 changes: 1 addition & 1 deletion Plugins/NativeXr/Source/XRPlane.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ namespace Babylon
polygonArray.Set((int)i, polygonPoint);
}

return std::move(polygonArray);
return polygonArray;
}

Napi::Value GetLastChangedTime(const Napi::CallbackInfo& info)
Expand Down
2 changes: 1 addition & 1 deletion Plugins/NativeXr/Source/XRSession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ namespace Babylon
results.Set(index++, Napi::Value::From(info.Env(), scoreString));
}

return std::move(results);
return results;
}
} // Plugins
} // Babylon
12 changes: 9 additions & 3 deletions Polyfills/Canvas/Source/Canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,17 @@ namespace Babylon::Polyfills::Internal

Napi::Value NativeCanvas::GetContext(const Napi::CallbackInfo& info)
{
if (m_contextObject.IsEmpty())
auto thisObj = info.This().ToObject();
const auto contextPropertyName = Napi::Value::From(Env(), "_context");

auto context = thisObj.Get(contextPropertyName);
if (context.IsUndefined())
{
m_contextObject = Napi::Persistent(Context::CreateInstance(info.Env(), info.This()).As<Napi::Object>());
context = Context::CreateInstance(info.Env(), info.This());
thisObj.Set(contextPropertyName, context);
}
return m_contextObject.Value();

return context;
}

Napi::Value NativeCanvas::GetWidth(const Napi::CallbackInfo&)
Expand Down
1 change: 0 additions & 1 deletion Polyfills/Canvas/Source/Canvas.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ namespace Babylon::Polyfills::Internal

static inline std::map<std::string, std::vector<uint8_t>> fontsInfos;

// returns true if frameBuffer size has changed
bool UpdateRenderTarget();
Babylon::Graphics::FrameBuffer& GetFrameBuffer() { return *m_frameBuffer; }
FrameBufferPool m_frameBufferPool;
Expand Down
Loading