hecrj / wgpu_glyph

A fast text renderer for wgpu (https://github.com/gfx-rs/wgpu)
https://docs.rs/wgpu_glyph
MIT License
450 stars 78 forks source link

Depth example doesn't show anything on macOS #88

Open jkelleyrtp opened 2 years ago

jkelleyrtp commented 2 years ago

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.

juliusl commented 2 years ago

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);