wgpu_glyph icon indicating copy to clipboard operation
wgpu_glyph copied to clipboard

Depth example doesn't show anything on macOS

Open jkelleyrtp opened this issue 2 years ago • 1 comments

Git cloning + cargo run --example depth produces a window with nothing in it:

Screen Shot 2022-03-16 at 9 33 54 PM

I'm running macOS so I assume wgpu is going through metal.

jkelleyrtp avatar Mar 17 '22 01:03 jkelleyrtp

On line 55 in the example, try changing the compare function from Greater to LessEqual,

    let mut glyph_brush = GlyphBrushBuilder::using_font(inconsolata)
        .depth_stencil_state(wgpu::DepthStencilState {
            format: wgpu::TextureFormat::Depth32Float,
            depth_write_enabled: true,
            depth_compare: wgpu::CompareFunction::LessEqual, <---
            stencil: wgpu::StencilState::default(),
            bias: wgpu::DepthBiasState::default(),
        })
        .build(&device, FORMAT);

juliusl avatar Jul 22 '22 01:07 juliusl