perf(render): instance block geometry

Share source buffers across block placements and render nested content with GPU instance transforms.\n\nChunk silhouettes and compact mesh material data so large drawings stay under device buffer limits and remain responsive.
This commit is contained in:
Hakan Seven committed 2026-08-12 02:33:10 +03:00
1 parent 7bfb617745
commit 4fd9b98da4
68 files changed
+3417 -547

No files matched your search

+2
View File
@@ -225,6 +225,7 @@ impl CadCommand for AlignedDimensionCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
@@ -280,6 +281,7 @@ fn preview_aligned(p1: DVec3, p2: DVec3, dim_pt: DVec3) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -166,6 +166,7 @@ fn preview_wire(points: Vec<Vec3>) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -197,6 +197,7 @@ fn preview_line(a: Vec3, b: Vec3) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -185,6 +185,7 @@ impl CadCommand for DimBaselineCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -165,6 +165,7 @@ impl CadCommand for DimContinueCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -91,6 +91,7 @@ impl CadCommand for DimJogLineCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -108,6 +108,7 @@ impl CadCommand for DimTeditCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -261,6 +261,7 @@ fn preview_wire(pts: &[Vec3], arrow_size: f32) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -242,6 +242,7 @@ fn preview_wire(points: Vec<DVec3>) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -232,6 +232,7 @@ fn preview_wire(pts: &[Vec3], arrow_size: f32) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -467,6 +467,7 @@ fn preview_wire(pts: &[Vec3]) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -142,6 +142,7 @@ fn preview_wire(points: Vec<Vec3>) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -98,6 +98,7 @@ impl CadCommand for QdimCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -202,6 +202,7 @@ fn preview_wire(points: Vec<Vec3>) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -204,6 +204,7 @@ impl CadCommand for TableCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -108,6 +108,7 @@ impl CadCommand for ToleranceCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -206,6 +206,7 @@ impl CadCommand for AttdefCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+3
View File
@@ -235,6 +235,7 @@ impl HatchCommand {
}]
});
HatchModel {
render_instance: None,
boundary: std::sync::Arc::new(rel),
pattern: HatchPattern::Pattern(families),
name: pat_name.into(),
@@ -399,6 +400,7 @@ impl GradientCommand {
fn make_hatch(&self, rings: Vec<Vec<[f64; 2]>>) -> HatchModel {
let (rel, origin, wcs) = pack_rings(&rings);
HatchModel {
render_instance: None,
boundary: std::sync::Arc::new(rel),
pattern: HatchPattern::Gradient {
angle_deg: 0.0,
@@ -614,6 +616,7 @@ impl CadCommand for BoundaryCommand {
// Store as a Hatch entity (solid fill) so it is selectable.
let (rel, origin, wcs) = pack_rings(&rings);
let model = HatchModel {
render_instance: None,
boundary: std::sync::Arc::new(rel),
pattern: HatchPattern::Solid,
name: "SOLID".into(),
+1
View File
@@ -186,6 +186,7 @@ impl CadCommand for MlineCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -128,6 +128,7 @@ impl CadCommand for ImageCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+2
View File
@@ -90,6 +90,7 @@ impl CadCommand for RayCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
@@ -189,6 +190,7 @@ impl CadCommand for XLineCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -108,6 +108,7 @@ impl CadCommand for RevCloudCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -367,6 +367,7 @@ impl CadCommand for AreaCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -90,6 +90,7 @@ impl CadCommand for DistCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -75,6 +75,7 @@ impl MeasureGeomCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -3713,6 +3713,7 @@ fn preview_wire(points: Vec<[f32; 3]>, color: [f32; 4], name: &str) -> WireModel
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -516,6 +516,7 @@ fn wire(name: &str, points: Vec<[f32; 3]>) -> WireModel {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -59,6 +59,7 @@ impl CadCommand for PlotWindowCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,
+1
View File
@@ -78,6 +78,7 @@ impl CadCommand for ZoomWindowCommand {
depth_override: None,
fill_is_3d: false,
fill_is_2d_solid: false,
render_instance: None,
pick_tris: Vec::new(),
pick_tris_low: Vec::new(),
dash_from_start: false,