szeged / webrender

A GPU-based renderer for the web
https://doc.servo.org/webrender/
Mozilla Public License 2.0
45 stars 7 forks source link

Move to the new gfx-rs swapchain API #317

Closed kvark closed 5 years ago

kvark commented 5 years ago

See https://gfx-rs.github.io/2019/10/01/update.html

Quad example update - https://github.com/gfx-rs/gfx/commit/40a905ff0ccd583f18ced4250c27b7765716a16f#diff-3396f7c6f19ad0882c9d181e08c8c702

zakorgy commented 5 years ago

With the new swapchain API we can't directly access the frame images. Steps needs to be done before we can move to the new API:

kvark commented 5 years ago

You are right that we can't have this new swapchain model for as long as we need to blit back from the screen :/ And I think it's only the MixBlend mode (with Readback task) that actually needs to blit from the screen. There are two ways to solve this that I could see:

  1. reword the new swapchain model to allow more usages and expose images... this means we'll have to request the ability to read images back in WR unconditionally, which potentially comes at a cost.
  2. in WR force the surface allocated if we see a MixBlend mode. That means that any readbacks would only need to be done from a render target.
kvark commented 5 years ago

More stuff to read about (1) - https://github.com/gpuweb/gpuweb/issues/437

zakorgy commented 5 years ago

Fixed in #331