1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 06:10:06 -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:
Emil Ernerfeldt
2024-02-01 16:27:59 +01:00
committed by GitHub
parent 8860930ec8
commit 1db291721f
9 changed files with 290 additions and 111 deletions

View File

@@ -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() {