diff --git a/src/scene/pipeline/mod.rs b/src/scene/pipeline/mod.rs index dbe0c31d8..838931c92 100644 --- a/src/scene/pipeline/mod.rs +++ b/src/scene/pipeline/mod.rs @@ -1473,7 +1473,14 @@ impl Pipeline { // ── Text (SDF glyph quads) ───────────────────────────────────────── let text_atlas_bgl = text_gpu::TextAtlasGpu::bind_group_layout(device); let (text_pipeline, text_highlight_pipeline) = - text_gpu::create_pipelines(device, &frame_bgl, &text_atlas_bgl, format, MSAA_SAMPLES); + text_gpu::create_pipelines( + device, + &frame_bgl, + &text_atlas_bgl, + format, + MSAA_SAMPLES, + &content_stencil, + ); let viewcube = ViewCubePipeline::new(device, queue, format); diff --git a/src/scene/pipeline/text_gpu.rs b/src/scene/pipeline/text_gpu.rs index 851407eed..77776e980 100644 --- a/src/scene/pipeline/text_gpu.rs +++ b/src/scene/pipeline/text_gpu.rs @@ -260,6 +260,7 @@ pub fn create_pipelines( atlas_bgl: &wgpu::BindGroupLayout, color_format: wgpu::TextureFormat, sample_count: u32, + content_stencil: &wgpu::StencilState, ) -> (wgpu::RenderPipeline, wgpu::RenderPipeline) { let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { label: Some("text.wgsl"), @@ -298,7 +299,7 @@ pub fn create_pipelines( format: wgpu::TextureFormat::Depth24PlusStencil8, depth_write_enabled, depth_compare, - stencil: wgpu::StencilState::default(), + stencil: content_stencil.clone(), bias: wgpu::DepthBiasState::default(), }), multisample: wgpu::MultisampleState {