Commit Graph

1060 Commits

Author SHA1 Message Date
Nathan Adams aba2394732 wgpu: Respect alpha for glows 2023-07-12 18:51:11 +02:00
Nathan Adams 1aa2ac28c2 wgpu: Slight opimitsation to blur filter by not needing to calculate full_width per fragment 2023-07-12 18:51:11 +02:00
Nathan Adams 30e7a1eac6 core: Account for filter size changes when drawing cacheAsBitmaps 2023-07-12 18:51:11 +02:00
Nathan Adams b30c522f9c wgpu: Implement glow filter 2023-07-12 18:51:11 +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
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
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 90dbcfca5d render: Fix writing to varying register in vertex shader 2023-07-06 11:18:39 -04: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 3006356410 render: Suppress clippy::arc_with_non_send_sync for now 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
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 26101ae979 render: Add 'renderdoc' feature/module for manual frame capture
This feature is disabled by default. When enabled, you can use
`ruffle_render::renderdoc::begin_frame_capture` and
`ruffle_render::renderdoc::end_frame_capture` to manually trigger
a RenderDoc frame capture (if Ruffle wasn't launched by RenderDoc,
this logs an error).

This is very useful when debugging Stage3D/PixelBender bugs, as you
can produce a capture containing only the relevant graphics calls.
2023-07-02 13:59:19 -04:00
Aaron Hill 6e1f00edf2
render: Implement more PixelBender features (#11800) 2023-07-01 13:50:43 -04:00
Nathan Adams a5915a9bdb swf: Make Color Copy 2023-06-29 20:32:36 +02:00
Nathan Adams 97ad60e66a wgpu: Pad out the BlurUniforms 2023-06-28 22:42:31 +02:00
Nathan Adams 7e96a2fdad wgpu: Blur size is whole kernel width, minus one and half it for the shader 2023-06-28 22:42:31 +02:00
Nathan Adams b90bebc65d wgpu: Blur filter is fallible, if nothing happened then just blit 2023-06-28 22:42:31 +02:00
Nathan Adams c0e932422f wgpu: Change blur to 2-pass separable box blur, multiplied by quality 2023-06-28 22:42:31 +02:00
Nathan Adams 447cd2a5f6 wgpu: Move create_filter_vertices to FilterSource::vertices 2023-06-28 22:42:31 +02:00
Nathan Adams fd0d414d02 wgpu: Add FilterSource::for_entire_texture convenience method 2023-06-28 22:42:31 +02:00
Nathan Adams 1096d7d35e wgpu: Create a FilterSource for common arg set, and removed need for #[allow(clippy::too_many_arguments)] 2023-06-28 22:42:31 +02:00
Nathan Adams 7f4d855de9 wgpu: Move Surface::apply_filter to Filters::apply, removing need for a surface at all 2023-06-28 22:42:31 +02:00
Nathan Adams 7c751d6be8 wgpu: Implement Default for TexturePool 2023-06-28 22:42:31 +02:00
Nathan Adams 4f6bac7840 wgpu: Refactor out filters into their own files 2023-06-28 22:42:31 +02:00
Aaron Hill ad8457b54d wgpu: Remove 'TextureWrapper.format' field
We can already get the foramt from the wgpu::Texture
2023-06-28 16:26:19 -04:00
Aaron Hill 54dd160897 wgpu: Remove 'width' and 'height' fields from Texture
This is already stored in wgpu::Texture
2023-06-28 13:00:49 -04:00
Nathan Adams 96e3d36a6e wgpu: Don't mark the filters as needing push constants 2023-06-26 23:18:45 +02:00
Nathan Adams e37958351e wgpu: Removed most uniforms from filters, they're not used or needed 2023-06-26 22:07:52 +02:00
renovate[bot] 3057aa59dd chore(deps): lock file maintenance rust dependencies 2023-06-25 21:53:00 -04:00
renovate[bot] f62dd17284 fix(deps): update rust crate indexmap to v2 2023-06-25 20:27:33 -04:00
Lord-McSweeney 8c40e97ab5 wgpu: nit: Fix incorrect label in blur filter 2023-06-26 00:00:03 +02:00
Nathan Adams fd4eaef2b6 wgpu: Don't create cacheAsBitmap for textures that are too large 2023-06-25 22:58:22 +02:00
Nathan Adams 628d8f66ad render: Add filters to BitmapCacheEntry 2023-06-25 21:58:46 +02:00
Nathan Adams 44c870ba91 wgpu: Move run_copy_pipeline to utils 2023-06-25 21:58:46 +02:00
Nathan Adams 4dde126e64 wgpu: Take in a &wgpu::Texture not our own texture as we don't need omore than that 2023-06-25 21:58:46 +02:00
Nathan Adams 0c71b83e36 wgpu: Don't perform copy inside Surface::apply_filter 2023-06-25 21:58:46 +02:00
Lord-McSweeney 08dfbc96be wgpu: Slight changes to blur filter 2023-06-24 16:55:40 +02:00
Nathan Adams f43560ab88 render: Switch to providing cacheAsBitmap entries all at once on submit frame 2023-06-24 01:42:04 +02:00
Nathan Adams 36aee1efcf wgpu: Specialise render_offscreen_for_cache to render directly to the texture 2023-06-24 01:42:04 +02:00
Nathan Adams 2594453831 render: Add render_offscreen_for_cache for more optimised CacheAsBitmap 2023-06-24 01:42:04 +02:00
Nathan Adams fe742194b1 core: Implement cacheAsBitmap behaviour 2023-06-24 01:42:04 +02:00
Nathan Adams 97c36b442a wgpu: Switch Multiply back to a complex shader, with dst.a==0 fix 2023-06-22 14:23:15 +02:00
TÖRÖK Attila 7bbaeb2a61 chore: Bump ouroboros to 0.17.0. 2023-06-17 18:49:05 -05:00
Nathan Adams 2427daf05c webgl: Don't hold onto an old copy of bitmap data for each image 2023-06-18 00:47:51 +02:00
Nathan Adams e9af73126f canvas: Refactor how BitmapData is made, to allow for empty bitmaps to be made later 2023-06-18 00:47:51 +02:00
Nathan Adams c374aaa19a canvas: Don't hold onto an old copy of bitmap data for each image 2023-06-18 00:47:51 +02:00
renovate[bot] 7a21756ddb chore(deps): lock file maintenance rust dependencies 2023-06-17 11:00:52 -05: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
renovate[bot] fc933f485f fix(deps): update wasm-bindgen 2023-06-15 20:50:04 +02: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
renovate[bot] 438e6f36ff chore(deps): lock file maintenance rust dependencies 2023-06-12 08:50:07 +03:00
renovate[bot] a621472336 chore(deps): lock file maintenance rust dependencies 2023-06-09 20:17:25 +03:00
Aaron Hill d44c9cceb1 wgpu: Cache compiled naga-agal shader module
We use an `lru::LruCache` inside `ShaderModuleAgal`. This automatically
gives us the proper garbage-collection behavior (when the Flash
Program3D instance is garbage collected, we'll drop the
`ShaderModuleAgal` and the cache).

The cache is keyed on the data needed to compile the shader (vertex
attributes and sampler overrides). This lets us avoid shader
recompilations when a Stage3D program repeatedly uses the same
Program3D with different sampler overrides / vertex attribute formats.
2023-06-08 02:57:47 -05:00
renovate[bot] f1fe998869 chore(deps): lock file maintenance rust dependencies 2023-06-04 22:53:18 -05:00
Nathan Adams eb70a4f361 core: Update gc_arena to 63dab12871321e0e5ada10ff1f1de8f4cf1764f9 2023-06-03 09:11:06 +02:00
Aaron Hill 2cd518013c
wgpu: Don't skip alpha/erase blend modes for BitmapData.draw (#11323)
We can skip these when we're drawing to a fresh buffer, but not when we're blending over an existing BitmapData texture.
2023-06-02 21:16:05 +00:00
Aaron Hill 999e2f5b71 wgpu: Implement Context3D.setScissorRectangle 2023-06-02 14:56:14 -05:00
relrelb abb0e33431 chore: Use Rust's `OnceCell`/`OnceLock`
They were stabilized in Rust 1.70.0, which was released yesterday.
This removes the `once_cell` dependency.
2023-06-02 22:21:38 +03:00
Aaron Hill 12e078bb2d wgpu: Fix calculation of image row padding 2023-05-28 23:35:53 -05:00
Aaron Hill 2ae15b05e8 core: Store Color as an u32 instead of a i32
This is a packed ARGB value, so it doesn't make sense for it to be
signed.
2023-05-28 16:52:09 -05:00
Nathan Adams b29a784968 wgpu: Remove render callback as it's no longer used 2023-05-24 23:50:48 +02:00
Nathan Adams b9322ba93a desktop: Render game separately to UI, blit both onto surface 2023-05-24 23:50:48 +02:00
Mike Welsh c00b4bf55c desktop: Initial GUI work 2023-05-24 23:50:48 +02:00
Aaron Hill da8d5bce3c naga-agal: Fix bugs and add tests for new ops 2023-05-24 13:34:15 -05:00
Mike Welsh 3257cc44cf naga-agal: Implement m33 and m34 ops 2023-05-24 13:34:15 -05:00
Mike Welsh 35ef04eadc naga-agal: Implement kil op 2023-05-24 13:34:15 -05:00
Mike Welsh f97bb9c2f1 naga-agal: Implement log, exp, pow, ddx, ddy, min, rsq, sge ops 2023-05-24 13:34:15 -05:00
Aaron Hill cc567c4e40 agal: Correctly check vertex_input_expressions cache
We need to use the same logic that we use for `get_varying_pointer`,
since the AGAL shader can access vertex inputs in any order.
2023-05-23 17:20:29 -05:00
renovate[bot] 5d2477fe98 chore(deps): lock file maintenance rust dependencies 2023-05-22 19:12:08 +03:00
Aaron Hill 5d48484d99 agal: Add support for indirect register loads
These are poorly documented, but from looking at OpenFL
and AGALMiniAssembler, they allow performing loads of the
form `vc[va0.x + offset]` - that is, computing a dynamic register
number, instead of using the register number present in the opcode.
2023-05-21 09:40:11 -05:00
Aaron Hill 5d62ef90f2 wgpu: Use intermediate buffer for Context3DCommand::CopyBitmapToTexture
In a previous PR, I introduced an optimization that used
`copy_texture_to_texture` to copy directly from a BitmapData GPU
texture to a Stage3D GPU texture.

Unfortunately, this optimization is incorrect. A BitmapData GPU
texture can be modified at any time by normal AVM2 code - in
particular, in might be modified before we submit the encoded
`copy_texture_to_texture` command. This shows up in Sniper Team,
which re-uses BitmapData objects for multiple distinct textures.
The previous 'optimization' resulted in the wrong BitmapData contents
getting uploaded to a texture (since it was changed before the copy
command was submitted).
2023-05-20 17:38:26 -05:00
Aaron Hill 0864853d44 avm2: Allow passing `null` to `Context3D.setProgram`
This clears the vertex and fragment shader programs
(bringing the Context3D back to its initial state).
2023-05-20 16:23:03 -05:00
Aaron Hill 7619594b1c agal: Implement Float1 to vec4f conversion 2023-05-18 16:12:22 -05:00
Aaron Hill 7004e98b23 avm2: Don't validate Context3DVertexBufferFormat when buffer is null
This matches Flash Player's behavior - some SWFS try to pass in 'null'
for both the buffer and format.
2023-05-18 15:14:29 -05:00
iwannabethedev 8cd5414c5d
Fix overflow bug in `shape_utils::winding_number_line()` 2023-05-17 07:21:13 +03:00
renovate[bot] f969bdce71 fix(deps): update wasm-bindgen 2023-05-17 06:44:50 +03:00
relrelb 1065662e84 web: Use `JsValue::from_bool()` 2023-05-15 21:04:47 +03:00
Aaron Hill bd2be88711 wgpu: Fix MSAA and depth buffer handling in SetRenderToTexture
When multisampling is enabled, we should create a new multisampled texture,
and use the existing texture as the resolve buffer. We also need to
call `update_has_depth_texture` to keep our pipeline aware of whether
or not we currently have a depth buffer attached.

Makes progress on #10641 (it has a stack overflow after
this PR, due to an unrelated issue).
2023-05-15 09:34:30 -05:00
renovate[bot] 5b26d1b2ee fix(deps): update wasm-bindgen 2023-05-15 10:00:49 +03:00
relrelb 4a26ceb14b render: Use `swf::Point<Twips>` in more places 2023-05-14 22:48:41 +03:00
relrelb 220f8cd1cf render: Use `swf::Point<Twips>` in `shape_hit_test()` 2023-05-14 22:48:41 +03:00
relrelb 25a1d53f72 render: Use `swf::Point<Twips>` in `calculate_shape_bounds()` 2023-05-14 22:48:41 +03:00
relrelb 598c8cde0e render: Use `swf::Point<Twips>` in `DrawCommand::CurveTo` 2023-05-14 22:48:41 +03:00
relrelb 544e445d2f render: Use `swf::Point<Twips>` in `DrawCommand::LineTo` 2023-05-14 22:48:41 +03:00
relrelb e5c7d70f3f render: Use `swf::Point<Twips>` in `DrawCommand::MoveTo` 2023-05-14 22:48:41 +03:00
iwannabethedev a023e11098 render: Clean-up. 2023-05-12 22:42:44 +02:00
iwannabethedev 77e1cc96c2 render: Fix of panic in #10955. 2023-05-12 22:42:44 +02:00
relrelb 660acac427 swf: Use `PointDelta<Twips>` in `ShapeRecord` 2023-05-11 08:55:44 +03:00
relrelb b93a32af0f swf: Use `Point<Twips>` in `StyleChangeData::move_to`
No functionality change.
2023-05-11 08:55:44 +03:00
Aaron Hill e488cc9f7a wgpu: Allow unaligned writes to IndexBuffer3D
wgpu requires buffer copy sizes and offsets to be 4-byte aligned.
Unfortunately, ActionScript can perform 2-byte aligned uploads
into an IndexBuffer3D.

To support this, we now keep a copy of the IndexBuffer3D on the CPU.
When performing an upload to the buffer, we round the offset down
and the size up to the nearest 4-byte aligned value. The cpu buffer
is used to fill out the write with existing data, so that we don't
corrupt the contents of the GPU buffer.

To avoid introducing a new RefCell, I've changed IndexBuffer3D
to use a `Box` instead of an `Rc` to store the trait object.
This allows us to pass a mutable reference down to the backend.
2023-05-10 18:20:29 -05:00
Nathan Adams 2b6829692c wgpu: Resize textures if they're bigger than the system supports 2023-05-05 19:03:15 +02:00
Aaron Hill 22c13d41da wgpu: Use Context3DCommand by value 2023-05-05 11:43:43 -05:00
Nathan Adams c5293bd981 core: Don't actually apply a filter if it's unsupported, just copy 2023-05-03 21:15:48 +02:00
Nathan Adams 50a0298d30 render: Fix calculations in PixelRegion::clamp_with_intersection (+ new test) 2023-05-03 21:15:48 +02:00
Nathan Adams adabb81804 core: Introduce PixelRegion::clamp_with_intersection and made most operations with two overlapping regions use it 2023-05-03 21:15:48 +02:00
iwannabethedev 49962edf3a render: Fix obsolete/wrong documentation. 2023-05-03 09:26:37 +03:00
relrelb 85a9ec77c5 render: Fix wgpu renderer name 2023-05-03 01:12:19 +03:00
iwannabethedev 307f364d6f
web: Log used renderer
Log which renderer-backend was actually used in the
browser console.
2023-05-02 23:59:57 +03:00
relrelb 24079518d9 tests: Expand `Matrix` unit tests to cover `PointDelta`s 2023-04-29 22:29:37 +03:00
relrelb ef79d556b4 tests: Allow trailing commas in `Matrix` unit tests 2023-04-29 22:29:37 +03:00
relrelb 3046d68da1 swf: Introduce `PointDelta`
Generally, when transforming a difference between two points, `p1`
and `p2`, with a matrix `m`, we would like the following property
to hold:

```
m * (p1 - p2) == m * p1 - m * p2
```

Unfortunately, it wasn't like this before, because matrices have a
translation component, which is non-linear. In `m * p1 - m * p2`,
the translations of `m * p1` and `m * p2` are the same and therefore
cancel out each other. However, in `m * (p1 - p2)` the translation
stays.

In order to preserve this property, introduce a new `PointDelta`
type which is not subject to translation when transformed by a matrix.

For now, the following operations are supported:

* `Point - Point -> PointDelta`
* `Point + PointDelta -> Point`
* `Point += PointDelta`
* `Point - PointDelta -> Point`
* `Point -= PointDelta`

As a consequence, the expression `position + global_to_local_matrix * mouse_delta`
in `update_drag()` now ignores translation, which fixes #817.
2023-04-29 22:29:37 +03:00
relrelb 60ffe07ae7 chore: Use `swf::Point` in many places
Convert nearly all instances of `(Twips, Twips)` (maybe besides in
`shape_utils.rs`) to `swf::Point<Twips>`.
2023-04-27 22:14:03 +03:00
Aaron Hill 3bb8c8fb4f wgpu: Update wgpu to 0.16.0 and naga to 0.12.0 2023-04-25 09:24:53 -05:00
Nathan Adams d9241c914e chore: Hold wgpu and naga back until naga_oil updates to naga 0.12 2023-04-24 01:22:07 +02:00
renovate[bot] 3b3c08a354 chore(deps): lock file maintenance rust dependencies 2023-04-24 01:22:07 +02:00
Nathan Adams 4f4327b152 wgpu: Fix drawing a transparent bitmap with MSAA 2023-04-18 23:15:42 +02:00
Aaron Hill 962cf92223 avm2: Implement Context3D.setSamplerStateAt
This fixes pixelated backgrounds in Fancy Pants World 4 Part 3
2023-04-05 16:44:07 -07:00
Mike Welsh 7a6e6cf214 naga-agal: Add fractal shader test 2023-04-05 12:22:13 -07:00
Mike Welsh b578849958 naga-agal: Allow boolean binary ops with multiple components 2023-04-05 12:22:13 -07:00
Mike Welsh e92e530321 naga-agal: Support `abs` op 2023-04-05 12:22:13 -07:00
Mike Welsh 792cfd82c7 avm2: Implement `Context3D.setColorMask` 2023-04-05 12:22:13 -07:00
Mike Welsh e07bde884e render: Inline `CommandList` methods 2023-04-04 13:10:45 -07:00
Mike Welsh 7779416894 render: Fix masker-in-masker rendering
Flash does not support nested mask regions and instead merges them
into a single clip region.

For example, this occurs when using a dynamic text field as a mask.
One mask layer contains the glyphs, while the second layer is the
bounds of the text field. The text field bounds end up being
ignored when the text field is used as a mask, allowing the text
outside the bounds to be visible.

Add `CommandList::maskers_in_progress` to keep track of the mask
state and discard drawing commands for inner maskers.

Fixes #9664.
2023-04-04 13:10:45 -07:00
Nathan Adams 06bc4e1403 wgpu: Fix sync issue introduced in #9753 and added test 2023-04-04 11:11:57 -07:00
TÖRÖK Attila 2ad43994b8 video: Don't do colorspace conversion in the video backend 2023-04-04 00:15:07 -07:00
TÖRÖK Attila 493971ab8a render: Make RenderBackend::update_texture() take a Bitmap (like register_bitmap()) 2023-04-04 00:15:07 -07:00
TÖRÖK Attila c9a2c636c9 render/webgl: Make use of Bitmap::to_rgb() to avoid making an alpha channel for Yuv420p bitmaps 2023-04-04 00:15:07 -07:00
TÖRÖK Attila ba43b0930f render: Add Bitmap::to_rgb() 2023-04-04 00:15:07 -07:00
TÖRÖK Attila 5f94476b2a render: Add BitmapFormat::Yuv420p and BitmapFormat::Yuva420p 2023-04-04 00:15:07 -07:00
TÖRÖK Attila 322e17a5ab render: Bitmap::bytes_per_pixel() -> Bitmap::length_for_size() 2023-04-04 00:15:07 -07:00
Mike Welsh 549a06d00f wgpu: Slight optimization to color shader
The color doesn't change per pixel, so calculate the color in the
vertex stage instead of the fragment stage.
2023-04-03 14:33:37 -07:00
renovate[bot] cd3ad90d61 chore(deps): lock file maintenance rust dependencies 2023-04-02 22:00:49 -07:00
Aaron Hill a2fa362091 wgpu: Implement double buffering for Context3D
This matches the Context3D docs. Calling 'present' swaps
the buffers.

I wasn't certain if we actually need a double-buffered depth
texture, but I included one just to be safe.
2023-04-02 19:24:23 -07:00
Aaron Hill 671ebdfa8f wgpu: Execute Context3D commands immediately
Now that most of the complicated Context3D methods have been
implemented, we can simplify the overall design. Instead of queueing
up commands and having `present` execute them in a loop, we
can execute each command immediately. The key insight is that
a `RenderPass` is only needed for `DrawTriangles`, so we don't
have to store it in `Context3D` and deal with complicated lifetime
issues.

The old behavior gave us implicit double-buffering behavior,
since nothing would get rendered until a 'present' call.
Now that a 'drawTriangles' call will immediately submit
a draw command, we need to implement actual double buffering.
This is done in the next commit.
2023-04-02 19:24:23 -07:00
Aaron Hill 7809000170 wgpu: Fix filter texture copy size calculation
I incorrectly changed this in #10373

Fixes #10380
2023-04-01 11:04:55 -05:00
Mike Welsh b62040884c core: Make `DisplayObject::global_to_local` fallible
* `global_to_local` returns `None` if the object has zero scale.
 * Adjust AVM `globalToLocal` methods to return the untransformed
   point on failure.
 * Add `DisplayObject::mouse_to_local` to handle AVM `mouseX`
   and `mouseY` coordinates. For zero scale objects, these end up
   returning values based on the twips-to-pixels scale,
   divided by 20.
2023-03-31 16:26:11 -07:00
Mike Welsh 54b7094c16 render: Make `Matrix::inverse` fallible
* Add `Matrix::determinant`.
 * Rename `Matrix::invert` to `inverse`.
 * `Matrix::inverse` return an `Option`, with `None` returned
    for non-invertible matrices.
 * AMV `Matrix::invert` duplicates the code as the behavior is
   different (works in f64 and not twips, etc.)
2023-03-31 16:26:11 -07:00
Nathan Adams adadb8a26d wgpu: Use swap_remove instead of remove for buffer pool 2023-03-31 16:57:52 +02:00
Nathan Adams c51ba098f6 render: Rename PixelRegion's (min|max)_(x|y) to (x|y)_(min|max) 2023-03-31 16:57:52 +02:00
Nathan Adams 94e5aa8f34 core: Fix calculating dirty area of BitmapData.draw() with rotation 2023-03-31 16:57:52 +02:00
Nathan Adams f0ebefd624 tests: Add bitmapdata recursive draw test 2023-03-31 16:57:52 +02:00
Nathan Adams c85910b46d wgpu: Fixed panic when rendering texture to itself, by always rendering to an intermediary 2023-03-31 16:57:52 +02:00
Nathan Adams 78f9bb13d6 render: Fix PixelRegion::for_region_i32 for negative coordinates 2023-03-31 16:57:52 +02:00
Nathan Adams e614265c17 core: Move fill_rect from BitmapData to bitmap_data_operations, fixed a bug when using non-standard values, and added better tests for fill_rect showing the bug 2023-03-31 16:57:52 +02:00
Nathan Adams 311a165149 wgpu: Reintroduce texture promoting; only preassign buffer when the texture is frequently written/&read 2023-03-31 16:57:52 +02:00
Nathan Adams 6e859891af render: Take in dirty region in update_texture, only upload those pixels 2023-03-31 16:57:52 +02:00
Nathan Adams 137593b6a6 render: Extract (u32, u32, u32, u32) to PixelRegion 2023-03-31 16:57:52 +02:00
Nathan Adams 4ccc75c4d6 wgpu: Changed AlwaysIncompatible to AlwaysCompatible, whoops 2023-03-31 16:57:52 +02:00
Nathan Adams 71ef10b94b wgpu: Reuse buffers for BitmapData.draw, preferring smallest buffer available 2023-03-31 16:57:52 +02:00
Nathan Adams 2cc1db6f8e wgpu: Enable BufferPool to reuse existing buffers if they're compatible 2023-03-31 16:57:52 +02:00
Nathan Adams e0bd911f2f render: Only copy a possible dirty area for bitmapdata.draw & read 2023-03-31 16:57:52 +02:00
relrelb 236a97bf31 render: Replace `ColorTransform` with `swf::ColorTransform` 2023-03-29 23:27:20 -07:00
relrelb d71617209a render: Remove `RenderBackend::register_glyph_shape`
Use just `RenderBackend::register_shape` instead.
2023-03-30 01:46:04 +03:00
renovate[bot] 5052e942b5 chore(deps): lock file maintenance rust dependencies 2023-03-28 09:31:15 +03:00
Aaron Hill a52cb7461e wgpu: Implement MSAA support for Stage3D
When we receieve a nonzero 'antiAlias' parameter, we create
create a non-multisampled resolve buffer to use with WGPU.

Several tests were already requesting antialiasing, so their
output images are now anti-aliased without any changes to
the tests themselves.
2023-03-26 18:05:41 -07:00
Aaron Hill b140029e95 render: Fix BitmapData.applyFilter with non-full sourceRect
Previously, we were scaling down the source image to fit into
the smaller sourceRect, instead of cropping at the original scale.
This broke the background textures in Fancy Pants World 4 Part 2,
as the scaled-down output image resulted in a smaller rectangle
being returned from 'getColorBoundsRect'

We now crop the image by properly constructing the UV-coordinate
transformation matrix. We were also using the wrong value for the
'destPoint' y coordinate, which I fixed.

This slightly changes the image output of two tests - the new images
now more closely match the Flash output.
2023-03-25 18:44:01 -07:00
relrelb 39b53c76d6 ci: Deny warnings on Web
As suggested in https://github.com/ruffle-rs/ruffle/pull/6935#pullrequestreview-967181111.
2023-03-24 19:16:32 -07:00
Nathan Adams eb44cc5395 render: Made ShapeHandle an Arc of an internal, droppable mesh 2023-03-23 01:44:27 -07:00
Nathan Adams cc8ac4fde1 render: Remove RenderBackend::replace_shape 2023-03-23 01:44:27 -07:00
Mike Welsh 1d12fc6169 render: Fix types depending on `tessellator` feature 2023-03-22 20:30:39 +01:00
renovate[bot] d7c842a139 chore(deps): lock file maintenance rust dependencies 2023-03-21 14:27:27 +01:00
renovate[bot] f6f646a756 chore(deps): lock file maintenance rust dependencies 2023-03-19 19:45:30 -07:00
Nathan Adams 078672782c wgpu: Skip Alpha/Erase blends with no parent Layer 2023-03-19 14:59:48 -07:00
Mike Welsh 2d6d8ea0f4 core: Fix BitmapData.colorTransform
* Pixels with 0 alpha are not affected by color transforms.
 * Color channels should be clamped to the 0-255 range.
 * A color transform with only an alpha multiplier of >1 has no
   effect.
2023-03-19 09:59:13 +01:00
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
Nathan Adams bc9e1d7c14 swf: Rename HAS_FILL_WINDING_RULE to NON_ZERO_WINDING_RULE 2023-03-18 19:14:08 -07:00
Nathan Adams 6987c81623 render: Respect HAS_FILL_WINDING_RULE 2023-03-18 19:14:08 -07:00
Nathan Adams e7b812c2cd render: Glyphs are assumed to have HAS_FILL_WINDING_RULE 2023-03-18 19:14:08 -07:00
Aaron Hill 580c18844e naga-agal: Remove 'do_extend'
This was a leftover from before we started usiung vec4 everywhere
for compatibility with AGAL. There are a few specific opcodes that
don't need extension, but it doesn't depend on the destination
register.
2023-03-17 20:11:59 -05:00
Aaron Hill 1e973af747 avm2: Implement Context3D.setRenderToTexture/setRenderToBackBuffer
In the process, I fixed a bug where we were clearing the depth
and stencil buffers with the incorrect value.

This makes Fancy Pants World 4 Part 1 playable to completion
(though there are still some rendering issues that need
to be fixed).
2023-03-17 20:11:59 -05:00
Aaron Hill 1edcbe438d core: Avoid several BitmapData GPU -> CPU sync
We don't need to perform a sync when getting the width/height,
getting or setting the 'disposed' status, or uploading to
a Context3D texture.

The Context3D change (using `copy_texture_to_texture` instead
of relying on the CPU pixels) has the added advantage of avoiding
a validation error when our source image row length isn't aligned
to `COPY_BYTES_PER_ROW_ALIGNMENT`

This dramatically speeds up the Fancy Pants World 4 loading time
(on a branch with my XML prs merged). Without this change, my
machine spends around 10 seconds on a blank white screen after
clicking 'Play'. With this change, the time spent on that screen
is reduced to around 1-2 seconds.
2023-03-17 04:56:03 -05:00
Aaron Hill 53c6011ade render: Support more Context3D texture formats
None of these formats can currently be implemented
correctly with wgpu, so we just use Rgba8Unorm instead.

The handling of opaque compressed textures is a little
sketchy - it should work for 'normal' SWFs that upload
an opaque BitmapData, but we might need to manually
adjust the alpha values if
2023-03-16 17:40:41 -05:00
Aaron Hill 1dd0d237ab render: Correctly handle BYTES_4 vertex data
Each byte gets normalized into a float in the range [0, 1]
2023-03-16 13:20:11 -05:00
TÖRÖK Attila 96d1f19e6c
chore: Port to bitflags 2.0.0
* Bump bitflags to 2.0.0
* Sprinkle Clone, Copy, Eq, PartialEq, and Debug derives where needed
* Call `bits` on bitflags, as it is now a method
* Switch from `from_bits_truncate` to `from_bits_retain` on bitflags where needed
* Bump h263-rs for the bitflags 2.0.0 dependency

As part of porting to bitflags 2.0.0, see:
https://kodraus.github.io/rust/2022/10/07/bitflags2.html#upgrading-to-2x
2023-03-15 20:06:10 -07:00
Aaron Hill e194883ef6 naga-agal: Correctly access vertex shader FunctionArgument
I had previously applied this fix to fragment shaders,
but I forgot to apply it to vertex shaders as well.
2023-03-15 20:12:21 -05:00
Aaron Hill acbc802c94 avm2: Fix VertexBuffer3D.uploadDataFromByteArray size calculation
We were ignoreing 'data32PerVertex'.
To make the code clearer, I've renamed the variable to
'data32_per_vertex', and made it a 'u8' (as it has a maximum of 64)
2023-03-15 19:52:09 -05:00
Aaron Hill fea885f3af render: Implement Context3DTextureFormat.BGRA using an RGBA texture
Webgl doesn't support BGRA textures, so this lets us use
Stage3D textures on the web backend. As a bonus, this speeds up
uploading an BitmapData to a Context3dTextureFormat.BGRA texture,
since we no longer need to change the format before copying.

This makes Solarmax2 playable on the web backend.
2023-03-13 13:30:15 -05:00
Nathan Adams b527054a1e
render: Make retrieve_offscreen_texture pass the raw buffer (#9936) 2023-03-13 00:00:42 +00:00
Aaron Hill de8448e00a
avm2: Implement Stage3D depth test, blend factors, and fix bugs (#9845) 2023-03-12 23:43:58 +00:00
TÖRÖK Attila 109e151fa6 render/all: Clamp gradient focal point to be between -/+0.98 2023-03-12 23:54:59 +01: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
TÖRÖK Attila 7d3a2d14b7 render/wgpu: Delete the now unused buffer bug detection shader 2023-03-12 15:53:16 -05:00
TÖRÖK Attila d356b7258a wgpu: Fix gradient regression 2023-03-07 20:35:29 +01:00
Nathan Adams 026efe7f18 render: Moved out some Gradient fields into webgl as it's no longer needed in wgpu 2023-03-06 23:22:09 +01:00
Nathan Adams 0cca4983e4 wgpu: Merge gradient shaders together 2023-03-06 23:22:09 +01:00
Nathan Adams 622abe60d1 wgpu: Extract T->Color lookup from gradient shader to Mesh construction 2023-03-06 23:22:09 +01:00
renovate[bot] 130144a76d fix(deps): update rust dependencies 2023-03-05 20:43:46 -06:00
relrelb 83c15b8033 render: Replace `BoundingBox` with `swf::Rectangle` 2023-03-04 21:54:23 +02: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
Aaron Hill 2748b95c86 avm2: Improve Stage3D support for textures, register types, and opcodes
This is a very large diff, but most of it comes from test files and
output.

This PR ads partial support for the following Stage3D shader features:
* Normal (square), rectangle, and cube textures
* Varying and temporary registers
* Lots of opcodes

The combination of these allows us to get a raytracing program
fully working in Ruffle. I've included it as image test.
Currently, this test is very slow (about 90 seconds on my machine),
as the code I'm using (https://github.com/saharan/OGSL) includes
its own shader language and compiler. THe raytracing demo
first compiles its own shader language to AGAL, and then starts
rendering the scene.

Limitations:
* Many opcodes are still unimplemented
* Most non-default texture options (e.g. mipmaps) are not implemented
2023-03-03 15:58:46 -06:00
Nathan Adams 545193b098 swf: Deduplicate GradientFilter again 2023-02-28 16:25:12 +01:00
Nathan Adams f79015e201 render: Use swf Filter types where possible. Gradient types had to be split into duplicate classes to allow for different trait impls based on which gradient filter type it is. 2023-02-28 16:25:12 +01:00
Nathan Adams 9224aeca5d swf: Add DropShadowFilter::hide_object(), it's the only time COMPOSITE_SOURCE is used 2023-02-28 16:25:12 +01:00
Nathan Adams b8f7c66980 core: map_point in DisplacementMapFilter is i32 not u32 2023-02-28 16:25:12 +01:00
Nathan Adams 3777210117 core: Angle from swf tag is in radians, convert it to degrees 2023-02-28 16:25:12 +01:00
Nathan Adams acc3180db7 core: Strength in filters is a f32, not u8 2023-02-28 16:25:12 +01:00
Nathan Adams 7da2a061cc swf: ColorMatrixFilter::matrix is actually f32, not Fixed16 2023-02-28 16:25:12 +01:00
Nathan Adams fc00ae8eb6 core: Load filters from PlaceObject tag 2023-02-28 16:25:12 +01:00
Nathan Adams e39fbe871d render: Add Filter::GradientGlowFilter 2023-02-28 16:25:12 +01:00
Nathan Adams bb38a7fa55 render: Add Filter::GradientBevelFilter 2023-02-28 16:25:12 +01:00
Nathan Adams c8030d047d render: Add Filter::GlowFilter 2023-02-28 16:25:12 +01:00
Nathan Adams c9656c429e render: Add Filter::DropShadowFilter 2023-02-28 16:25:12 +01:00
Nathan Adams dbe2efff00 render: Add Filter::DisplacementMapFilter 2023-02-28 16:25:12 +01:00
Nathan Adams f9c7303f01 render: Add Filter::ConvolutionFilter 2023-02-28 16:25:12 +01:00
Nathan Adams 9c1f6ea129 render: Add Filter::BevelFilter 2023-02-28 16:25:12 +01:00
Nathan Adams 5ee3a4b512 avm2: Extract out the Value -> Filter logic into a trait 2023-02-28 16:25:12 +01:00
renovate[bot] 71e24eedba fix(deps): update rust dependencies 2023-02-27 11:48:53 +02:00
relrelb dc9ec40d31 chore: Allow `clippy::bool_to_int_with_if`
Seems like Clippy no longer complains about it.
2023-02-26 13:23:38 +02:00
Nathan Adams 01af1af4d9 webgl: Fixed blown out colortransform in webgl 2023-02-24 19:01:41 +01:00
Nathan Adams edd7f80341 wgpu: Fix blown out colors when transforming them above 100% - fixes #9698 2023-02-24 19:01:41 +01:00
Aaron Hill 455124d3ba render: Fix blending onto BitmapData contents
When rendering to an offscreen texture for `Bitmapdata.draw`,
we first render to a temporary frame buffer, and then copy the contents
of the frame buffer back to the target texture. However, this results
in blend modes being incorrectly applied - for example, rendering with
BlendMode.SUBTRACT will subtract against the framebuffer (which starts
with each pixel as 0x00000000), instead of the previous BitmapData
contents.

To fix this, we now use our texture target as the frame buffer
when performing `render_offscreen`. This ensure that we blend
over existing pixels (taking into account the `blendMode` provided
in the `BitmapData.draw` call).

When multisampling is enabled, we use a copy pipeline to copy
the existing contents of our texture to a fresh multisampled frame
buffer (the non-multisampled texture target becomes our resolve buffer).
2023-02-23 09:52:56 -06:00
Nathan Adams 6539262db7 render: Add Quality option to RenderBackend::render_offscreen 2023-02-22 17:36:55 +01:00
relrelb 2aaf337b6a swf: Introduce `BlurFilterFlags` 2023-02-21 16:55:13 +02:00
renovate[bot] a27bd66b58 fix(deps): update rust dependency patches 2023-02-13 04:59:31 +01:00
Aaron Hill c597f9f996 core: Fix Clippy lints on nightly 2023-02-13 03:38:54 +01:00
renovate[bot] fed24aa243 fix(deps): update rust dependencies - wasm-bindgen related 2023-02-13 02:57:52 +01:00
Nathan Adams 0e9b1e4a77 wgpu: Better support for 2x and 8x msaa 2023-02-06 16:08:04 +01:00
Nathan Adams 68761608fc desktop: Add --quality option 2023-02-06 16:08:04 +01:00
Nathan Adams 1cb3ea7bf9 wgpu: Store quality, not sample_count, and calculate the correct sample count per format 2023-02-06 16:08:04 +01:00
Nathan Adams b95983b492 wgpu: Hook up set_quality 2023-02-06 16:08:04 +01:00
Nathan Adams d8e924affc render: Add RenderBackend::set_quality method, and call it from core 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 3411a04cef render: Made render specific Filter enum & structs, as swf ones don't map 1:1 to potential filters 2023-02-05 18:41:43 +01:00
Nathan Adams b5a250e16f render: Changed render_offscreen to return an Option instead of an Result 2023-02-05 18:41:43 +01:00
Nathan Adams e73389aa71 wgpu: Implement blur filter 2023-02-05 18:41:43 +01:00
Nathan Adams 284a58c817 avm2: Implement BitmapData.apply_filter for ColorMatrixFilter 2023-02-05 18:41:43 +01:00
Nathan Adams 72bfd499f8 wgpu: Reuse whole-mesh uniform buffer for gradients 2023-02-05 18:02:19 +01:00
Nathan Adams 013a2424ef wgpu: Only use uniform buffers for gradients, we don't need storage buffers now that we squeeze the ratios into alignment 2023-02-05 18:02:19 +01:00
Nathan Adams 3bc7d44e9c wgpu: Reuse the same vertex and index buffer for an entire mesh 2023-02-05 18:02:19 +01:00
Nathan Adams 571a1780e2 wgpu: Provide usage and alignment to BufferBuilder 2023-02-05 18:02:19 +01:00
Nathan Adams cbc227b0a0 wgpu: Split up mesh creation into a 2 step process so we can reuse the same buffer for each draw 2023-02-05 18:02:19 +01:00
Nathan Adams a3a7f79f04 render: Switch from log to tracing 2023-02-05 18:02:19 +01:00
Nathan Adams f9b378b29a wgpu: Changed most pipelines & shaders to only use Pos, not Pos and Color, as vertex attribs 2023-02-05 18:02:19 +01:00
renovate[bot] caaf6d5c87 fix(deps): update rust dependencies 2023-01-31 09:39:42 -06:00
Nathan Adams 5dd3060a28 wgpu: Ensure we clear before blending an object onto nothing 2023-01-29 20:45:01 +01:00
Nathan Adams 7b1c101c81 wgpu: Fix repeat & reflect gradients 2023-01-29 17:17:44 +01:00
Aaron Hill 184734267d tests: Deny unknown fields when deserializing test.toml files
This will catch typos and misplaced options when modifying tests.
2023-01-28 16:27:43 -06:00
Nathan Adams 9b43836d1d tests: Allow executing of with_renderer tests always, but image comparison is still gated 2023-01-28 12:15:59 -07: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
renovate[bot] 8b6eef1715 fix(deps): update rust dependencies 2023-01-24 20:10:40 -06:00
Nathan Adams 1bfa69ade2 wgpu: Guard against infinite loops in gradient shader - fixes #9260 2023-01-23 23:25:30 +01:00
Aaron Hill ffc393e3e8 render: Work around naga_oil duplicate definition bug 2023-01-23 11:31:04 +01: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 a71d14d31c Fix wasm build 2023-01-23 11:31:04 +01:00
Aaron Hill 0fe8ef6c2d Get naga_oil shaders working 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
Aaron Hill e2954821ea
core: Take two - delay reading image back from render backend using `SyncHandle` (#9184)
* Take two: Delay reading image back from render backend using `SyncHandle`

This allows us to avoid blocking immediately after a `BitmapData.draw` call.
Instead, we only attempt to use the `SyncHandle` when performing an operation
that requires the CPU-side pixels (e.g. BitmapData.getPixel or BitmapData.setPixel).

In the best case, the SWF will never explicitly access the pixels of
the target BitmapData, removing the need to ever copy back the render backend
image to our BitmapData. If the SWF doesn't require access to the pixels immediately,
we can delay copying the pixels until they're actually needed, hopefully allowing
the render backend to finish processing the BitmapData.draw operation in
the backenground before we need the result.

Now that the CPU and GPU pixels can be intentionally out of sync with
each other, we need to ensure that we don't accidentally expose 'stale'
CPU-side pixels to ActionScript (which needs to remain unaware of
our internal laziness). We now use a wrapper type `BitmapDataWrapper`
to enforce that the `SyncHandle` is consumed before accessing the
underlying `BitmapData.

* core: Skip GPU->CPU sync for source and target BitmapData during draw

* Introduce DirtyState enum
2023-01-21 21:08:04 +00:00
Nathan Adams b5c6d5debe wgpu: Don't panic if rendering a None bitmap - fixes #9188 2023-01-17 19:34:51 +01:00
Nathan Adams 580cce29db wgpu: Update to wgpu fork with buffer bug fix 2023-01-17 05:59:55 +01:00
Nathan Adams 3c4710cfb5 wgpu: Only show current limits in debug info 2023-01-16 23:18:42 +01:00
TÖRÖK Attila ec462115ef core: nit: Use `strip_prefix` instead of `starts_with` and subslicing.
As suggested by relrelb in a review note for #8820.
2023-01-16 17:33:41 +01:00
Nathan Adams 6138714fa7 wgpu: Fix buffer bug detection 2023-01-16 17:22:04 +01:00
Mike Welsh 9cd6849772 core: Append EOI marker to JPEG data when missing
Fixes #4209.
2023-01-16 03:03:28 +01:00
Mike Welsh cceb18910b core: Fix handling of invalid EOI+SOI marker in JPEG data (fix #8775)
Previously we were removing the first occurrence of the invalid
0xFFD9FFD8 byte sequence in JPEG data, but this would break the
JPEG if it happened to contain this byte sequence elsewhere (for
example, EXIF data). Instead, properly parse the JPEG markers
searching for the invalid marker sequence.

Fixes #8775.
2023-01-16 03:03:28 +01:00
Nathan Adams 3279a920b4 wgpu: Use a temporary wgpu fork that increases push constants limit on webgl & speeds up start time 2023-01-15 18:19:11 +01:00