rerun-io / rerun

Visualize streams of multimodal data. Fast, easy to use, and simple to integrate. Built in Rust using egui.
https://rerun.io/
Apache License 2.0
6.23k stars 287 forks source link

Spurious error with `Colormap` data UI #7195

Open abey79 opened 4 weeks ago

abey79 commented 4 weeks ago

The colormap component UI can trigger a spurious error in some circumstances.

image

Error:

[2024-08-15T07:57:45Z ERROR re_viewer_context::gpu_bridge::colormap] Failed to paint colormap preview: Condition failed: `resolution_in_pixel[0] > 0 && resolution_in_pixel[1] > 0`

Repro:

code: https://github.com/rerun-io/rerun/blob/819e021be96f633380bf711fc3fdc5267f6232da/crates/viewer/re_viewer_context/src/gpu_bridge/mod.rs#L160-L168

abey79 commented 4 weeks ago

The fix might be as easy as changing this ensure! line to an early exit, but I'm not sure if there would be hidden implications.

Wumpf commented 4 weeks ago

I wonder what causes this to happen. But it an early out here instead seems safe enough to me

abey79 commented 4 weeks ago

My bet is a situation where the ListItem is just visible on screen, so it draws its content, but the gradient is fully offscreen (because it's slightly smaller than the ListItem).