-
-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add wide vector shader option to Custom Drawable Layer #2183
Conversation
Bloaty Results (iOS) 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results-ios/pr-2183-compared-to-main.txt |
Bloaty Results 🐋Compared to main
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2183-compared-to-main.txtCompared to d387090 (legacy)
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-2183-compared-to-legacy.txt |
Benchmark Results ⚡
Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-2183-compared-to-main.txt |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I hope someone from the Metal team can take a look for an in-depth review.
Can some kind of test be added?
@louwers : This is currently only available through the CustomDrawable API, therefore can't be included in the regular render test suite. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@stefankarschti We need some way to at least run the code involved in the Custom Drawable Layer on CI. May I suggest this super dumb 'smoke test' to be added to platform/ios/iosapp-UITests/iosapp_UITests.swift
?
/// Make sure the Custom Drawable Layer does not crash
func testCustomDrawableLayer() {
app.windows.children(matching: .other).element.children(matching: .other).element.children(matching: .other).element.doubleTap()
let mapSettingsButton = app.navigationBars["MapLibre Basic"].buttons["Map settings"]
mapSettingsButton.tap()
let tablesQuery = app.tables
tablesQuery.staticTexts["Add Custom Drawable Layer"].tap()
sleep(5)
}
It only makes sure the Custom Drawable Layer does not crash. Then we can worry about how to test for correctness later.
Introduce a new way to draw lines into the library's
CustomDrawableLayer
interface, by using a third party shader on the Metal platform.This shader makes use of instancing, and that is implemented into the toolkit for the Metal backend. OpenGL instancing is not implemented by this PR, but the base interface is common and compatible.
The
DrawableBuilder
is added two methods to build Wide vector polylines:addWideVectorPolylineLocal
andaddWideVectorPolylineGlobal
. These make use of local (tile) coordinates, and global (geographic) coordinates respectively.The
ExampleCustomDrawableStyleLayerHost
class inExampleCustomDrawableStyleLayer.mm
contains the updated examples for adding wide vector polylines through theCustomDrawableLayer
interface.