diff --git a/.github/actions/install-driver/action.yml b/.github/actions/install-driver/action.yml index 26754fcd..1f70ffa7 100644 --- a/.github/actions/install-driver/action.yml +++ b/.github/actions/install-driver/action.yml @@ -8,12 +8,10 @@ runs: # On Ubuntu 22.04 (currently used) using the PPA introduces SEGVs. #- name: Use oibaf PPA for drivers # shell: bash - # run: | - # sudo apt-get update -y -qq - # sudo add-apt-repository ppa:oibaf/graphics-drivers -y + # run: sudo apt-get update -y -qq && sudo add-apt-repository ppa:oibaf/graphics-drivers -y - name: Install Mesa Dependencies shell: bash - run: sudo apt-get install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers + run: sudo apt-get update -y -qq && sudo apt-get install -y libegl1-mesa libgl1-mesa-dri libxcb-xfixes0-dev mesa-vulkan-drivers - name: Install wgpu-info shell: bash # Rev is for 0.14.1: https://github.com/gfx-rs/wgpu/tree/v0.14.1 diff --git a/.github/actions/install-system-dependencies/action.yml b/.github/actions/install-system-dependencies/action.yml index 4baa2628..9218331f 100644 --- a/.github/actions/install-system-dependencies/action.yml +++ b/.github/actions/install-system-dependencies/action.yml @@ -12,7 +12,7 @@ runs: if: runner.os == 'Linux' shell: bash run: | - sudo apt-get install -y \ + sudo apt-get update -y -qq && sudo apt-get install -y \ protobuf-compiler \ libwayland-dev libxkbcommon-dev # Required for winit - name: Install System Dependencies (macOS) diff --git a/maplibre/src/io/source_client.rs b/maplibre/src/io/source_client.rs index eb882788..7e1345b1 100644 --- a/maplibre/src/io/source_client.rs +++ b/maplibre/src/io/source_client.rs @@ -68,11 +68,11 @@ where } pub async fn fetch(&self, coords: &WorldTileCoords) -> Result, SourceFetchError> { - let tile_coords = coords.into_tile(TileAddressingScheme::TMS).unwrap(); + let tile_coords = coords.into_tile(TileAddressingScheme::XYZ).unwrap(); self.inner_client .fetch( format!( - "https://maps.tuerantuer.org/europe_germany/{z}/{x}/{y}.pbf", + "https://maps.tuerantuer.org/europe_germany/{z}/{x}/{y}", x = tile_coords.x, y = tile_coords.y, z = tile_coords.z diff --git a/maplibre/src/io/transferables.rs b/maplibre/src/io/transferables.rs index 99b846e7..ca961eac 100644 --- a/maplibre/src/io/transferables.rs +++ b/maplibre/src/io/transferables.rs @@ -38,6 +38,8 @@ pub trait LayerTessellated: Send { fn coords(&self) -> WorldTileCoords; + fn is_empty(&self) -> bool; + fn to_stored_layer(self) -> StoredLayer; } @@ -119,6 +121,10 @@ impl LayerTessellated for DefaultLayerTesselated { self.coords } + fn is_empty(&self) -> bool { + self.buffer.usable_indices == 0 + } + fn to_stored_layer(self) -> StoredLayer { StoredLayer::TessellatedLayer { coords: self.coords, diff --git a/maplibre/src/render/render_commands.rs b/maplibre/src/render/render_commands.rs index 5416f1d4..c98f07b5 100644 --- a/maplibre/src/render/render_commands.rs +++ b/maplibre/src/render/render_commands.rs @@ -143,11 +143,16 @@ impl RenderCommand<(IndexEntry, TileShape)> for DrawTile { &entry.coords ); + let index_range = entry.indices_buffer_range(); + + if index_range.is_empty() { + tracing::error!("Tried to draw a vector tile without any vertices"); + return RenderCommandResult::Failure; + } + pass.set_stencil_reference(reference); - pass.set_index_buffer( - buffer_pool.indices().slice(entry.indices_buffer_range()), - INDEX_FORMAT, - ); + + pass.set_index_buffer(buffer_pool.indices().slice(index_range), INDEX_FORMAT); pass.set_vertex_buffer( 0, buffer_pool.vertices().slice(entry.vertices_buffer_range()), diff --git a/maplibre/src/stages/populate_tile_store_stage.rs b/maplibre/src/stages/populate_tile_store_stage.rs index e57bb803..7a985dd3 100644 --- a/maplibre/src/stages/populate_tile_store_stage.rs +++ b/maplibre/src/stages/populate_tile_store_stage.rs @@ -64,6 +64,11 @@ impl Stage for PopulateTileStore { tile_repository.put_layer(layer); } Message::LayerTessellated(message) => { + // TODO: Is it fine to ignore layers without any vertices? + if message.is_empty() { + continue; + } + let layer: StoredLayer = message.to_stored_layer(); tracing::debug!( diff --git a/web/src/platform/singlethreaded/transferables.rs b/web/src/platform/singlethreaded/transferables.rs index 2ec8836d..7d6aaf81 100644 --- a/web/src/platform/singlethreaded/transferables.rs +++ b/web/src/platform/singlethreaded/transferables.rs @@ -190,6 +190,11 @@ impl LayerTessellated for FlatBufferTransferable { data.coords().unwrap().into() } + fn is_empty(&self) -> bool { + let data = unsafe { root_as_flat_layer_tessellated_unchecked(&self.data[self.start..]) }; + data.usable_indices() == 0 + } + fn to_stored_layer(self) -> StoredLayer { let data = unsafe { root_as_flat_layer_tessellated_unchecked(&self.data[self.start..]) }; let vertices = data