Moulins
3ea67668c0
render: make Context3D renderers fully GC-agnostic
...
The 'gc_arena' dependency was only used to manipulate the `GcCell`s
containing the vertex and fragment shaders; replacing these by a
reference to a plain old `Cell` means tha the Context3D traits and
types do not need to interact with GC'd object anymore.
As a knock-on effect, we can also remove the `Activation` parameter
from most of the `Context3DObject` methods.
2023-07-14 16:06:36 -06:00
Nathan Adams
5c13d323b3
wgpu: Implement the undocumented ability to disable compositeSource for glow/shadow
2023-07-12 18:51:11 +02:00
Nathan Adams
c9a241f12b
wgpu: When sampling outside of blur texture, use 0
2023-07-12 18:51:11 +02:00
Nathan Adams
6f98b3d596
wgpu: Saturate alpha in glow shader
2023-07-12 18:51:11 +02:00
Nathan Adams
8cb6e5bdf0
wgpu: Implement drop shadow filter
2023-07-12 18:51:11 +02:00
Nathan Adams
aab03290be
wgpu: Add extra set of UVs to glow filter, to support separate blur rects
2023-07-12 18:51:11 +02:00
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
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
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
6e1f00edf2
render: Implement more PixelBender features ( #11800 )
2023-07-01 13:50:43 -04: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