Commit Graph

158 Commits

Author SHA1 Message Date
Nathan Adams ab8b1c654c chore: Use workspace version for js-sys 2024-04-04 17:29:00 +02:00
Nathan Adams d8fec1cabc chore: Use workspace version for image 2024-04-04 17:29:00 +02:00
Nathan Adams 2036d85a95 chore: Use workspace version for futures 2024-04-04 17:29:00 +02:00
Nathan Adams 2bd1ef47b7 chore: Use workspace version for flate2 2024-04-04 17:29:00 +02:00
Nathan Adams c3711e3953 chore: Use workspace version for enum-map 2024-04-04 17:29:00 +02:00
Nathan Adams 26df7d78c4 chore: Use workspace version for chrono 2024-04-04 17:29:00 +02:00
Nathan Adams 937664e737 chore: Use workspace version for bytemuck 2024-04-04 17:29:00 +02:00
Nathan Adams 4e3cd75c30 chore: Use workspace version for bitflags 2024-04-04 17:29:00 +02:00
Nathan Adams 8a390163d6 chore: Use workspace version for async-channel 2024-04-04 17:29:00 +02:00
Nathan Adams 5ed6115dcc frontend-utils: Add new package and moved custom toml parsing utilities there 2024-04-04 11:16:50 +02:00
TÖRÖK Attila 9822e96b41 chore: Bump `egui` to `v0.27.2` 2024-04-03 08:01:53 +02:00
TÖRÖK Attila a59ec413ad chore: Update `egui` to `v0.27.1` 2024-03-29 14:46:25 +01:00
TÖRÖK Attila 5b4f808769 chore: Update `egui` to `v0.27.0` 2024-03-29 10:02:52 +01:00
renovate[bot] 9dfc6dc224 fix(deps): update rust dependencies 2024-03-26 13:56:59 +01:00
Adrian Wielgosik a7d5a5ca36 build: Silence clippy assigning_clones lint 2024-03-23 19:23:18 +01:00
TÖRÖK Attila 7a269c054d fix(deps): update rust dependencies 2024-03-18 12:21:47 +01:00
renovate[bot] a916369f21 fix(deps): update rust dependencies 2024-03-06 21:58:40 +01:00
TÖRÖK Attila 55773f0205 chore: Replace `generational-arena` with `slotmap` 2024-03-02 19:42:11 +01:00
renovate[bot] 8b8d028816 chore: Bump wgpu to 0.19.3, naga to 0.19.2 2024-03-01 23:58:50 +01:00
TÖRÖK Attila 05fc77e8cd ci: Turn off LTO, document the settings in the `ci` Cargo profile
And set the number of codegen units.
2024-02-28 00:20:47 +01:00
TÖRÖK Attila a23ebb0366 ci: Actually enable incremental building (despite the default in rust-cache) 2024-02-28 00:20:47 +01:00
TÖRÖK Attila 12151f5125 ci: Add a dedicated Cargo profile, test with that 2024-02-26 08:42:24 +01:00
renovate[bot] 6b89737093 fix(deps): update rust dependencies 2024-02-19 11:32:22 +01:00
renovate[bot] 1651b7a5b0 desktop: chore: Update `egui` to 0.26.2 2024-02-16 01:52:41 +01:00
TÖRÖK Attila 28c380cfac desktop: Update egui to 0.26.0 2024-02-05 19:05:10 +01:00
renovate[bot] c044f57bc1 chore(deps): update rust crate naga_oil to 0.13.0 2024-02-04 20:50:19 -05:00
Aaron Hill 78873e3670 avm2: Add new 'stub-report' binary crate
This writes the AVM2 stub report to the specified path.
2024-01-31 20:22:06 -05:00
TÖRÖK Attila 733459a296 chore: Switch to wgpu 0.19.1 from git 2024-01-22 01:51:07 +01:00
Nathan Adams 8c6f8231d6 deps: Use wgpu by commit, for DX12 fix 2024-01-21 19:36:08 +01:00
Nathan Adams 4d16e24889 wgpu: Update wgpu and naga to 0.19 2024-01-21 19:36:08 +01:00
Nathan Adams f65060e8c9 desktop: Update winit to 0.29.10 and egui to 0.25.0 2024-01-16 21:10:36 +01:00
TÖRÖK Attila f0ed5c7211 chore: Upgrade gc-arena to 0.5.0 2024-01-06 09:45:35 +01:00
TÖRÖK Attila 60f01fd517 chore: Move lint configuration from `.cargo/config.toml` to `Cargo.toml`
This got stabilized in Rust 1.74.
2024-01-05 11:28:19 +01:00
TÖRÖK Attila f5f8962ce1 chore: Update naga to 0.14.2, run `cargo update` 2023-12-18 17:07:16 -05:00
TÖRÖK Attila bf9cf92af8 render/wgpu: Update wgpu to 0.18.0, naga to 0.14.1, naga_oil to 0.11.0, egui to 0.24.1 2023-12-14 01:36:42 +01:00
renovate[bot] 2a83274c7f fix(deps): update rust dependencies 2023-11-19 21:09:42 -05:00
Nathan Adams 673d52f013 tests: Move test framework into its own crate 2023-11-10 22:02:18 +01:00
renovate[bot] cd01bfe7d6 fix(deps): update rust dependencies 2023-10-23 02:55:11 +02:00
renovate[bot] b427940431 fix(deps): update rust dependencies 2023-10-16 09:51:22 +02:00
TÖRÖK Attila 6c5187621d build: Switch back to the v0.17 branch in the main wgpu repo 2023-10-16 00:03:37 +02:00
TÖRÖK Attila 9506a66803 nit: Clean up Cargo.toml files slightly (remove unnecessary `version =` maps) 2023-10-15 22:39:18 +02:00
TÖRÖK Attila 602154b1b7 core,desktop: Switch to egui v0.23.0
Since it's compatible with wgpu 0.17.x.
2023-10-09 18:51:01 -04:00
renovate[bot] abed8c1a1d chore(deps): update rust crate wgpu to 0.17.1 2023-10-04 17:42:02 -04:00
Aaron Hill 2dcd783261 render: Disable wgpu unused shader output check when possible
Since wgpu hasn't yet released a version with this feature, I manually
backported it to the 0.17 branch.
This doesn't work on Windows (HLSL), but works on all other platforms.
2023-09-30 17:59:36 -04:00
Aaron Hill 1c0ae0b6d8 render: Bump wgpu to 0.17 and naga to 0.13 2023-09-07 18:49:59 -04:00
Moulins 87437c1d6b avm2: use `RefLock` instead of `GcCell` in avm2's scope chain
Also bumps gc-arena to be able to use `Write<Option<_>>::as_write`
2023-08-26 11:00:40 +02:00
renovate[bot] 93f08d7738 chore(deps): lock file maintenance rust dependencies 2023-08-14 23:58:45 +02:00
TÖRÖK Attila 0ce4990035 chore: Pin wgpu and naga crates until naga_oil and egui are updated. 2023-08-08 23:19:16 +02:00
renovate[bot] 477ff400a7 chore(deps): lock file maintenance rust dependencies 2023-08-02 13:36:13 +02:00
sleepycatcoding a0e40287c9 tests: Rename socket-mock utility to mocket 2023-07-26 14:01:03 +02:00
sleepycatcoding 3e8ee00a67 tests: Move SocketEvent into ruffle_socket_format crate 2023-07-26 14:01:03 +02:00
sleepycatcoding 88626b7212 tests: Add experimental socket_mock tool
This is used to help to create/test socket.json files against real Flash Player to verify behavior.
2023-07-26 14:01:03 +02:00
renovate[bot] f0607d6a1f chore(deps): lock file maintenance rust dependencies 2023-07-11 22:42:51 +02:00
moulins f5b4fbce77
Upgrade to new `gc-arena` API (#11182)
* core: add temporary, ruffle-internal copy of `gc-arena` crate

This will allow bumping the upstream `gc-arena` version while
reexporting our own version of the old `GcCell` API, so that
Ruffle's code can be gradually migrated.

Once the migration is done, this crate should be removed.

* core: bump `gc-arena` to kyren/gc-arena#56

Add back the removed `GcCell` to our internal facade crate

* core: bump `gc-arena` to current master

This bump renames `Gc::allocate` to `Gc::new`

* core: rename `GcCell::allocate` to `GcCell::new`, to match `Gc`

* core: bump gc-arena to (slighly after) v0.3.1

Add typedefs for old `*Context` names in the gc-arena facade crate

* core: replace uses of `CollectionContext<'_>` by `&Collection`

* core: Add `gc()` convenience method for `*Context` and `Activation` types

This allows shortening most instances of `[activation.]context.gc_context`
to `activation.gc()` or `context.gc()` (but not all instances, because of
borrowck) Note that this doesn't actually do these shortenings to avoid
major code churn.
2023-07-09 17:04:25 -04:00
renovate[bot] 13b1078142 chore(deps): lock file maintenance rust dependencies 2023-07-03 08:28:13 +03:00
Aaron Hill 6e1f00edf2
render: Implement more PixelBender features (#11800) 2023-07-01 13:50:43 -04:00
David Wendt 5b93a9e316 flv: Add new crate for FLV (de)muxing 2023-06-30 16:14:28 -06:00
Aaron Hill 69fce3f7f8
wpgu: Initial implementation of PixelBender shader execution (#11441)
* wpgu: Initial implementation of PixelBender shader execution

The implementation is split across four crates:
* `ruffle_render` now holds the main PixelBender bytecode parsing
   implementation (previously, this was in `ruffle_core`).
* `ruffle_core` holds some helper functions for converting between
   AVM2 `Value`s and the PixelBender vector types.
* `naga-pixelbender` (newly created) constructs a Naga `Module`
  from parsed PixelBender bytecode
* `ruffle_render_wgpu` sets up the render pipeline for the shader
  constructed by `naga-pixelbender`, and actually executes the shader.

The Actionscript-side shader parameters are passed in through uniforms.
This allows us to cache the compiled `naga::Module` and associated
wgpu types inside `ShaderData`, when it's first created. Each invocation
of a `ShaderJob` only needs to create a bind group and render pass.

Limitations:

* Only a few of the PixelBender opcodes are implemented - however, this is
enough to get Stemlands cannon rotation working, as well as a cool
"donut" shader that I found and included as a test.
* PixelBender matrix types are not supported.
* Only BitmapData is supported as an input/output type - Flash Player
  also supports using Vector and ByteArray
* ShaderJob execution is always synchronous.

* Adjust comments

* Address review comments
2023-06-15 22:50:24 +00:00
Aaron Hill cd2c7f6f2f tests: Enable tracing_subscriber in tests
Previously, we weren't displaying any Ruffle logs when running tests.
2023-06-14 17:15:31 -05:00
Nathan Adams eb70a4f361 core: Update gc_arena to 63dab12871321e0e5ada10ff1f1de8f4cf1764f9 2023-06-03 09:11:06 +02:00
Moulins 011cdd96ba core: don't keep strong references to interned strings in the interner.
This is done by implementing a simple WeakSet which clears its stale
entries during tracing.
2023-04-27 00:17:31 +02:00
TÖRÖK Attila 309f761387 chore: Select "desktop" as the default workspace member
This makes the cargo command to run the player simpler.
2023-04-09 12:26:18 -07:00
TÖRÖK Attila 0f7c362069 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
Aaron Hill d72a8e7125 core: Run frames for 'orphan' AVM2 MovieClips
When a MovieClip is an 'orphan' (it has no parent),
it still has frames run (including frame scripts). Some SWFS
like SteamBirds and 'This is the Only Level TOO' rely on this behavior,
so we need to implement it.

The overall idea is straightforward - we keep a global list of
orphan movies, which we add to whenever we unset the parent for a movie.
This list stores weak references for consistency with Flash.
When we run a frame, we process entries in the root movie list,
in addition to the normal recursive processing from the `Stage`.

However, exactly matching Flash's output turned out to be quite tricky.
The particular sequence of calls I make in `run_all_phases_avm2` makes Ruffle
pass two complicated test cases, but there could still be lurking bugs.

This is enough to get SteamBirds to the first level (which doesn't
render due to a different error).
2023-03-06 20:53:35 -06:00
Aaron Hill fc3c2a2297 Update wgpu
This requires us to bump naga as well, and switch to a fork
of naga_oil that compiles against the latest naga.
2023-01-23 11:31:04 +01:00
Aaron Hill 6fe7af58d5 Move back to upstream wgpu repository
We're relying on unreleased changes, so we depend on the latest commit
from their repository.
2023-01-23 11:31:04 +01:00
Nathan Adams fb78a39125 wgpu: Switch to experimental crate naga_oil for combining shaders 2023-01-10 09:39:28 +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
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
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
Aaron Hill d0230a2bea render: Add 'naga-agal' crate to compile AGAL shaders to Naga
This is the first part of the Stage3D implementation, and can
be reviewed independently.

Stage3D shaders use the Adobe Graphics Assembly Language (AGAL),
which is a binary shader format. It supports vertex attributes,
varying registers, program constants (uniforms), and texture sampling.

This PR only implements a few parts of AGAL:
* The 'mov' and 'm44' opcodes
* Vertex attributes, varying registers, program constants, and 'output'
 registers (position or color, depending on shader type)

This is sufficient to get a non-trivial Stage3D program
running (the rotating cube demo from the Adobe docs).

The output of `naga-agal` is a `naga::Module`. This can be passed
directly to wgpu, or compiled into a shader language using
a Naga backend (glsl, wgsl, SPIR-V, etc). The test suite
output WGSL files, and uses the 'insta' crate to compare against
saved files on disk.

Currently, the only real way to write AGAL bytecode is using
the Adobe-provided 'AGALMiniAssembler' flash class.
This class assembles the textual reprentation of AGAL into
the binary format.

To make writing tests easier, I've added a 'agal_compiler' test, which
can easily be modified to add more Agal textual assembly.
2022-10-17 13:22:02 -05: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
= 7c839ef8ae video: Add software video crate, moved VideoDecoder to it 2022-09-04 17:46:58 -07:00
= b7cf800f88 video: Made ruffle_video crate, moved core video Error to it 2022-09-04 17:46:58 -07:00
Nathan Adams c4488fc883 render: Removed common_tess and moved tessellator 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
Aaron Hill f629a91e53
avm2: Allow implementing classes in ActionScript in custom `playerglobal`
This PR adds support for building a custom `playerglobal.swf`, which can be used
to implement builtin Flash classes in ActionScript. This file is embedded into Ruffle
using `include_bytes!`, and loaded during initialization.
As an example, the `Point` class is reimplemented
in ActionScript, and `flash.text.AntiAliasType` is added.

The ActionScript compilation process is performed by `core/build.rs`.
See that file, along with `core/src/avm2/globals/README.md`, for
more details.
2022-06-15 22:00:17 +03:00
David Wendt ac86dee3a6 tests: Add a library defining the file format for Ruffle test input.
I intend to share this code across both Ruffle and FlashTAS (another project that allows running input tests on Flash Player), hence why it's a separate library from Ruffle's tests crate.
2022-04-25 16:29:07 -06:00
David Wendt 79ebcc6dd3 web: Add a crate for a stub binary that builds a Safari Web Extension 2022-04-12 22:14:22 -07:00
Moulins 1911aa9a6b Move core::string into separate ruffle_wstr crate. 2022-03-26 13:42:57 -07:00
TÖRÖK Attila 483028707f web: Add custom profiles to separate the build cache for the two wasm modules 2022-01-13 12:28:00 -08:00
TÖRÖK Attila 3869950578 video/vp6: Add VP6[A] video decoding support
Gated behind the "vp6" feature, enabled by default.
Utilizing a heavily stripped-down version of the NihAV project,
retaining only the VP6 decoder, relicensed under MIT.
Including VP6WithAlpha decoding, proper FrameDependency reporting,
and cropping the unwanted encoded pixels on the right/bottom manually.
2021-10-04 22:33:06 -07:00
David Wendt 76272fd22c video: Always optimize codecs on all profiles. 2021-08-21 14:13:55 -06:00
Aaron Hill 08d0829177 Move all SWF tests out of `core` to new `tests` package
This allows `regressions_tests.rs` to depend on other crates in the
workspace, such as `render`, without introducing a cyclic dependency.

Split out from #4054
2021-05-04 11:47:59 -07:00
Mike Welsh 35d380f48c chore: Switch to new cargo resolver 2021-04-23 12:44:27 -07:00
Nathan Adams 9ab03b4da6 exporter: Added exporter tool for capturing images of swfs (related to #523) 2020-05-11 01:09:07 -07:00
Mike Welsh fa5c09b0cd web: Add WebGL render backend 2020-05-02 10:38:18 -07:00
Nathan Adams f0445d94b8 render: Add wgpu-rs based renderer, used by desktop 2020-04-30 08:48:33 +02:00
Mike Welsh 834756c167 render: Separate tesselation code into render/common_tess 2020-04-29 23:26:41 -07:00
Mike Welsh 6fb0046bd3 render: Move Glium renderer to separate subcrate 2020-04-29 23:26:41 -07:00
Mike Welsh 87bf0f44c4 render: Move canvas renderer to separate subcrate 2020-04-29 23:26:41 -07:00
Mike Welsh a0bc9d3ec9 chore: Set to abort on panic
This shaves ~20% size off the desktop build.
2020-03-16 01:16:15 -07:00
Mike Welsh cc90d7b0ae chore: Actually don't optimize build dependencies in release profile
Previous commit incorrectly set the override in the dev profile.
2020-02-13 15:28:15 -08:00
Mike Welsh 6ea2a55207 chore: Don't optimize build dependencies
Rust 1.41 shipped with the ability to specify optimization level
per dependency/dev-dependency.

This speeds up a full release build by ~20% on my machine.
2020-02-12 15:43:58 -08:00
Mike Welsh b27bc578e0 core: Add enum_trait_object proc macro
The enum_trait_object attribute macro can be used to define an enum where
each variant holds an implementor of a trait. It implements all
methods to forward to the underlying object, as well as `From` impls.

This an aliternative to using trait objects that gets along nicer
with `gc-arena`.
2019-12-10 01:36:01 -08:00
Nathan Adams 59d39d6572 Added a bulk swf scanning tool 2019-10-11 16:37:15 -07:00
Mike Welsh 52b6832db2 chore: Move swf-rs to ruffle workspace
Move the swf-rs crate into the Ruffle workspace proper instead of
having a separate repo. This makes it easier to make changes to
the SWF parsing code during development. swf-rs can still be
published as its own crate from the subfolder.
2019-10-02 18:58:58 -07:00
Mike Welsh 07c6addb8b core: Remove patch from Cargo.toml 2019-05-08 11:59:46 -07:00
Mike Welsh 5e88f43280 Color transforms 2019-05-01 09:55:54 -07:00
Mike Welsh eb6c23d967 Work 2019-04-30 01:53:21 -07:00