fix(viewport): clip text to stencil
This commit is contained in:
parent
f6b9d6514e
commit
1955e022bf
2 changed files with 10 additions and 2 deletions
|
|
@ -1473,7 +1473,14 @@ impl Pipeline {
|
||||||
// ── Text (SDF glyph quads) ─────────────────────────────────────────
|
// ── Text (SDF glyph quads) ─────────────────────────────────────────
|
||||||
let text_atlas_bgl = text_gpu::TextAtlasGpu::bind_group_layout(device);
|
let text_atlas_bgl = text_gpu::TextAtlasGpu::bind_group_layout(device);
|
||||||
let (text_pipeline, text_highlight_pipeline) =
|
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);
|
let viewcube = ViewCubePipeline::new(device, queue, format);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -260,6 +260,7 @@ pub fn create_pipelines(
|
||||||
atlas_bgl: &wgpu::BindGroupLayout,
|
atlas_bgl: &wgpu::BindGroupLayout,
|
||||||
color_format: wgpu::TextureFormat,
|
color_format: wgpu::TextureFormat,
|
||||||
sample_count: u32,
|
sample_count: u32,
|
||||||
|
content_stencil: &wgpu::StencilState,
|
||||||
) -> (wgpu::RenderPipeline, wgpu::RenderPipeline) {
|
) -> (wgpu::RenderPipeline, wgpu::RenderPipeline) {
|
||||||
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor {
|
||||||
label: Some("text.wgsl"),
|
label: Some("text.wgsl"),
|
||||||
|
|
@ -298,7 +299,7 @@ pub fn create_pipelines(
|
||||||
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
format: wgpu::TextureFormat::Depth24PlusStencil8,
|
||||||
depth_write_enabled,
|
depth_write_enabled,
|
||||||
depth_compare,
|
depth_compare,
|
||||||
stencil: wgpu::StencilState::default(),
|
stencil: content_stencil.clone(),
|
||||||
bias: wgpu::DepthBiasState::default(),
|
bias: wgpu::DepthBiasState::default(),
|
||||||
}),
|
}),
|
||||||
multisample: wgpu::MultisampleState {
|
multisample: wgpu::MultisampleState {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue