refactor(renderer): select paths by GPU limits

Keep storage fast paths on capable adapters and use packed or texture fallbacks only when device limits require them.\n\nCompact mesh-edge varyings to avoid WebGL shader rejection.
This commit is contained in:
Hakan Seven committed 2026-07-29 12:49:41 +03:00
1 parent b9799e4421
commit 93b9a840ff
16 files changed
+1010 -181

No files matched your search

+8
View File
@@ -263,6 +263,11 @@ fn cap_clipped(cap: vec2<f32>, cap_ends: vec3<f32>) -> bool {
}
@fragment fn fs_main(in: VertexOut) -> @location(0) vec4<f32> {
// Negative pattern length is the persistent-arena tombstone sentinel.
// Discard before cap/alpha work so deleted slabs cannot write color/depth.
if in.pattern_length < 0.0 {
discard;
}
if cap_clipped(in.cap, in.cap_ends) {
discard;
}
@@ -287,6 +292,9 @@ fn cap_clipped(cap: vec2<f32>, cap_ends: vec3<f32>) -> bool {
// mesh reads as a shaded surface framed by black edges. Keeps the dash/LOD
// logic identical to `fs_main`; only the RGB is forced to black.
@fragment fn fs_black(in: VertexOut) -> @location(0) vec4<f32> {
if in.pattern_length < 0.0 {
discard;
}
if cap_clipped(in.cap, in.cap_ends) {
discard;
}