ruffle/render/wgpu
Aaron Hill 8425eab1f0 render: Compile a different version of 'bitmap.wgsl' for Stage3D
When using the bitmap.wgsl shader for normal rendering, we need
to saturate immediately after applying the color transformation
to reproduce Flash Player's behavior. This makes the (possibly
transformed) alpha value get multiplied by a in-range color,
instead of a potentially out-of-range color.

However, Stage3D just applies a no-op color transformation,
and should only saturate at the very end
(not after the intermediate division by the original alpha value).

To support both of these requirements, I've added in a new
`early_saturate` ifdef that controls when we apply 'saturate'.
We then compile the shader twice (once with early_saturate=true
and once with early_saturate=false), and use the two versions
in the right pipelines.

We could use a simpler shader for Stage3D - however, it can't just
be a plain copy, as we need to apply the viewport transformation.
For now, I'm re-using the shader code to keep things simple. If
this becomes a performance issue in stage3d, we could revisit this.
2023-03-19 02:15:26 -05:00
..
shaders render: Compile a different version of 'bitmap.wgsl' for Stage3D 2023-03-19 02:15:26 -05:00
src render: Compile a different version of 'bitmap.wgsl' for Stage3D 2023-03-19 02:15:26 -05:00
Cargo.toml wgpu: Update to wgpu 0.15.1, naga 0.11.0, and naga_oil 0.5.0 2023-03-12 16:30:13 -05:00
uniforms.md wgpu: Moved ColorAdjustments into its own bind group, and reuse ColorAdjustments::IDENTITY where we can 2023-01-03 03:39:13 +01:00