forked from 1b-agent/opencadstudio-upstream
Hatch/wipeout boundary sub-loops were separated by NaN vertices that the fill shaders detected with `p.x == p.x`. Intel Mesa folds that NaN self-compare to `true` under fast math, so separators read as real vertices, the ray-cast crossing count broke, and fills bled outside their boundary — only on Intel iGPUs. GPU uploads now rewrite the separators to a finite 1e30 sentinel (GPU_BOUNDARY_SEP) and the shaders test `abs(x) < 1e29`, which every driver evaluates identically. The CPU-side NaN representation is unchanged. Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
1 parent
0c578b03f3
commit
805da6428a
7 files changed
+46
-10
No files matched your search
@@ -203,13 +203,15 @@ impl HatchWebGpu {
|
||||
|
||||
// ── Pack the data texture: boundary | families | dashes ───────────
|
||||
let mut texels: Vec<[f32; 4]> = Vec::new();
|
||||
// Boundary section (texels 0..vcount). NaN separators preserved (they
|
||||
// survive the RGBA32F fetch byte-for-byte).
|
||||
// Boundary section (texels 0..vcount). NaN separators become the
|
||||
// finite GPU sentinel — the shader NaN self-compare is folded to
|
||||
// `true` on some drivers (#386, #416).
|
||||
for &[x, y] in model.boundary.iter() {
|
||||
if x.is_finite() && y.is_finite() {
|
||||
texels.push([x + drift[0], y + drift[1], 0.0, 0.0]);
|
||||
} else {
|
||||
texels.push([f32::NAN, f32::NAN, 0.0, 0.0]);
|
||||
let s = crate::scene::model::hatch_model::GPU_BOUNDARY_SEP;
|
||||
texels.push([s, s, 0.0, 0.0]);
|
||||
}
|
||||
}
|
||||
let vcount = texels.len() as u32;
|
||||
|
||||
Reference in new issue
Block a user