forked from 1b-agent/opencadstudio-upstream
fix(scene): block text keeps its draw-order slot against sibling wipes
Unselected block text (the BS33-11 Mark/SectionMark labels) was erased by its own block's wipeout pass and only came back through the selection xray. Two compounding causes: - Glyph quads rendered at the bare insert level, an exact depth tie with every sibling fill, so the later wipeout pass won LessEqual. Wire batches now carry the composed child rank as depth_override (the same units the scene graph composes: depths[insert] + label * half), which the block-text upload resolves per instance. Glyph vertices stay neutral on purpose — baking the raw per-block label into them double-counts and, for a negative rank, sinks the text BELOW its own masks. - The wipeout pipeline's depth bias (-8 quanta) was larger than the whole within-block band: once child ranks compress into the insert's half-band, sibling steps are ~3 quanta and a wipeout-to-text gap is only 9-16 quanta of the 24-bit buffer. The mask only needs to break exact ties, so the bias is now WIPEOUT_DEPTH_BIAS_QUANTA = 2. block_text_draw_depth regression pins the contract: neutral vertices, override carrying the rank, and a margin over the wipe that exceeds the bias on a 600-entity scene.
This commit is contained in:
1 parent
472bb9883d
commit
454d99b1d3
3 files changed
+182
-6
No files matched your search
@@ -53,6 +53,13 @@ use crate::scene::model::image_model::ImageModel;
|
||||
use crate::scene::model::mesh_model::MeshLodSet;
|
||||
use crate::scene::model::wire_model::WireModel;
|
||||
|
||||
/// Worst-case raster depth bias (in 24-bit quanta, toward the camera) block
|
||||
/// text is required to clear. The wipeout pipeline currently carries no bias
|
||||
/// (a raster bias can jump a block's narrow depth band and erase its
|
||||
/// foreground), so this is a safety budget: the block-text regression asserts
|
||||
/// a larger margin over whatever bias the pipeline could reintroduce.
|
||||
pub const WIPEOUT_DEPTH_BIAS_QUANTA: i32 = 2;
|
||||
|
||||
struct SilhouetteChunk {
|
||||
vertex_buffer: wgpu::Buffer,
|
||||
instance_buffer: wgpu::Buffer,
|
||||
@@ -1056,7 +1063,13 @@ impl Pipeline {
|
||||
depth_compare: Some(wgpu::CompareFunction::LessEqual),
|
||||
stencil: content_stencil.clone(),
|
||||
// The shader already applies draw order. A raster bias can
|
||||
// jump across a block's narrow range and erase its foreground.
|
||||
// jump across a block's narrow range and erase its foreground
|
||||
// — block text clears its siblings' wipes by only 9-16 depth
|
||||
// quanta, so the pipeline must stay bias-free. Coincident ties
|
||||
// still resolve toward the mask, which draws later under
|
||||
// LessEqual. WIPEOUT_DEPTH_BIAS_QUANTA is the budget the
|
||||
// block-text regression asserts against if a bias ever
|
||||
// returns.
|
||||
bias: wgpu::DepthBiasState::default(),
|
||||
}),
|
||||
multisample: wgpu::MultisampleState {
|
||||
|
||||
Reference in new issue
Block a user