Commit Graph

13 Commits

Author SHA1 Message Date
TÖRÖK Attila f9f4c3bb82 render/wgpu: Drop `naga_oil` in favor of manual string manipulation 2024-05-16 20:24:49 +02:00
Nathan Adams de975a9727 wgpu: Merge Transforms and ColorAdjustments 2024-01-27 21:37:22 +01:00
Nathan Adams befce41e11 wgpu: Remove push constant support - simplifies code significantly, and it should be same perf now 2024-01-27 21:37:22 +01:00
Nathan Adams 0cca4983e4 wgpu: Merge gradient shaders together 2023-03-06 23:22:09 +01:00
Nathan Adams 0ac2a3f361 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
relrelb 65be2adc63 wgpu: Bump to `0.13.0`
Based on the work in #6717, plus additional adaptions mentioned in
https://github.com/gfx-rs/wgpu/blob/master/CHANGELOG.md#wgpu-013-2022-06-30,
and more not-mentioned but required changes.

Also bump `wasm-bindgen` to `0.2.81` (along with its helper crates), as
required by the new `wgpu` version.

Note that I don't fully understand some of the required changes, notably:
* `wgpu::PresentMode::Mailbox` no longer works on my machine (Windows 11) -
The `wgpu` documentation says that `wgpu::PresentMode::Fifo` is the
only guaranteed to be supported, so I switched over to it instead.
* `self.staging_belt.recall()` doesn't return a `Future` anymore -
I assume it became synchronous so I simply removed the `executor`
from there.
2022-07-02 16:44:37 -07:00
Mike Welsh 121c2577b4 wgpu: Clamp alpha in shaders (fix #6954) 2022-05-12 14:50:25 -07:00
Mike Welsh 4a38d36cd7 wgpu: Output premultiplied alpha 2022-04-17 08:33:51 -07:00
Mike Welsh 9c11870a08 wgpu: Use linear color render target
Always use a non-sRGB texture as the render target so that color
and alpha blending are in sRGB space, matching Flash behavior.

If the surface format requires sRGB, render to an intermediate
linear buffer and copy to the surface as a final render step.
2022-04-15 14:52:33 -07:00
Mike Welsh bfe0ee2563 wgpu: Fix gradient shader on vulkan backend
A regression in naga caused a mistranslation of the gradient shader
on the vulkan backend. This caused radial gradients to be rendered
as linear gradients on the vulkan backend. dx12 seems unaffected.

This seems to be cased by a switch statement starting with a default
case Re-order the case statements to avoid this. Looks like it's been
fixed in naga master.
2022-01-22 20:54:18 -08:00
Mike Welsh 1e28e1da11 chore: Bump to wgpu 0.12 2022-01-19 13:20:27 -08:00
Mike Welsh 26e0432ccc wgpu: Fix some invalid WGSL
naga is currently lenient about some things which are invalid by
the WGSL spec. The Tint WGSL compiler disagreed, so these shaders
failed to compile in Chrome.
2021-10-25 21:59:09 -07:00
Mike Welsh e10d0fcbe7 wgpu: Switch shaders to WGSL 2021-10-24 17:20:19 -07:00