Skip to content

Commit b3292c3

Browse files
committed
Merge branch 'main' into rust-wrapper
2 parents 813ee06 + 691384b commit b3292c3

File tree

130 files changed

+4646
-1418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+4646
-1418
lines changed

.bazelignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
.git
1+
# ignore .git, but make sure we can get commit hash
2+
!.git/HEAD
3+
!.git/refs
4+
!.git/refs/heads
5+
!.git/packed-refs
6+
.git/*
7+
28
node_modules
39
bazel-out
410
bazel-bin

.github/workflows/ios-ci.yml

+18-1
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,30 @@ jobs:
332332
run: |
333333
VERSION=${{ env.version }} COCOAPODS_TRUNK_TOKEN=${{ secrets.COCOAPODS_PASSWORD }} pod trunk push MapLibre.podspec
334334
335+
ios-build-cmake:
336+
needs: pre_job
337+
runs-on: macos-latest
338+
if: needs.pre_job.outputs.should_skip != 'true'
339+
steps:
340+
- uses: actions/checkout@v4
341+
with:
342+
submodules: recursive
343+
fetch-depth: 0
344+
345+
- name: Configure build with CMake
346+
run: cmake --preset ios
347+
348+
- name: Build mbgl-core
349+
run: cmake --build build-ios --target mbgl-core ios-sdk-static app
350+
335351
ios-ci-result:
336352
runs-on: ubuntu-latest
337353
if: needs.pre_job.outputs.should_skip != 'true' && always()
338354
needs:
339355
- pre_job
340356
- ios-build
357+
- ios-build-cmake
341358
steps:
342359
- name: Mark result as failed
343-
if: needs.ios-build.result != 'success'
360+
if: needs.ios-build.result != 'success' || needs.ios-build-cmake.result != 'success'
344361
run: exit 1

.github/workflows/node-ci.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ jobs:
167167
if: ${{contains(runner.name, 'GitHub Actions')}}
168168
uses: jwlawson/actions-setup-cmake@v2
169169
with:
170-
cmake-version: '3.29.2'
170+
cmake-version: '3.31'
171171

172172
- name: cmake version
173173
run: |
@@ -204,16 +204,7 @@ jobs:
204204
- name: Configure maplibre-native (MacOS)
205205
if: runner.os == 'MacOS'
206206
run: |
207-
cmake . -B build \
208-
-G Ninja \
209-
-DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }} \
210-
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
211-
-DMLN_WITH_NODE=ON \
212-
-DMLN_WITH_OPENGL=OFF \
213-
-DMLN_WITH_METAL=ON \
214-
-DMLN_LEGACY_RENDERER=OFF \
215-
-DMLN_DRAWABLE_RENDERER=ON \
216-
-DMLN_WITH_WERROR=OFF
207+
cmake --preset macos-node -DCMAKE_BUILD_TYPE=${{ env.BUILDTYPE }}
217208
218209
- name: Configure maplibre-native (Linux)
219210
if: runner.os == 'Linux'

CMakeLists.txt

+16-4
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ target_compile_options(
8686
$<$<STREQUAL:${MLN_WITH_SANITIZER},undefined>:-fsanitize=float-divide-by-zero,
8787
-fsanitize-blacklist=${UBSAN_BLACKLIST}>
8888
$<$<PLATFORM_ID:iOS>:-fembed-bitcode>
89-
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<OR:$<BOOL:${MLN_WITH_RTTI}>,$<CXX_COMPILER_ID:MSVC>>>>:-fno-rtti>
89+
$<$<AND:$<OR:$<COMPILE_LANGUAGE:CXX>,$<COMPILE_LANGUAGE:OBJCXX>>,$<NOT:$<OR:$<BOOL:${MLN_WITH_RTTI}>,$<CXX_COMPILER_ID:MSVC>>>>:-fno-rtti>
9090
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wall>
9191
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wshadow>
9292
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<NOT:$<PLATFORM_ID:Windows>>>:-Wextra>
@@ -1035,6 +1035,7 @@ if(MLN_WITH_OPENGL)
10351035
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_circle.hpp
10361036
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_collision_box.hpp
10371037
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_collision_circle.hpp
1038+
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_custom_geometry.hpp
10381039
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_custom_symbol_icon.hpp
10391040
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_debug.hpp
10401041
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/gl/drawable_fill.hpp
@@ -1217,6 +1218,7 @@ if(MLN_WITH_METAL)
12171218
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/clipping_mask.hpp
12181219
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/common.hpp
12191220
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/collision.hpp
1221+
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/custom_geometry.hpp
12201222
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/custom_symbol_icon.hpp
12211223
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/debug.hpp
12221224
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/fill.hpp
@@ -1226,6 +1228,7 @@ if(MLN_WITH_METAL)
12261228
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/hillshade.hpp
12271229
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/hillshade_prepare.hpp
12281230
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/line.hpp
1231+
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/location_indicator.hpp
12291232
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/raster.hpp
12301233
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/shader_group.hpp
12311234
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/mtl/shader_program.hpp
@@ -1256,6 +1259,7 @@ if(MLN_WITH_METAL)
12561259
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/circle.cpp
12571260
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/collision.cpp
12581261
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/clipping_mask.cpp
1262+
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/custom_geometry.cpp
12591263
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/custom_symbol_icon.cpp
12601264
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/debug.cpp
12611265
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/fill.cpp
@@ -1265,9 +1269,11 @@ if(MLN_WITH_METAL)
12651269
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/hillshade.cpp
12661270
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/hillshade_prepare.cpp
12671271
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/line.cpp
1272+
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/location_indicator.cpp
12681273
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/raster.cpp
12691274
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/symbol.cpp
12701275
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/mtl/widevector.cpp
1276+
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/mtl/custom_layer_render_parameters.cpp
12711277
)
12721278

12731279
find_library(METAL_FRAMEWORK Metal)
@@ -1313,6 +1319,7 @@ if(MLN_WITH_VULKAN)
13131319
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/clipping_mask.hpp
13141320
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/collision.hpp
13151321
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/common.hpp
1322+
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/custom_geometry.hpp
13161323
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/custom_symbol_icon.hpp
13171324
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/fill.hpp
13181325
${PROJECT_SOURCE_DIR}/include/mbgl/shaders/vulkan/fill_extrusion.hpp
@@ -1353,6 +1360,7 @@ if(MLN_WITH_VULKAN)
13531360
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/circle.cpp
13541361
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/clipping_mask.cpp
13551362
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/collision.cpp
1363+
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/custom_geometry.cpp
13561364
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/custom_symbol_icon.cpp
13571365
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/debug.cpp
13581366
${PROJECT_SOURCE_DIR}/src/mbgl/shaders/vulkan/fill.cpp
@@ -1372,12 +1380,12 @@ endif()
13721380
if(MLN_DRAWABLE_RENDERER)
13731381
list(APPEND
13741382
SRC_FILES
1375-
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer.cpp
13761383
${PROJECT_SOURCE_DIR}/src/mbgl/layermanager/custom_drawable_layer_factory.cpp
1377-
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.cpp
1378-
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.hpp
13791384
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.cpp
13801385
${PROJECT_SOURCE_DIR}/src/mbgl/renderer/layers/render_custom_drawable_layer.hpp
1386+
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.cpp
1387+
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer_impl.hpp
1388+
${PROJECT_SOURCE_DIR}/src/mbgl/style/layers/custom_drawable_layer.cpp
13811389
)
13821390
endif()
13831391

@@ -1579,7 +1587,11 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
15791587
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
15801588
include(${PROJECT_SOURCE_DIR}/platform/linux/linux.cmake)
15811589
elseif(CMAKE_SYSTEM_NAME STREQUAL Darwin)
1590+
include(${PROJECT_SOURCE_DIR}/platform/darwin/darwin.cmake)
15821591
include(${PROJECT_SOURCE_DIR}/platform/macos/macos.cmake)
1592+
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
1593+
include(${PROJECT_SOURCE_DIR}/platform/darwin/darwin.cmake)
1594+
include(${PROJECT_SOURCE_DIR}/platform/ios/ios.cmake)
15831595
elseif(WIN32)
15841596
include(${PROJECT_SOURCE_DIR}/platform/windows/windows.cmake)
15851597
else()

CMakePresets.json

+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
"version": 10,
3+
"cmakeMinimumRequired": {
4+
"major": 3,
5+
"minor": 21,
6+
"patch": 0
7+
},
8+
"configurePresets": [
9+
{
10+
"name": "ios",
11+
"displayName": "iOS",
12+
"generator": "Xcode",
13+
"description": "Create Xcode project for iOS",
14+
"binaryDir": "${sourceDir}/build-ios",
15+
"cacheVariables": {
16+
"CMAKE_SYSTEM_NAME": "iOS",
17+
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
18+
"MLN_WITH_METAL": "ON",
19+
"MLN_WITH_OPENGL": "OFF",
20+
"MLN_DRAWABLE_RENDERER": "ON"
21+
}
22+
},
23+
{
24+
"name": "macos",
25+
"displayName": "macOS",
26+
"generator": "Ninja",
27+
"binaryDir": "${sourceDir}/build-macos",
28+
"cacheVariables": {
29+
"CMAKE_SYSTEM_NAME": "Darwin",
30+
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
31+
"MLN_WITH_METAL": "ON",
32+
"MLN_WITH_OPENGL": "OFF",
33+
"MLN_DRAWABLE_RENDERER": "ON"
34+
}
35+
},
36+
{
37+
"name": "macos-vulkan",
38+
"displayName": "macOS",
39+
"generator": "Ninja",
40+
"binaryDir": "${sourceDir}/build-macos-vulkan",
41+
"cacheVariables": {
42+
"CMAKE_SYSTEM_NAME": "Darwin",
43+
"CMAKE_CXX_COMPILER_LAUNCHER": "ccache",
44+
"MLN_WITH_VULKAN": "ON",
45+
"MLN_WITH_OPENGL": "OFF",
46+
"MLN_DRAWABLE_RENDERER": "ON"
47+
}
48+
},
49+
{
50+
"name": "macos-node",
51+
"inherits": "macos",
52+
"binaryDir": "${sourceDir}/build",
53+
"cacheVariables": {
54+
"MLN_WITH_NODE": "ON",
55+
"MLN_WITH_WERROR": "OFF"
56+
}
57+
}
58+
]
59+
}

MODULE.bazel

+8
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,14 @@ http_archive(
5454
urls = ["https://github.com/glfw/glfw/releases/download/3.4/glfw-3.4.zip"],
5555
)
5656

57+
new_git_repository = use_repo_rule("@bazel_tools//tools/build_defs/repo:git.bzl", "new_git_repository")
58+
59+
new_git_repository(
60+
name = "tinyobjloader",
61+
remote = "https://github.com/tinyobjloader/tinyobjloader.git",
62+
branch = "release",
63+
)
64+
5765
darwin_config = use_repo_rule("//platform/darwin:bazel/darwin_config_repository_rule.bzl", "darwin_config")
5866

5967
darwin_config(

bazel/core.bzl

+6
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ MLN_GENERATED_OPENGL_SHADER_HEADERS = [
6767
"include/mbgl/shaders/gl/drawable_circle.hpp",
6868
"include/mbgl/shaders/gl/drawable_collision_box.hpp",
6969
"include/mbgl/shaders/gl/drawable_collision_circle.hpp",
70+
"include/mbgl/shaders/gl/drawable_custom_geometry.hpp",
7071
"include/mbgl/shaders/gl/drawable_custom_symbol_icon.hpp",
7172
"include/mbgl/shaders/gl/drawable_debug.hpp",
7273
"include/mbgl/shaders/gl/drawable_fill.hpp",
@@ -1010,6 +1011,7 @@ MLN_DRAWABLES_HEADERS = [
10101011
"include/mbgl/shaders/background_layer_ubo.hpp",
10111012
"include/mbgl/shaders/circle_layer_ubo.hpp",
10121013
"include/mbgl/shaders/collision_layer_ubo.hpp",
1014+
"include/mbgl/shaders/custom_geometry_ubo.hpp",
10131015
"include/mbgl/shaders/custom_drawable_layer_ubo.hpp",
10141016
"include/mbgl/shaders/debug_layer_ubo.hpp",
10151017
"include/mbgl/shaders/fill_layer_ubo.hpp",
@@ -1081,6 +1083,7 @@ MLN_DRAWABLES_MTL_SOURCE = [
10811083
"src/mbgl/shaders/mtl/circle.cpp",
10821084
"src/mbgl/shaders/mtl/collision.cpp",
10831085
"src/mbgl/shaders/mtl/clipping_mask.cpp",
1086+
"src/mbgl/shaders/mtl/custom_geometry.cpp",
10841087
"src/mbgl/shaders/mtl/custom_symbol_icon.cpp",
10851088
"src/mbgl/shaders/mtl/debug.cpp",
10861089
"src/mbgl/shaders/mtl/fill.cpp",
@@ -1090,6 +1093,7 @@ MLN_DRAWABLES_MTL_SOURCE = [
10901093
"src/mbgl/shaders/mtl/hillshade.cpp",
10911094
"src/mbgl/shaders/mtl/hillshade_prepare.cpp",
10921095
"src/mbgl/shaders/mtl/line.cpp",
1096+
"src/mbgl/shaders/mtl/location_indicator.cpp",
10931097
"src/mbgl/shaders/mtl/raster.cpp",
10941098
"src/mbgl/shaders/mtl/symbol.cpp",
10951099
"src/mbgl/shaders/mtl/widevector.cpp",
@@ -1120,6 +1124,7 @@ MLN_DRAWABLES_MTL_HEADERS = [
11201124
"include/mbgl/shaders/mtl/clipping_mask.hpp",
11211125
"include/mbgl/shaders/mtl/collision.hpp",
11221126
"include/mbgl/shaders/mtl/common.hpp",
1127+
"include/mbgl/shaders/mtl/custom_geometry.hpp",
11231128
"include/mbgl/shaders/mtl/custom_symbol_icon.hpp",
11241129
"include/mbgl/shaders/mtl/debug.hpp",
11251130
"include/mbgl/shaders/mtl/fill.hpp",
@@ -1129,6 +1134,7 @@ MLN_DRAWABLES_MTL_HEADERS = [
11291134
"include/mbgl/shaders/mtl/hillshade.hpp",
11301135
"include/mbgl/shaders/mtl/hillshade_prepare.hpp",
11311136
"include/mbgl/shaders/mtl/line.hpp",
1137+
"include/mbgl/shaders/mtl/location_indicator.hpp",
11321138
"include/mbgl/shaders/mtl/raster.hpp",
11331139
"include/mbgl/shaders/mtl/shader_group.hpp",
11341140
"include/mbgl/shaders/mtl/shader_program.hpp",

docs/mdbook/src/ios/README.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,20 @@ bazel run //platform/ios:App --//:renderer=metal
7373

7474
You can also build targets from the command line. For example, if you want to build your own XCFramework, see the 'Build XCFramework' step in the [iOS CI workflow](../../.github/workflows/ios-ci.yml).
7575

76-
## Swift App
76+
## CMake
7777

78-
There is also an example app built with Swift instead of Objective-C. The target is called `MapLibreApp` and the source code lives in `platform/ios/app-swift`.
78+
It is also possible to generate an Xcode project using CMake. As of February 2025, targets `mbgl-core`, `ios-sdk-static` and `app` (Objective-C development app) are supported.
79+
80+
```
81+
cmake --preset ios -DDEVELOPMENT_TEAM_ID=YOUR_TEAM_ID
82+
xed build-ios/MapLibre\ Native.xcodeproj
83+
```
84+
85+
## Distribution
86+
87+
MapLibre iOS is distributed as an XCFramework via the [maplibre/maplibre-gl-native-distribution](https://github.com/maplibre/maplibre-gl-native-distribution) repository. See [Release MapLibre iOS](./release.md) for the release process. Refer to the [`ios-ci.yml`](https://github.com/maplibre/maplibre-native/blob/main/.github/workflows/ios-ci.yml) workflow for an up-to-date recipe for building an XCFramework. As of February 2025 we use:
88+
89+
```
90+
bazel build --compilation_mode=opt --features=dead_strip,thin_lto --objc_enable_binary_stripping \
91+
--apple_generate_dsym --output_groups=+dsyms --//:renderer=metal //platform/ios:MapLibre.dynamic --embed_label=maplibre_ios_"$(cat VERSION)"
92+
```

docs/mdbook/src/platforms.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ In 2023 we co-opted Bazel as a build tool (generator), mostly due to it having b
4848
| Platform | CMake | Bazel |
4949
|---|---|---|
5050
| Android | ✅ (via Gradle) ||
51-
| iOS | ||
51+
| iOS | [^3] ||
5252
| Linux |||
53-
| Windows || |
53+
| Windows || |
5454
| macOS |||
5555
| Node.js |||
5656
| Qt |||
57+
58+
59+
[^3]: Some targets are supported, see [here](ios/README.md#cmake).

include/mbgl/gfx/context.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,8 @@ class Context {
130130
bool persistent = false,
131131
bool ssbo = false) = 0;
132132

133+
virtual UniqueUniformBufferArray createLayerUniformBufferArray() = 0;
134+
133135
/// Get the generic shader with the specified name
134136
virtual gfx::ShaderProgramBasePtr getGenericShader(gfx::ShaderRegistry&, const std::string& name) = 0;
135137

include/mbgl/gfx/uniform_buffer.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ namespace gfx {
1212
class Context;
1313
class UniformBuffer;
1414
class UniformBufferArray;
15+
class RenderPass;
1516

1617
using UniformBufferPtr = std::shared_ptr<UniformBuffer>;
1718
using UniqueUniformBuffer = std::unique_ptr<UniformBuffer>;
@@ -75,6 +76,8 @@ class UniformBufferArray {
7576
createOrUpdate(id, data, sizeof(T), context, persistent);
7677
}
7778

79+
virtual void bind(gfx::RenderPass& renderPass) = 0;
80+
7881
UniformBufferArray& operator=(UniformBufferArray&&);
7982
UniformBufferArray& operator=(const UniformBufferArray&);
8083

include/mbgl/gl/uniform_buffer_gl.hpp

+2
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,8 @@ class UniformBufferArrayGL final : public gfx::UniformBufferArray {
6262
void bind() const;
6363
void unbind() const;
6464

65+
void bind(gfx::RenderPass&) override { bind(); }
66+
6567
private:
6668
std::unique_ptr<gfx::UniformBuffer> copy(const gfx::UniformBuffer& uniformBuffers) override {
6769
return std::make_unique<UniformBufferGL>(static_cast<const UniformBufferGL&>(uniformBuffers).clone());

include/mbgl/mtl/context.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ class VertexBufferResource;
4141

4242
using UniqueShaderProgram = std::unique_ptr<ShaderProgram>;
4343
using UniqueVertexBufferResource = std::unique_ptr<VertexBufferResource>;
44+
using UniqueUniformBufferArray = std::unique_ptr<gfx::UniformBufferArray>;
4445

4546
class Context final : public gfx::Context {
4647
public:
@@ -88,6 +89,8 @@ class Context final : public gfx::Context {
8889
bool persistent = false,
8990
bool ssbo = false) override;
9091

92+
UniqueUniformBufferArray createLayerUniformBufferArray() override;
93+
9194
gfx::ShaderProgramBasePtr getGenericShader(gfx::ShaderRegistry&, const std::string& name) override;
9295

9396
TileLayerGroupPtr createTileLayerGroup(int32_t layerIndex, std::size_t initialCapacity, std::string name) override;

include/mbgl/mtl/index_buffer_resource.hpp

-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ namespace mtl {
88

99
class IndexBufferResource : public gfx::IndexBufferResource {
1010
public:
11-
IndexBufferResource() noexcept = default;
1211
IndexBufferResource(BufferResource&&) noexcept;
1312
IndexBufferResource(IndexBufferResource&& other) noexcept
1413
: buffer(std::move(other.buffer)) {}

include/mbgl/mtl/uniform_buffer.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ class UniformBufferArray final : public gfx::UniformBufferArray {
4242
return *this;
4343
}
4444

45-
void bind(RenderPass& renderPass) const noexcept;
46-
void unbind(RenderPass&) const noexcept {}
45+
void bindMtl(RenderPass&) const noexcept;
46+
void bind(gfx::RenderPass& renderPass) override;
4747

4848
private:
4949
gfx::UniqueUniformBuffer copy(const gfx::UniformBuffer& buffer) override {

0 commit comments

Comments
 (0)