ruffle/render/wgpu
Aaron Hill 93607aa86e
avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254)
* avm2: Implement `BitmapData.draw` for `wgpu` backend

This method requires us to have the ability to render directly to a
texture. Fortunately, the `wgpu` backend already supports this in
the form of `TextureTarget`. However, the rendering code required
some refactoring in order to avoid creating duplicate `wgpu` resources.

The current implementation blocks on copying the pixels back
from the GPU to the CPU, so that we can immediately set them in
the Ruffle `BitmapData`. This is likely very inefficient, but will
work for a first implementation.

In the future, we could explore allowing the CPU image data and GPU
texture to be out of sync, and only synchronized when explicitly
necessary (e.g. on `getPixel` or `setPixel` calls).

* Rename `with_offscreen_backend` to `render_offscreen` and use Bitmap

* Don't panic when backend doesn't implement `render_offscreen`
2022-09-06 16:38:48 -05:00
..
shaders wgpu: Try lower limits when full aren't available, and use uniforms for gradients if storage won't work 2022-09-04 18:55:13 -07:00
src avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254) 2022-09-06 16:38:48 -05:00
Cargo.toml avm2: Implement `BitmapData.draw` for `wgpu` backend (#7254) 2022-09-06 16:38:48 -05:00