Closed expenses closed 3 years ago
Hey, thanks!
Does this limitation only apply to Chrome Canary? In that case, it may be a good idea to enable the new code only when targetting Wasm.
This restriction has now been implemented in wgpu, so it should be always enabled. (its part of the webgpu spec)
You might find this change to the capture example useful to refer to https://github.com/gfx-rs/wgpu-rs/pull/348/files
Now that https://github.com/gfx-rs/wgpu-rs/pull/193 has landed, it'd be great to get wgpu_glyph to work in-browser! At the moment, the only browser that WebGPU works okay-ish on is Chrome Canary.
Chrome Canary has a stricter implementation of WebGPU than wgpu, and requires that all textures have a row pitch that is a multiple of 256 bytes. This PR checks the width of the data that the cache is updated with, and allocated a new vector with the correct padding if the width is not a multiple of 256.