Skip to content

Commit d7bf07f

Browse files
committed
Merge remote-tracking branch 'origin/main' into andreas/improved-entity-system-queries
2 parents c3c409e + 6db856a commit d7bf07f

30 files changed

Lines changed: 229 additions & 86 deletions

.github/pull_request_template.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ To get an auto-generated PR description you can put "copilot:summary" or "copilo
1818
* [ ] I have tested [demo.rerun.io](https://demo.rerun.io/pr/{{ pr.number }}) (if applicable)
1919

2020
- [PR Build Summary](https://build.rerun.io/pr/{{ pr.number }})
21-
- [Docs preview](https://rerun.io/preview/{{ "pr:%s"|format(pr.branch)|encode_uri_component }}/docs)
22-
- [Examples preview](https://rerun.io/preview/{{ "pr:%s"|format(pr.branch)|encode_uri_component }}/examples)
21+
- [Docs preview](https://rerun.io/preview/{{ pr.commit }}/docs) <!--DOCS-PREVIEW-->
22+
- [Examples preview](https://rerun.io/preview/{{ pr.commit }}/examples) <!--EXAMPLES-PREVIEW-->
2323
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
2424
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)

.github/workflows/reusable_track_size.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,12 @@ jobs:
7878
run: |
7979
entries=()
8080
81-
entries+=("Wasm:web_viewer/re_viewer_bg.wasm:MB")
82-
entries+=("JS:web_viewer/re_viewer.js:KB")
81+
entries+=("Wasm:web_viewer/re_viewer_bg.wasm:MiB")
82+
entries+=("JS:web_viewer/re_viewer.js:kiB")
8383
8484
for file in web_demo/examples/**/*.rrd; do
8585
name=$(basename $(dirname "$file"))
86-
entries+=("$name.rrd:$file:KB")
86+
entries+=("$name.rrd:$file:MiB")
8787
done
8888
8989
data=$(python3 scripts/ci/sizes.py measure "${entries[@]}")

Cargo.lock

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/re_data_store/src/editable_auto_value.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,8 @@ where
7575

7676
#[inline]
7777
fn deref(&self) -> &Self::Target {
78-
self.get()
78+
match self {
79+
EditableAutoValue::Auto(v) | EditableAutoValue::UserEdited(v) => v,
80+
}
7981
}
8082
}

crates/re_renderer/src/allocator/cpu_write_gpu_read_belt.rs

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ where
4949
///
5050
/// Do *not* make this public as we need to guarantee that the memory is *never* read from!
5151
#[inline(always)]
52-
fn as_slice(&mut self) -> &mut [u8] {
52+
fn as_mut_byte_slice(&mut self) -> &mut [u8] {
5353
// TODO(andreas): Is this access slow given that it internally goes through a trait interface? Should we keep the pointer around?
5454
&mut self.write_view[self.unwritten_element_range.start * std::mem::size_of::<T>()
5555
..self.unwritten_element_range.end * std::mem::size_of::<T>()]
@@ -61,7 +61,7 @@ where
6161
#[inline]
6262
pub fn extend_from_slice(&mut self, elements: &[T]) {
6363
let bytes = bytemuck::cast_slice(elements);
64-
self.as_slice()[..bytes.len()].copy_from_slice(bytes);
64+
self.as_mut_byte_slice()[..bytes.len()].copy_from_slice(bytes);
6565
self.unwritten_element_range.start += elements.len();
6666
}
6767

@@ -84,7 +84,15 @@ where
8484
/// Panics if the data no longer fits into the buffer.
8585
#[inline]
8686
pub fn push(&mut self, element: T) {
87-
self.as_slice()[..std::mem::size_of::<T>()].copy_from_slice(bytemuck::bytes_of(&element));
87+
assert!(
88+
self.unwritten_element_range.start < self.unwritten_element_range.end,
89+
"CpuWriteGpuReadBuffer<{}> is full ({} elements written)",
90+
std::any::type_name::<T>(),
91+
self.unwritten_element_range.start,
92+
);
93+
94+
self.as_mut_byte_slice()[..std::mem::size_of::<T>()]
95+
.copy_from_slice(bytemuck::bytes_of(&element));
8896
self.unwritten_element_range.start += 1;
8997
}
9098

crates/re_space_view_spatial/src/contexts/transform_context.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ impl TransformContext {
192192
&child_tree.path,
193193
data_store,
194194
query,
195-
|p| *entity_properties.get(p).pinhole_image_plane_distance.get(),
195+
|p| *entity_properties.get(p).pinhole_image_plane_distance,
196196
&mut encountered_pinhole,
197197
) {
198198
Err(unreachable_reason) => {

crates/re_space_view_spatial/src/heuristics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ fn update_transform3d_lines_heuristics(
232232
// If there's a pinhole, we orient ourselves on its image plane distance
233233
let pinhole_path_props = entity_properties.get(pinhole_path);
234234
properties.transform_3d_size = EditableAutoValue::Auto(
235-
pinhole_path_props.pinhole_image_plane_distance.get() * 0.25,
235+
*pinhole_path_props.pinhole_image_plane_distance * 0.25,
236236
);
237237
} else {
238238
// Size should be proportional to the scene extent, here covered by its diagonal

crates/re_space_view_spatial/src/parts/cameras.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ impl CamerasPart {
6767
return;
6868
};
6969

70-
let frustum_length = *props.pinhole_image_plane_distance.get();
70+
let frustum_length = *props.pinhole_image_plane_distance;
7171

7272
// If the camera is our reference, there is nothing for us to display.
7373
if transforms.reference_path() == ent_path {

crates/re_space_view_spatial/src/parts/images.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ impl ImagesPart {
225225
}
226226
};
227227

228-
if *ent_props.backproject_depth.get() && tensor.meaning == TensorDataMeaning::Depth {
228+
if *ent_props.backproject_depth && tensor.meaning == TensorDataMeaning::Depth {
229229
if let Some(parent_pinhole_path) = transforms.parent_pinhole(ent_path) {
230230
// NOTE: we don't pass in `world_from_obj` because this corresponds to the
231231
// transform of the projection plane, which is of no use to us here.
@@ -342,11 +342,11 @@ impl ImagesPart {
342342
&tensor_stats,
343343
)?;
344344

345-
let depth_from_world_scale = *properties.depth_from_world_scale.get();
345+
let depth_from_world_scale = *properties.depth_from_world_scale;
346346

347347
let world_depth_from_texture_depth = 1.0 / depth_from_world_scale;
348348

349-
let colormap = match *properties.color_mapper.get() {
349+
let colormap = match *properties.color_mapper {
350350
re_data_store::ColorMapper::Colormap(colormap) => match colormap {
351351
re_data_store::Colormap::Grayscale => Colormap::Grayscale,
352352
re_data_store::Colormap::Turbo => Colormap::Turbo,
@@ -362,7 +362,7 @@ impl ImagesPart {
362362
// at that distance.
363363
let fov_y = intrinsics.fov_y().unwrap_or(1.0);
364364
let pixel_width_from_depth = (0.5 * fov_y).tan() / (0.5 * height as f32);
365-
let radius_scale = *properties.backproject_radius_scale.get();
365+
let radius_scale = *properties.backproject_radius_scale;
366366
let point_radius_from_world_depth = radius_scale * pixel_width_from_depth;
367367

368368
Ok(DepthCloud {

crates/re_space_view_spatial/src/parts/transform3d_arrows.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ impl ViewPartSystem for Transform3DArrowsPart {
5555
continue;
5656
}
5757

58-
if !props.transform_3d_visible.get() {
58+
if !*props.transform_3d_visible {
5959
continue;
6060
}
6161

@@ -76,7 +76,7 @@ impl ViewPartSystem for Transform3DArrowsPart {
7676
&mut line_builder,
7777
world_from_obj,
7878
Some(ent_path),
79-
*props.transform_3d_size.get(),
79+
*props.transform_3d_size,
8080
query
8181
.highlights
8282
.entity_outline_mask(ent_path.hash())

0 commit comments

Comments
 (0)