Skip to content

Commit

Permalink
renderer example compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wumpf committed Feb 19, 2024
1 parent 3509316 commit 012ab21
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
4 changes: 2 additions & 2 deletions crates/re_renderer/src/point_cloud_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,12 @@ impl PointCloudBuilder {
.expect("Failed to allocate picking layer buffer"); // TODO(#3408): Should never happen but should propagate error anyways

Self {
vertices: Vec::with_capacity(max_num_points as usize),
vertices: Vec::with_capacity(max_num_points),
color_buffer,
picking_instance_ids_buffer,
batches: Vec::with_capacity(16),
radius_boost_in_ui_points_for_outlines: 0.0,
max_num_points: max_num_points as usize,
max_num_points,
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/re_renderer/src/renderer/lines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ impl LineDrawData {

let texture_size = line_strip_texture.texture.size();
let texel_count = (texture_size.width * texture_size.height) as usize;
let num_elements_padding = texel_count - num_strips as usize;
let num_elements_padding = texel_count - num_strips;

let mut staging_buffer = ctx.cpu_write_gpu_read_belt.lock().allocate(
&ctx.device,
Expand Down
2 changes: 1 addition & 1 deletion crates/re_renderer_examples/depth_cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl RenderDepthClouds {
})
.multiunzip();

let mut builder = PointCloudBuilder::new(re_ctx, points.len() as u32);
let mut builder = PointCloudBuilder::new(re_ctx, points.len());
builder
.batch("backprojected point cloud")
.add_points(&points, &radii, &colors, &[]);
Expand Down
2 changes: 1 addition & 1 deletion crates/re_renderer_examples/multiview.rs
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ impl Example for Multiview {
let skybox = GenericSkyboxDrawData::new(re_ctx);
let lines = build_lines(re_ctx, seconds_since_startup);

let mut builder = PointCloudBuilder::new(re_ctx, self.random_points_positions.len() as u32);
let mut builder = PointCloudBuilder::new(re_ctx, self.random_points_positions.len());
builder
.batch("Random Points")
.world_from_obj(glam::Affine3A::from_rotation_x(seconds_since_startup))
Expand Down
5 changes: 1 addition & 4 deletions crates/re_renderer_examples/picking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,7 @@ impl framework::Example for Picking {

let mut point_builder = PointCloudBuilder::new(
re_ctx,
self.point_sets
.iter()
.map(|set| set.positions.len() as u32)
.sum(),
self.point_sets.iter().map(|set| set.positions.len()).sum(),
);
for (i, point_set) in self.point_sets.iter().enumerate() {
point_builder
Expand Down

0 comments on commit 012ab21

Please sign in to comment.