hecrj / wgpu_glyph

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

Creating an unrelated buffer stops text from rendering #38

Open MichaelBaker opened 4 years ago

MichaelBaker commented 4 years ago

Hello, I'm not sure if this is a problem with wgpu, wgpu_glyph, or my understanding of wgpu so I'm posting it to both projects.

I've created a minimal runnable example here: https://github.com/MichaelBaker/wgpu-glyph-example

This is the line that causes the problem. If you comment this line out, the text renders correctly: https://github.com/MichaelBaker/wgpu-glyph-example/blob/5bcd7200d1a27df7add4a68b744b41df9b1de681/src/main.rs#L70

My best guess is that creating a buffer here corrupts or invalidates wgpu_glyph's cached transform buffer because if I remove this check from the pipeline it starts rendering correctly: https://github.com/hecrj/wgpu_glyph/blob/e53659e8bc7f4f8295365366354642778587cc84/src/pipeline.rs#L353

Otherwise this library has worked great so thanks for putting it together.

I'm on a Macbook Pro running macOS 10.15.3 (Catalina).

Here is the wgpu issue: https://github.com/gfx-rs/wgpu-rs/issues/288