Skip to content

Broken text rendering on wasm32 target in Firefox #78

@pacmancoder

Description

@pacmancoder

I have managed to compile hello example to wasm32 target with some changes to winit initialization, however, when trying to render new text on the next frame, part of the text disappear (e.g I just render text with content that changes each frame with format!("Frame {}!, counter)).

I have modified the example I'm my fork to help reproduce the issue:
https://github.com/pacmancoder/wgpu_glyph/tree/issue-report/wasm32-text-rendering

UPD: Reproduces only on Firefox (v93)

Steps to run example on wasm32

# 0. Install prerequisites
cargo install wasm-bindgen-cli https
# 1. Compile wasm module
cargo build --example hello --target=wasm32-unknown-unknown
# 2. Invoke wasm-bindgen
wasm-bindgen target/wasm32-unknown-unknown/debug/examples/hello.wasm --out-dir . --target web --no-typescript
# 3. run http server
http
# 4. Open 127.0.0.1:8000 in browser

Results can be compared with non-wasm32 build of example cargo run --example hello

Normal behavior; Compiled for non-wasm32 target

image

Text artifacts of wasm32 target, part of the text is missing

image

Not sure yet if it is related to wgpu or wgpu_glyph implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions