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

Add support for passing a multisample state #91

Closed wohe closed 1 year ago

wohe commented 2 years ago

This adds a function to the builder to allow setting the multisample state. If it is not called, the default is used as before.

wohe commented 2 years ago

@hecrj @konall This is similar to #72, but attempts to add support without a breaking change. It makes it possible to draw text to a multisample texture.

Different from #72 is that it does not add multisample resolution which seems an orthogonal change to me:

  1. Already before it was possible to resolve the multisample texture first and then draw text without multisampling.
  2. This change makes it possible to draw text to the multisample texture, do further render passes, and resolve at the end. This includes adding a render pass that does nothing besides multisample resolution. This is similar to the clear render pass added in #72 in the MSAA example: you cannot clear implicitly if you happen to render text first.
  3. What is not supported by this PR is resolving the multisample texture as part of the implicit render pass which happens when drawing text.