forked from 1b-agent/opencadstudio-upstream
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:
1 parent
7bfb617745
commit
4fd9b98da4
68 files changed
+3417
-547
No files matched your search
@@ -82,6 +82,7 @@ fn clip_triangles_px(img: &acadrust::entities::RasterImage) -> Vec<[f64; 2]> {
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
pub struct ImageModel {
|
||||
pub render_instance: Option<super::instance_model::RenderInstance>,
|
||||
/// Original file path (used for reload / display in properties).
|
||||
pub file_path: String,
|
||||
/// RGBA8 pixel data in row-major order. Arc-wrapped so cloning ImageModel
|
||||
@@ -168,6 +169,7 @@ impl ImageModel {
|
||||
|
||||
let decoded = resolve_image(&img.file_path)?;
|
||||
Some(Self {
|
||||
render_instance: None,
|
||||
file_path: img.file_path.clone(),
|
||||
pixels: decoded.pixels,
|
||||
width: decoded.width,
|
||||
@@ -278,6 +280,7 @@ impl ImageModel {
|
||||
.collect();
|
||||
|
||||
Some(Self {
|
||||
render_instance: None,
|
||||
file_path: def.file_path.clone(),
|
||||
pixels: raster.pixels.clone(),
|
||||
width: raster.width,
|
||||
@@ -334,6 +337,7 @@ impl ImageModel {
|
||||
let corners_low = [l0, l1, l2, l3];
|
||||
let verts = quad_verts(&corners, &corners_low);
|
||||
Some(Self {
|
||||
render_instance: None,
|
||||
file_path: "OLE2FRAME".to_string(),
|
||||
pixels: Arc::new(pixels),
|
||||
width,
|
||||
|
||||
Reference in new issue
Block a user