Commit Graph

9835 Commits

Author SHA1 Message Date
Aaron Hill 9d3e96e3a4
render: Implement more Pixelbender opcodes, and fix matrices (#11896) 2023-07-09 16:54:26 +00:00
Aaron Hill b6fae8e214 wgpu: Cache Program3D bind group layout
The bind group layout only depends on the texture registers
(and 2D/cubemap type) accessed by the fragment shader, not on
the runtime texture bound with Context3D. This means that we can
build and cache it when we compile the AGAL program to a Naga
module.

Since the bind group layout is used for the overall pipeline, I've
refactored the shader caching code into `ShaderPairAgal`, which
holds both the vertex and fragment shader bytecode, and compiles
both in the `compile` function.
2023-07-09 12:39:10 -04:00
Adrian Wielgosik a0d6389bd6 avm2: Replace Activation.resolve_type by domain lookup 2023-07-08 19:51:38 +02:00
Adrian Wielgosik b38bd604db avm2: Fix Multiname-with-params formatting 2023-07-08 01:55:44 +02:00
Lord-McSweeney 5337975cba avm2: Remove old hack now that DOs use an instance allocator 2023-07-07 23:14:54 +02:00
Aaron Hill e9f4a92073 wgpu: Only log 'unsupported' warning once per filter type
This eliminates the console spam produced when an object with
an unsupported filter was onscreen.
2023-07-07 22:38:35 +02:00
Aaron Hill 61c50e636a
avm2: Convert `has_class_in_chain` to use a `GcCell<Class>` (#11494) 2023-07-07 16:22:38 -04:00
Lord-McSweeney b68008426a avm2: Use the current SWF version instead of root SWF version in MC.gotoAndPlay 2023-07-07 21:19:16 +02:00
nosamu c60742428c desktop: Use suitable CJK fonts for each language on Windows 2023-07-06 21:42:02 +02:00
tinaun 57ede6e1f2 desktop: load cjk fallback fonts using fontdb 2023-07-06 21:42:02 +02:00
Aaron Hill 4cf0735692 avm2: Implement Utils3D.projectVector and Utils3D.projectVectors 2023-07-06 11:34:40 -04:00
Aaron Hill fb9dbd21b0 tests: Fix stage3d_blend test formatting 2023-07-06 11:18:39 -04:00
Aaron Hill 90dbcfca5d render: Fix writing to varying register in vertex shader 2023-07-06 11:18:39 -04:00
Lord-McSweeney f8fa8a68cf avm2: Replace Option<Object<'gc>> with Object<'gc> in all native methods 2023-07-06 10:56:49 -04:00
Aaron Hill c295e3e481 avm2: Implement NetConnection.connect with a null `command` 2023-07-06 01:20:34 -04:00
Aaron Hill 009fab1889 core: Expose `LoaderInfo.parameters` and fix other properties
When using a 'Loader', properties on the 'contentLoaderInfo' become
set during specific events in the load sequence. In particular,
'LoaderInfo.bytesTotal' becomes available during the first 'progress'
event.

Also, 'LoaderInfo.parameters' is now properly set from the URL query
parameters. In Flash player, this work even with filesystem urls
(e.g. 'file:///some/path/to/file.txt?paramOne=valOne' will load
a file named 'file.txt', setting and expose the parameter 'paramOne'
with value 'valOne' in `LoaderInfo.parameters`). This required some
cleanup to the desktop and test NavigatorBackend impls to strip
out query parameters when loading a parameter from disk.

Previously, we would set `SwfMovie.parameters` manually from the url.
Now, the various `SwfMovie` constructors automatically extract
query parameters from the provided url. Outside of `SwfMovie`,
we only append *extra* parameters (e.g. those set from `flashvars`).

This makes CPMStar ads work, since the loaded SWF needs to access
`LoaderInfo.parameters`
2023-07-05 19:47:16 -04:00
Aaron Hill 8ac8be7213 avm2: Implement Graphics.drawPath
The 'winding' argument and filling behavior described in the docs
are not yet implemented. However, this implementation is good enough
for Scratch to render its default cat image.
2023-07-05 19:21:50 -04:00
Lord-McSweeney ab51654c17 avm2: Remove unused Activation.is_executing 2023-07-05 19:07:50 -04:00
Lord-McSweeney 2725d49119 avm2: Clean up Activation a little 2023-07-05 19:07:50 -04:00
Aaron Hill bbb5619bc9 tests: Add TextField Event.CHANGE test and update test input format 2023-07-05 18:00:59 -04:00
Aaron Hill 4695d1fa63 avm2: Implement 'change' event for TextField 2023-07-05 18:00:59 -04:00
Adrian Wielgosik 87ede6a052 avm2: Set correct `this` values in function calls 2023-07-05 22:36:20 +02:00
Aaron Hill 852367b09b wgpu: Use a vec4f for pixelbender ZEROED_OUT_OF_RANGE_MODE_INDEX
This could really be a single f32 (or even a boolean), but wgpu
on web requires a minimum size of 16 bytes for uniforms.
2023-07-05 21:23:22 +02:00
Aaron Hill 2d1da4d18e avm2: Throw TypeError when trying to parse malformed XML
Scratch detects if a string is valid XML by trying to construct
an XML object, and catching the thrown error.
2023-07-05 19:41:23 +02:00
Nathan Adams a99b30927f avm1: Panic if we see a shader filter 2023-07-05 19:18:00 +02:00
Nathan Adams 4fc170e5bd avm1: Implement gradient filters conversions 2023-07-05 19:18:00 +02:00
Nathan Adams bfedfbaa98 avm1: Implement displacement map filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 8a767492e6 avm1: Implement drop shadow filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 40b4f9bafa avm1: Implement glow filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 30027bc03e avm1: Implement convolution filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams df6064b2e9 avm1: Implement color matrix filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams b3629669bd avm1: Implement blur filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 73bc637ad7 avm1: Implement bevel filter conversions 2023-07-05 19:18:00 +02:00
Nathan Adams 2b48f579e6 avm1: Implement MovieClip.filters 2023-07-05 19:18:00 +02:00
Nathan Adams 681ff3dd24 avm1: Add helper method to get/set strength in filter objects 2023-07-05 19:18:00 +02:00
Crowdin Bot 36a950cf1e chore: Update translations from Crowdin 2023-07-05 18:57:39 +02:00
Aaron Hill e716b3fd7f avm2: Implement XML.descendants for attributes
We were previously only ever checking children,
and not attributes.

In order to avoid matching both attributes and elements
with a given name in 'descendants', `E4xNode::matches_name`
now checks `is_attribute` on the provided `Multiname`. This
requries changing several other parts of the codebase to
properly set this flag on `Multinames` provided by ActionScript.
2023-07-04 19:38:30 -04:00
Aaron Hill f7cbe3b7cd avm2: Implement Graphics.copyFrom 2023-07-04 16:12:29 -04:00
Aaron Hill 3401971729 web: Use Rc, Cell, and RefCell for non-thread-safe types 2023-07-04 20:50:46 +02:00
Aaron Hill 3006356410 render: Suppress clippy::arc_with_non_send_sync for now 2023-07-04 20:50:46 +02:00
Aaron Hill 2499db4874 desktop: Use Rc and RefCell for non-thread-safe types 2023-07-04 20:50:46 +02:00
Aaron Hill f22bef99b4 core: Fix some Clippy lints on the latest nightly 2023-07-04 20:50:46 +02:00
Lord-McSweeney 275c42b39c core: Correctly apply blend modes and filters from button records 2023-07-04 20:24:12 +02:00
Lord-McSweeney c943866745 core+avm1: Implement FLV onCuePoint for AVM1 2023-07-04 00:36:25 +02:00
Crowdin Bot ad7e73f77b chore: Update translations from Crowdin 2023-07-03 20:38:26 +02:00
Nathan Adams 146d565c02 render: Add Filter::scale() and use it to scale filter values (currently just blur_) 2023-07-03 20:13:40 +02:00
Nathan Adams 4ac13de2f3 wgpu: Switch PASS_SCALES to be accumulative scales, for better calculation of size upfront 2023-07-03 20:13:40 +02:00
renovate[bot] 13b1078142 chore(deps): lock file maintenance rust dependencies 2023-07-03 08:28:13 +03:00
Aaron Hill 768eaa1a01 avm2: Store at most a single type parameter in names/clasess
The only generic class is `Vector`, which only has a single parameter.
However, we currently store a list of type parameters in several places,
which requires redundant checks that the list only has one entry.

Instead, we now store an `Option` everwhere except for
`swf::Multiname::TypeName` (since the actual SWF format supports
multiple type parameters). We still perform the same check when loading
bytecode (the swf Multiname should only have at most one type
parameter), but the rest of the codebase can deal with an `Option`
instead.
2023-07-02 16:02:53 -04:00
Aaron Hill 2bcfabef53 desktop: Use `SubscriberInitExt::init` to capture `log` output
This method redirects output from the `log` crate to `tracing`,
which lets us get naga/wgpu logs.
2023-07-02 15:38:35 -04:00