Modern-Apps.git
Publicgit clone https://git.maproj.org/Modern-Apps.gitModern-Apps.git / library / map / src / main / rust / Cargo.toml
Cargo.toml70 lines · 3.5 KiBRaw
| 1 | # The Vulkan vector-tile renderer for `:library:map`. |
| 2 | # |
| 3 | # Replaces the CARTO raster basemap in findfamily, photos, weather, taxi and |
| 4 | # fooddelivery (#615) with our own renderer over the planet-scale |
| 5 | # single-file planet4.mamaps archive (v9 header, v10 bodies, 10 layers). |
| 6 | # |
| 7 | # Why Vulkan and not `androidx.webgpu`: that wrapper bundles Dawn as a 5.79 MB |
| 8 | # `libwebgpu_c_bundled.so` per ABI, to translate to the Vulkan that is already on |
| 9 | # every device we target (minSdk 31). `ash` with `features = ["loaded"]` links |
| 10 | # nothing and dlopen's `libvulkan.so` at run time, so the only native code we ship |
| 11 | # is our own. It also drops a `1.0.0-alpha05` dependency whose API changes between |
| 12 | # alphas, and lets us feed SPIR-V straight to the driver instead of through Dawn's |
| 13 | # SPIR-V path, which is gated behind an unsafe-API toggle in some configurations. |
| 14 | # |
| 15 | # `games/voxels` is the in-repo precedent for all of this and the same ash version. |
| 16 | |
| 17 | [package] |
| 18 | name = "map_renderer" |
| 19 | version = "0.1.0" |
| 20 | edition = "2021" |
| 21 | publish = false |
| 22 | license = "GPL-2.0-only" |
| 23 | description = "Vulkan vector-tile map renderer: planet4.mamaps (v9/v10) in, triangles out" |
| 24 | |
| 25 | [lib] |
| 26 | name = "map_renderer" |
| 27 | # cdylib for the JNI surface; rlib so the host test binary can link it and run the |
| 28 | # whole CPU pipeline — tessellation, tile selection, the cache — without a device. |
| 29 | crate-type = ["cdylib", "rlib"] |
| 30 | |
| 31 | [dependencies] |
| 32 | jni.workspace = true |
| 33 | jni_bridge = { path = "../../../../../library/jni-bridge/src/main/rust" } |
| 34 | # Cache keys are SHA-256(url + range), as the Kotlin cache in `maps` uses. Already a |
| 35 | # workspace dependency, so this adds nothing to the lockfile. |
| 36 | sha2.workspace = true |
| 37 | # The authored MapLibre style is parsed at startup rather than transcribed into constants. |
| 38 | # Hand-copying it could not converge: MapLibre renders this exact file correctly, so the |
| 39 | # file is the source of truth and the only way to match it is to evaluate it. |
| 40 | serde_json.workspace = true |
| 41 | |
| 42 | # The .mamaps codec, shared with `scripts/maps`, which builds the |
| 43 | # planet4.mamaps archive this reads. One implementation, so the two cannot drift. |
| 44 | tilecodec = { path = "../../../../tilecodec/src/main/rust" } |
| 45 | |
| 46 | # HTTP goes back out through Kotlin: this crate opens no sockets and carries no TLS |
| 47 | # stack, so pmtiles range requests keep `library:network`'s reduced CA bundle. |
| 48 | jni_http = { path = "../../../../jni-http/src/main/rust" } |
| 49 | ab_glyph.workspace = true |
| 50 | # The POI sprite sheet is a PNG, and nothing else in this crate can decode one. Already in |
| 51 | # the workspace lock file, so this promotes an existing transitive crate to a direct |
| 52 | # dependency rather than adding to the tree. Decoding at first use ships the 28 KB |
| 53 | # compressed sheet instead of the 466 KB of raw RGBA a `build.rs` decode would bake into |
| 54 | # the `.so` — the same trade the fonts make with `ab_glyph`. |
| 55 | png.workspace = true |
| 56 | # Whole-file mmap for the pushed on-device `.mamaps` archive (see `tile::source::file`): |
| 57 | # range reads are slices of the mapping, so tile fetch pays no syscalls and the OS pages |
| 58 | # the multi-GB archive in and out rather than us copying it through `read_at`. |
| 59 | memmap2.workspace = true |
| 60 | |
| 61 | # `default-features = false` drops the `linked` feature, so nothing links against |
| 62 | # libvulkan at build time; `loaded` dlopen's it, which is what an Android app must |
| 63 | # do anyway. |
| 64 | [target.'cfg(target_os = "android")'.dependencies] |
| 65 | ash = { workspace = true, default-features = false, features = ["loaded"] } |
| 66 | |
| 67 | # The same codec with its writer, for host tests only. The device build links |
| 68 | # the read half and nothing else. |
| 69 | [dev-dependencies] |
| 70 | tilecodec = { path = "../../../../tilecodec/src/main/rust", features = ["write"] } |