forked from 1b-agent/opencadstudio-upstream
perf(render): keep solid meshes resident
Keep all solid geometry GPU-resident during navigation. Use vertex-rate instancing, compact untextured vertices, vertex-cache ordering, and cached silhouette sources without culling geometry.
This commit is contained in:
1 parent
15ab027d70
commit
5e8221f8f1
9 files changed
+756
-1012
No files matched your search
@@ -20,10 +20,6 @@ impl DeviceCapabilities {
|
||||
/// instances, boundaries, families, dashes, and visibility.
|
||||
const HATCH_STORAGE_BINDINGS: u32 = 5;
|
||||
|
||||
/// Mesh compute culling reads one item buffer and writes four indirect
|
||||
/// command buffers.
|
||||
const MESH_CULL_BINDINGS: u32 = 5;
|
||||
|
||||
pub fn detect(device: &wgpu::Device) -> Self {
|
||||
Self::from_limits(&device.limits())
|
||||
}
|
||||
@@ -36,11 +32,6 @@ impl DeviceCapabilities {
|
||||
}
|
||||
}
|
||||
|
||||
/// Mesh instancing needs one read-only storage buffer.
|
||||
pub fn supports_mesh_storage_instancing(self) -> bool {
|
||||
self.max_storage_buffers_per_shader_stage >= 1
|
||||
}
|
||||
|
||||
pub fn supports_wire_storage(self) -> bool {
|
||||
self.max_storage_buffers_per_shader_stage >= Self::WIRE_STORAGE_BINDINGS
|
||||
}
|
||||
@@ -49,10 +40,6 @@ impl DeviceCapabilities {
|
||||
self.max_storage_buffers_per_shader_stage >= Self::HATCH_STORAGE_BINDINGS
|
||||
}
|
||||
|
||||
/// WebGL2 reports zero storage bindings and stays on CPU mesh culling.
|
||||
pub fn supports_mesh_compute_culling(self) -> bool {
|
||||
self.max_storage_buffers_per_shader_stage >= Self::MESH_CULL_BINDINGS
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@@ -63,19 +50,15 @@ mod tests {
|
||||
#[test]
|
||||
fn webgl_limits_select_compatibility_paths() {
|
||||
let caps = DeviceCapabilities::from_limits(&wgpu::Limits::downlevel_webgl2_defaults());
|
||||
assert!(!caps.supports_mesh_storage_instancing());
|
||||
assert!(!caps.supports_wire_storage());
|
||||
assert!(!caps.supports_batched_hatch());
|
||||
assert!(!caps.supports_mesh_compute_culling());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn default_limits_select_storage_paths() {
|
||||
let caps = DeviceCapabilities::from_limits(&wgpu::Limits::default());
|
||||
assert!(caps.supports_mesh_storage_instancing());
|
||||
assert!(caps.supports_wire_storage());
|
||||
assert!(caps.supports_batched_hatch());
|
||||
assert!(caps.supports_mesh_compute_culling());
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -86,8 +69,6 @@ mod tests {
|
||||
max_vertex_attributes: 16,
|
||||
};
|
||||
assert!(caps.supports_wire_storage());
|
||||
assert!(caps.supports_mesh_storage_instancing());
|
||||
assert!(!caps.supports_batched_hatch());
|
||||
assert!(!caps.supports_mesh_compute_culling());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user