Commit Graph

34 Commits

Author SHA1 Message Date
renovate[bot] 130144a76d fix(deps): update rust dependencies 2023-03-05 20:43:46 -06:00
relrelb abcdc2a851 render: Enable `serde`'s `derive` feature
Otherwise `cargo check` fails when run right from the `render/`
directory.
2023-03-04 21:54:23 +02:00
renovate[bot] 71e24eedba fix(deps): update rust dependencies 2023-02-27 11:48:53 +02:00
renovate[bot] fed24aa243 fix(deps): update rust dependencies - wasm-bindgen related 2023-02-13 02:57:52 +01:00
Nathan Adams 68761608fc desktop: Add --quality option 2023-02-06 16:08:04 +01:00
Nathan Adams b270d1bbd7 render: Move StageQuality from core to render 2023-02-06 16:08:04 +01:00
Nathan Adams a3a7f79f04 render: Switch from log to tracing 2023-02-05 18:02:19 +01:00
Nathan Adams 7d234956eb tests: Move tests away from giant macro to individual test.toml files that describe the test 2023-01-27 13:53:43 +01:00
Moulins d332a174c3 Bump `gc-arena` to current master revision
This required small changes to some Debug impls that were missed in #8964
2023-01-06 18:22:43 -05:00
Nathan Adams cb6d72b49b wgpu: Split up gradient shader based on type and repeat 2023-01-03 03:39:13 +01:00
Mike Welsh 696c9062d3 chore: Inherit cargo metadata from workspace
Use workspace inheritance added in Rust 1.64 to de-duplicate
various settings across all packages.
2022-12-16 15:53:59 -08:00
Marco Grassi ad81b3bf14 upgrade lock and toml dependencies 2022-11-26 14:04:59 -05:00
Aaron Hill b8745f0ff1 avm2: Partially implement Stage3D for wgpu backend
This PR implements core 'stage3D' APIs. We are now able
to render at least two demos from the Context3D docs - a simple
triangle render, and a rotating cube.

Implemented in this PR:
* Stage3D access and Context3D creation
* IndexBuffer3D and VertexBuffer3D creation, uploading, and usage
* Program3D uploading and usage (via `naga-agal`)
* Context3D: configureBackBuffer, clear, drawTriangles, and present

Not yet implemented:
* Any 'dispose()' methods
* Depth and stencil buffers
* Context3D texture apis
* Scissor rectangle

General implementation strategy:

A new `Object` variant is added for each of the Stage3D objects
(VertexBuffer3D, Program3D, etc). This stores a handle to the
parent `Context3D`, and (depending on the object) a handle
to the underlying native resource, via `Rc<dyn
SomeRenderBackendTrait>`).

Calling methods on Context3D does not usually result in an immediate
call to a `wgpu` method. Instead, we queue up commands in our
`Context3D` instance, and execute them all on a call to `present`.
This avoids some nasty wgpu lifetime issues, and is very similar
to the approah we use for normal rendering.

The actual rendering happens on a `Texture`, with dimensions
determined by `createBackBuffer`. During 'Stage' rendering,
we render all of these Stage3D textures *behind* the normal
stage (but in front of the overall stage background color).
2022-11-25 21:43:00 -07:00
dependabot[bot] c2319da673 build(deps): bump gif from 0.11.4 to 0.12.0
Bumps [gif](https://github.com/image-rs/image-gif) from 0.11.4 to 0.12.0.
- [Release notes](https://github.com/image-rs/image-gif/releases)
- [Changelog](https://github.com/image-rs/image-gif/blob/master/Changes.md)
- [Commits](https://github.com/image-rs/image-gif/compare/v0.11.4...v0.12.0)

---
updated-dependencies:
- dependency-name: gif
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-21 16:12:02 -07:00
dependabot[bot] 63a297608e build(deps): bump lyon from 1.0.0 to 1.0.1
Bumps [lyon](https://github.com/nical/lyon) from 1.0.0 to 1.0.1.
- [Release notes](https://github.com/nical/lyon/releases)
- [Commits](https://github.com/nical/lyon/commits)

---
updated-dependencies:
- dependency-name: lyon
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-11-08 09:00:31 +02:00
dependabot[bot] 9e3d849db5 build(deps): bump png from 0.17.6 to 0.17.7
Bumps [png](https://github.com/image-rs/image-png) from 0.17.6 to 0.17.7.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-31 23:14:44 +02:00
dependabot[bot] 973b95396a build(deps): bump jpeg-decoder from 0.2.6 to 0.3.0
Bumps [jpeg-decoder](https://github.com/image-rs/jpeg-decoder) from 0.2.6 to 0.3.0.
- [Release notes](https://github.com/image-rs/jpeg-decoder/releases)
- [Changelog](https://github.com/image-rs/jpeg-decoder/blob/master/CHANGELOG.md)
- [Commits](https://github.com/image-rs/jpeg-decoder/compare/v0.2.6...v0.3.0)

---
updated-dependencies:
- dependency-name: jpeg-decoder
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-24 23:35:49 +03:00
relrelb 178bf4fe24 chore: Extract Cargo `edition` to `[workspace.package]`
This is possible since Rust 1.64.0: https://blog.rust-lang.org/2022/09/22/Rust-1.64.0.html#cargo-improvements-workspace-inheritance-and-multi-target-builds
2022-10-14 22:13:29 +03:00
relrelb dbfd28e708 web: Bump `wasm-bindgen` to 0.2.83
This restores commit 084b252030.

As usual, also bump its helper crates (`js-sys`, `web-sys` and
`wasm-bindgen-futures`) to the latest versions.
2022-10-14 21:49:40 +03:00
dependabot[bot] a0ef304ae9 build(deps): bump smallvec from 1.9.0 to 1.10.0
Bumps [smallvec](https://github.com/servo/rust-smallvec) from 1.9.0 to 1.10.0.
- [Release notes](https://github.com/servo/rust-smallvec/releases)
- [Commits](https://github.com/servo/rust-smallvec/compare/v1.9.0...v1.10.0)

---
updated-dependencies:
- dependency-name: smallvec
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-04 01:44:21 +03:00
relrelb b5084eef25 Revert "web: Bump `wasm-bindgen` to 0.2.83"
This reverts commit 1954f6162f.
2022-09-24 09:52:25 +03:00
relrelb 1954f6162f web: Bump `wasm-bindgen` to 0.2.83
This reverts commit cf721d45f9 and restores
commit 084b252030, this time without updating
`web-sys`, due to being coupled to `wgpu`.
2022-09-23 17:23:35 +03:00
Daniel Jacobs cf721d45f9 Revert "web: Bump `wasm-bindgen` to 0.2.83"
This reverts commit 084b252030.
2022-09-15 22:33:07 +02:00
relrelb 084b252030 web: Bump `wasm-bindgen` to 0.2.83
As usual, also bump its helper crates (`js-sys`, `web-sys` and
`wasm-bindgen-futures`) to the latest versions.

Due to https://github.com/rustwasm/wasm-bindgen/pull/3031, use the
`serde-wasm-bindgen` crate as a replacement to the deprecated
`JsValue::from_serde` function.
2022-09-14 09:03:31 +03:00
relrelb e0aba46bb2 chore: Remove unused `image` dependency
This basically reverts #7254 for all `.toml` files, except for `wgpu`
where it's actually needed on both desktop and web.
2022-09-07 13:09:29 -07:00
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
dependabot[bot] d7a224d2c7 build(deps): bump png from 0.17.5 to 0.17.6
Bumps [png](https://github.com/image-rs/image-png) from 0.17.5 to 0.17.6.
- [Release notes](https://github.com/image-rs/image-png/releases)
- [Changelog](https://github.com/image-rs/image-png/blob/master/CHANGES.md)
- [Commits](https://github.com/image-rs/image-png/commits)

---
updated-dependencies:
- dependency-name: png
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-05 15:14:36 -07:00
relrelb 0d6462cfab render: Remove `gc-arena` dependency
It was only used to make structs `#[derive(gc_arena::Collect)]`, and
generally it doesn't make much sense that `render` needs to be GC-aware.
So instead annotate `render` fields in `core` with `#[collect(require_static)]`.
2022-09-02 09:49:18 -07:00
= 03eb769a33 render: Made render use a real Error enum and not generic box<error> 2022-08-25 23:43:21 +02:00
Nathan Adams c4488fc883 render: Removed common_tess and moved tessellator to render 2022-08-14 18:38:14 -07:00
Nathan Adams 824b4aa8d1 render: Moved render backend from core to render 2022-08-14 18:38:14 -07:00
Nathan Adams 35082b687f render: Moved shape_utils from core to render 2022-08-14 18:38:14 -07:00
Nathan Adams 9fd8fd938e render: Moved render utils from core to render 2022-08-14 18:38:14 -07:00
Nathan Adams bc0c7cbccb render: Made new render crate, moved Bitmap stuff to it 2022-08-14 18:38:14 -07:00