mirror of
https://github.com/emilk/egui.git
synced 2026-09-01 14:20:04 -04:00
Parallell tessellation (#3934)
* Part of https://github.com/emilk/egui/issues/1485 This adds a `rayon` feature to `epaint` and `egui` to parallelize tessellation of large shapes, such as high-resolution plot lines.
This commit is contained in:
@@ -84,6 +84,8 @@ impl Mesh {
|
||||
|
||||
/// Are all indices within the bounds of the contained vertices?
|
||||
pub fn is_valid(&self) -> bool {
|
||||
crate::profile_function!();
|
||||
|
||||
if let Ok(n) = u32::try_from(self.vertices.len()) {
|
||||
self.indices.iter().all(|&i| i < n)
|
||||
} else {
|
||||
@@ -106,6 +108,7 @@ impl Mesh {
|
||||
|
||||
/// Append all the indices and vertices of `other` to `self`.
|
||||
pub fn append(&mut self, other: Self) {
|
||||
crate::profile_function!();
|
||||
crate::epaint_assert!(other.is_valid());
|
||||
|
||||
if self.is_empty() {
|
||||
|
||||
Reference in New Issue
Block a user