ruffle/render/wgpu/src
Aaron Hill 455124d3ba render: Fix blending onto BitmapData contents
When rendering to an offscreen texture for `Bitmapdata.draw`,
we first render to a temporary frame buffer, and then copy the contents
of the frame buffer back to the target texture. However, this results
in blend modes being incorrectly applied - for example, rendering with
BlendMode.SUBTRACT will subtract against the framebuffer (which starts
with each pixel as 0x00000000), instead of the previous BitmapData
contents.

To fix this, we now use our texture target as the frame buffer
when performing `render_offscreen`. This ensure that we blend
over existing pixels (taking into account the `blendMode` provided
in the `BitmapData.draw` call).

When multisampling is enabled, we use a copy pipeline to copy
the existing contents of our texture to a fresh multisampled frame
buffer (the non-multisampled texture target becomes our resolve buffer).
2023-02-23 09:52:56 -06:00
..
context3d core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
surface render: Fix blending onto BitmapData contents 2023-02-23 09:52:56 -06:00
backend.rs render: Fix blending onto BitmapData contents 2023-02-23 09:52:56 -06:00
bitmaps.rs wgpu: Merge bitmap bind groups 2 and 3 2022-09-11 09:07:53 +02:00
blend.rs wgpu: Implement Multiply blend mode as a trivial blend 2023-01-12 10:54:03 -05:00
buffer_builder.rs wgpu: Reuse the same vertex and index buffer for an entire mesh 2023-02-05 18:02:19 +01:00
buffer_pool.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
clap.rs chore: Fix `clap` update 2022-10-05 21:33:34 +03:00
descriptors.rs render: Fix blending onto BitmapData contents 2023-02-23 09:52:56 -06:00
globals.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
layouts.rs wgpu: Implement blur filter 2023-02-05 18:41:43 +01:00
lib.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
mesh.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
pipelines.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
shaders.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
surface.rs render: Fix blending onto BitmapData contents 2023-02-23 09:52:56 -06:00
target.rs render: Fix blending onto BitmapData contents 2023-02-23 09:52:56 -06:00
uniform_buffer.rs core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
utils.rs wgpu: Better support for 2x and 8x msaa 2023-02-06 16:08:04 +01:00