hecrj / wgpu_glyph

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

Update `wgpu` to `0.8` #67

Closed agausmann closed 3 years ago

agausmann commented 3 years ago

I drafted this up before I noticed #62 , but I'm submitting this separately anyway for a couple of reasons:

agausmann commented 3 years ago

Here are the logs with RUST_LOG=trace set, without and with the wgpu/cross feature enabled (naga and spirv_cross, respectively)

wgpu_glyph_naga.log wgpu_glyph_spirv_cross.log

agausmann commented 3 years ago

I've encountered another issue, this time with gfx_backend_vulkan running on Windows 10. This is only present when using naga, the issue goes away when compiling with --features wgpu/cross

Missing glyphs

agausmann commented 3 years ago

The shader translation errors have partially been fixed by gfx-rs/naga#815, still pending: gfx-rs/naga#814

hecrj commented 3 years ago

@agausmann Awesome. I guess we need to wait until the fixes in naga are released, or we can rely on a commit hash for the time being.

agausmann commented 3 years ago

Yup, both of those issues have been fixed.

There are some later commits to naga that are breaking changes, but I've gotten cargo run --example hello to at least run by specifying the following (this commit hash is the merge commit of gfx-rs/naga#821):

[patch.crates-io]
naga = { git = "https://github.com/gfx-rs/naga", rev = "dbfc11a" }

However, now that we've gotten past the syntax errors, there are still semantic errors with the generated code.

So for now I'd be more comfortable requiring features = ["cross"], ie. forcing wgpu to use the old spirv_cross translation backend, until the rest of the compile errors are resolved. This also has the advantage of allowing a new version of wgpu_glyph to be published to support wgpu 0.8 (whereas patching dependences might cause some issues or may be completely disallowed in versions published to crates.io)

Alternatively, we might be able to sidestep some of these errors by switching to WGSL like in #62.