Repository navigation
Picking by ids on one path for the page and the native app, a picked feature's properties read from its tile - #653
Merged
Merged
Conversation
…mbered as the pass was drawn The picking answer names the tile and the feature's index there, from the numbering kept with each request (isard-graphic-engine renderer::picking, which now holds the block of pixels and the request queue). The engine keeps each source tile's MVT bytes with its tiles and reads the picked feature with the Rust MVT reader; the workers no longer copy a properties object per styled feature to the page. A characterization fixture of pickFeature on the vector and vector-3d examples (tests/fixtures/vector-pick.json, scripts/test/vector-pick-fixture.ts) passes on main and on this branch.
…ytes come once per source tile The MVT reader reads one feature of one layer without decoding the others (decode_one_feature): turning a hit into its feature costs what it did before the bytes were kept engine-side. The engine keeps a source tile by its level, column and row; the page asks the workers for its bytes only while the engine does not keep them.
…, moved from the legacy core prism_range takes the body's relief range rather than the body: the technique crate does not know isard-geodesy.
…rhi's Commands isard-graphic-engine's renderer::picking makes the picking target (Target) and begins the pass into it, clipped to the block around the cursor (draw_pass, RenderPass::clip); both backends then ask its pixels of the GPU's memory and take them once read back. Metal's own pass and synchronous read back are gone; wgpu's legacy layers still draw their picking on wgpu's own pass, reached through WgpuPass::raw (#501).
…, as the crate layout wants
…the graphic engine
…the same picking pass The native app asks what is under the pointer as the page does: the map asked at once, the answer read back a frame or two later, the hovered feature printed when it changes and the clicked one on each click (--pick X,Y prints it with --screenshot). Metal draws the pass after the next frame with that frame's lists. The buildings give the engine their source tile's bytes once per source tile, which the picked feature's properties are read from. Which layers a pass draws, their numbering and the fallback to the fills picked on the CPU move to isard-engine's Map, shared by both backends; the styled features' column the picking reads is StyledTile::sources, shared with the vector tiles module.
…uides and React Native's methods
…ors work now returns, not their properties
… the picking contract checked in CI, the crates' READMEs naming picking
…e instead of stopping unseen
…isual tests' Vulkan on Linux
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Slice 5, part 3 of the migration: picking by ids, one path for the page and the native app, on wgpu and Metal.
isard-graphic-engine::renderer::picking: the block around the cursor (moved from the legacy core), at most 8 requests in flight, the pass begun throughisard_rhi::encode::Commandsand its pixels read back through the GPU's memory on both backends. Metal's own picking pass and its synchronous read-back are gone; wgpu's choice of layers, numbering and CPU fallback moved toisard_engine::map::Map, shared by both.{ layer, node, index }.isard-layers::vector_tiles::pick,mvt::decode_one_feature). The worker no longer copies a properties object per feature, the page no longer keeps them.apps/native/src/app/picking.rs),--pick X,Ywith--screenshotfor a scripted check; wgpu and Metal pick the same building at the same point.isard-graphic-engine::scene::shapes::pick, moved from the legacy core.isard-rhi(scissor_within), for a layer's columns and the picking block alike.tests/fixtures/vector-pick.json, 30 points ofvector-3dandvectorwith the featurepickFeaturegives, recorded and checked against main's build;bun run test:pickruns it, inbun run check --visualand on the first visual runner of the CI.The engine's picking API added to the legacy engine (
set_vector_tile_features,has_vector_tile_source,pick_slots,pick_numbering,picked,vector_featureand their wasm exports) moves to the target with the next part of slice 5, the vector tiles layer declared in Rust.Performance
bun run perf:mainon a quiet machine: no path slower. Turning a hit into its feature, alternated onvector-3d(under load): 8.67 µs on main, 8.80 and 8.53 µs on the branch.