Skip to content

Commit

Permalink
Merge branch 'main' into bug/2740
Browse files Browse the repository at this point in the history
  • Loading branch information
louwers authored Aug 26, 2024
2 parents b89ccc0 + 1bdc342 commit 4184634
Show file tree
Hide file tree
Showing 80 changed files with 8,167 additions and 1,759 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# Input hashes for repository rule npm_translate_lock(name = "npm", pnpm_lock = "//:pnpm-lock.yaml").
# This file should be checked into version control along with the pnpm-lock.yaml file.
pnpm-lock.yaml=172204574
package.json=-1427231250
package.json=794269200
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
bazel-bin
bazel-out
bazel-testlogs
node_modules
4 changes: 4 additions & 0 deletions .github/workflows/linux-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,10 @@ jobs:
${{ runner.os }}-bazel-
path: ~/.cache/bazel

- uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'

- name: Start server
run: |
npm install
Expand Down
2 changes: 0 additions & 2 deletions .github/workflows/macos-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,3 @@ jobs:

- name: Generate Xcode project for macOS
run: bazel run //platform/macos:xcodeproj --@rules_xcodeproj//xcodeproj:extra_common_flags="--//:renderer=metal"


27 changes: 18 additions & 9 deletions .github/workflows/node-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,10 @@ jobs:
arch: x86_64
- runs-on: [self-hosted, linux, ARM64]
arch: arm64
# Disabled until Metal backend is complete
# A release for macOS can be made from the opengl-2 branch
# - runs-on: macos-12
# arch: x86_64
# - runs-on: macos-13-xlarge
# arch: arm64
- runs-on: macos-14
arch: arm64
- runs-on: macos-14-large
arch: x86_64
- runs-on: windows-2022
arch: x86_64
continue-on-error: true
Expand Down Expand Up @@ -150,6 +148,7 @@ jobs:
node-version-file: '.nvmrc'

- name: npm ci
working-directory: platform/node
run: npm ci --ignore-scripts

- name: Set up msvc dev cmd (Windows)
Expand Down Expand Up @@ -209,7 +208,12 @@ jobs:
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMLN_WITH_NODE=ON
-DMLN_WITH_NODE=ON \
-DMLN_WITH_OPENGL=OFF \
-DMLN_WITH_METAL=ON \
-DMLN_LEGACY_RENDERER=OFF \
-DMLN_DRAWABLE_RENDERER=ON \
-DMLN_WITH_WERROR=OFF
- name: Configure maplibre-native (Linux)
if: runner.os == 'Linux'
Expand Down Expand Up @@ -261,13 +265,17 @@ jobs:
- name: Run render tests on macOS
if: runner.os == 'macOS'
run: set -o pipefail && ./build/mbgl-render-test-runner --manifestPath metrics/macos-xcode11-release-style.json
# A few are failing
# https://github.com/maplibre/maplibre-native/issues/2741
# Almost all are failing on Intel GitHub runners (but only on CI)
continue-on-error: true
run: ./build/mbgl-render-test-runner --manifestPath metrics/macos-xcode11-release-style.json

- name: Upload render test artifacts (MacOS)
if: runner.os == 'MacOS'
uses: actions/upload-artifact@v4
with:
name: render-query-test-results
name: render-query-test-results_${{ runner.os }}_${{ matrix.arch }}
path: metrics/macos-xcode11-release-style.html

- name: Test (Linux)
Expand All @@ -277,6 +285,7 @@ jobs:

- name: Test (MacOS)
if: runner.os == 'MacOS'
continue-on-error: true # flaky on CI
working-directory: platform/node
run: npm test

Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/node-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,10 @@ jobs:
arch: x86_64
- runs-on: [self-hosted, linux, ARM64]
arch: arm64
# Disabled until Metal backend is complete
# A release for macOS can be made from the opengl-2 branch
# - runs-on: macos-12
# arch: x86_64
# - runs-on: macos-13-xlarge
# arch: arm64
- runs-on: macos-14
arch: arm64
- runs-on: macos-14-large
arch: x86_64
- runs-on: windows-2022
arch: x86_64
continue-on-error: true
Expand Down Expand Up @@ -120,6 +118,7 @@ jobs:
node-version-file: '.nvmrc'

- name: npm ci
working-directory: platform/node
run: npm ci --ignore-scripts

- name: Set up msvc dev cmd (Windows)
Expand Down Expand Up @@ -179,11 +178,15 @@ jobs:
-G Ninja \
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DMLN_WITH_NODE=ON
-DMLN_WITH_NODE=ON \
-DMLN_WITH_OPENGL=OFF \
-DMLN_WITH_METAL=ON \
-DMLN_LEGACY_RENDERER=OFF \
-DMLN_DRAWABLE_RENDERER=ON \
-DMLN_WITH_WERROR=OFF
- name: Configure maplibre-native (Linux)
if: runner.os == 'Linux'
shell: bash -leo pipefail {0}
run: |
cmake . -B build \
-G Ninja \
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20.10
20.14.0
10 changes: 5 additions & 5 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -214,30 +214,30 @@ js_binary(
":style-code",
":style-spec",
],
entry_point = "scripts/generate-style-code.js",
entry_point = "scripts/generate-style-code.mjs",
)

js_binary(
name = "generate-shader-code-script",
data = [
":node_modules/argparse",
],
entry_point = "shaders/generate_shader_code.js",
entry_point = "shaders/generate_shader_code.mjs",
)

js_library(
name = "style-spec",
srcs = ["scripts/style-spec.js"],
srcs = ["scripts/style-spec.mjs"],
data = glob([
"scripts/style-spec-reference/*.js",
"scripts/style-spec-reference/*.mjs",
"scripts/style-spec-reference/*.json",
]),
visibility = ["//visibility:public"],
)

js_library(
name = "style-code",
srcs = ["scripts/style-code.js"],
srcs = ["scripts/style-code.mjs"],
visibility = ["//visibility:public"],
deps = [
":node_modules/ejs",
Expand Down
94 changes: 45 additions & 49 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1166,22 +1166,16 @@ if(MLN_WITH_OPENGL)
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_block_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/uniform_buffer_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/gl/vertex_attribute_gl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/custom_drawable_layer_factory.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.hpp
)
endif()
endif()

if(MBGL_WITH_METAL)
if(MLN_WITH_METAL)
message(STATUS "Configuring Metal renderer backend")
target_compile_definitions(
mbgl-core
PRIVATE
MBGL_RENDER_BACKEND_METAL=1
PRIVATE MLN_RENDER_BACKEND_METAL=1
PUBLIC
"MLN_USE_UNORDERED_DENSE=$<BOOL:${MLN_USE_UNORDERED_DENSE}>"
)
list(APPEND
Expand Down Expand Up @@ -1251,28 +1245,33 @@ if(MBGL_WITH_METAL)
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/vertex_attribute.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/mtl/vertex_buffer_resource.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/shader_program.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/background.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/background_pattern.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/circle.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/collision_box.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/collision_circle.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/clipping_mask.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/custom_symbol_icon.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/debug.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/fill.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/fill_extrusion.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/fill_extrusion_pattern.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/heatmap.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/heatmap_texture.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/hillshade.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/hillshade_prepare.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/line.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/raster.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/symbol_icon.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/symbol_sdf.cpp
${PROJECT_SOURCE_DIR}src/mbgl/shaders/mtl/symbol_text_and_icon.cpp
]
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/background.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/background_pattern.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/circle.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/collision_box.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/collision_circle.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/clipping_mask.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/custom_symbol_icon.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/debug.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/fill.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/fill_extrusion.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/fill_extrusion_pattern.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/heatmap.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/heatmap_texture.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/hillshade.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/hillshade_prepare.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/line.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/raster.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/symbol_icon.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/symbol_sdf.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/symbol_text_and_icon.cpp
)

find_library(METAL_FRAMEWORK Metal)
if (METAL_FRAMEWORK)
target_link_libraries(mbgl-core PRIVATE ${METAL_FRAMEWORK})
endif()

endif()

if(MLN_WITH_VULKAN)
Expand Down Expand Up @@ -1352,16 +1351,17 @@ if(MLN_WITH_VULKAN)
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/raster.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/symbol.cpp
)
endif()

#TODO merge with MLN_DRAWABLE_RENDERER? These are added only for GL path
if(MLN_DRAWABLE_RENDERER)
list(APPEND
SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/custom_drawable_layer_factory.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.hpp
SRC_FILES
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/custom_drawable_layer_factory.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.hpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.cpp
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.hpp
)
endif()

Expand Down Expand Up @@ -1437,18 +1437,10 @@ include(${PROJECT_SOURCE_DIR}/vendor/polylabel.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/protozero.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/tracy.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/unique_resource.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/unordered_dense.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/vector-tile.cmake)
include(${PROJECT_SOURCE_DIR}/vendor/wagyu.cmake)

add_subdirectory(${PROJECT_SOURCE_DIR}/vendor/unordered_dense)
set_target_properties(
unordered_dense
PROPERTIES
INTERFACE_MAPBOX_NAME "unordered_dense"
INTERFACE_MAPBOX_URL "https://github.com/martinus/unordered_dense"
INTERFACE_MAPBOX_AUTHOR "Martin Leitner-Ankerl"
INTERFACE_MAPBOX_LICENSE ${PROJECT_SOURCE_DIR}/vendor/unordered_dense/LICENSE
)
include(${PROJECT_SOURCE_DIR}/vendor/metal-cpp.cmake)

target_link_libraries(
mbgl-core
Expand All @@ -1469,6 +1461,7 @@ target_link_libraries(
mbgl-vendor-unique_resource
mbgl-vendor-vector-tile
mbgl-vendor-wagyu
$<$<BOOL:${MLN_WITH_METAL}>:mbgl-vendor-metal-cpp>
PUBLIC
Mapbox::Base
Mapbox::Base::Extras::expected-lite
Expand Down Expand Up @@ -1507,6 +1500,7 @@ export(TARGETS
mbgl-vendor-unique_resource
mbgl-vendor-vector-tile
mbgl-vendor-wagyu
mbgl-vendor-metal-cpp
unordered_dense

FILE MapboxCoreTargets.cmake
Expand Down Expand Up @@ -1553,6 +1547,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
include(${PROJECT_SOURCE_DIR}/platform/android/android.cmake)
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
include(${PROJECT_SOURCE_DIR}/platform/linux/linux.cmake)
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
include(${PROJECT_SOURCE_DIR}/platform/macos/macos.cmake)
elseif(WIN32)
include(${PROJECT_SOURCE_DIR}/platform/windows/windows.cmake)
else()
Expand All @@ -1561,4 +1557,4 @@ endif()

add_subdirectory(${PROJECT_SOURCE_DIR}/test)
add_subdirectory(${PROJECT_SOURCE_DIR}/benchmark)
add_subdirectory(${PROJECT_SOURCE_DIR}/render-test)
add_subdirectory(${PROJECT_SOURCE_DIR}/render-test)
13 changes: 10 additions & 3 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,23 +1,30 @@
module(name = "maplibre")

bazel_dep(name = "apple_support", version = "1.16.0", repo_name = "build_bazel_apple_support")
bazel_dep(name = "aspect_rules_js", version = "1.42.3")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "platforms", version = "0.0.10")
bazel_dep(name = "rules_apple", version = "3.7.0", repo_name = "build_bazel_rules_apple")
bazel_dep(name = "rules_swift", version = "2.1.1", repo_name = "build_bazel_rules_swift")
bazel_dep(name = "rules_xcodeproj", version = "2.5.2")
bazel_dep(name = "aspect_rules_js", version = "2.0.0")
bazel_dep(name = "rules_nodejs", version = "6.2.0")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm")
node = use_extension("@rules_nodejs//nodejs:extensions.bzl", "node", dev_dependency = True)
node.toolchain(node_version = "20.14.0")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
data = ["package.json"],
pnpm_lock = "//:pnpm-lock.yaml",
update_pnpm_lock = True,
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

pnpm = use_extension("@aspect_rules_js//npm:extensions.bzl", "pnpm")

# Allows developers to use the matching pnpm version, for example:
# bazel run -- @pnpm --dir /home/runner/work/rules_js/rules_js install
use_repo(pnpm, "pnpm")

provisioning_profile_repository = use_extension("@build_bazel_rules_apple//apple:apple.bzl", "provisioning_profile_repository_extension")
Expand Down
6 changes: 2 additions & 4 deletions include/mbgl/actor/established_actor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ template <class Object>
class EstablishedActor {
public:
// Construct the Object from a parameter pack `args` (i.e. `Object(args...)`)
template <typename U = Object,
class... Args,
typename std::enable_if_t<std::is_constructible_v<U, Args...> ||
std::is_constructible_v<U, ActorRef<U>, Args...>>* = nullptr>
template <typename U = Object, class... Args>
EstablishedActor(Scheduler& scheduler, AspiringActor<Object>& parent_, Args&&... args)
requires(std::is_constructible_v<U, Args...> || std::is_constructible_v<U, ActorRef<U>, Args...>)
: parent(parent_) {
emplaceObject(std::forward<Args>(args)...);
parent.mailbox->open(scheduler);
Expand Down
Loading

0 comments on commit 4184634

Please sign in to comment.